Steps to reproduce
Open a console, enter moment.locale()
.
Since 0.12.4 this sticks at “en”, whatever language I choose in Obsidian.
It used to show the 2-letter code of whatever Obsidian language was selected in settings—thus the only reliable way (until 012.3) to set correct number formats for output.
Almost all my code that outputs numbers uses
number..toLocaleString(moment.locale(), {maximumFractionDigits: 1})
and is now broken.
I already disabled all community plugins and CSS snippets one-by-one to find the cause, because it seems to work in the old help vault. (Does that ever get updated?)
I cannot use navigator.language
, because that always sticks with OS’s language setting (“de”). And I have to switch between English and German and other languages a lot.
I’m at a loss, any help/bug checks/debugging suggestions welcome!
Expected result
moment.locale()
(and ideally also navigator.language
) reflecting the language Obsidian is currently set to.
Needed for multilingual people, for writing (and checking) notes in other languages, for bug reports and instructional material, etc.
Actual result
moment.locale()
sticks to “en”, navigator.language
to “de”.
Environment
- Operating system: Linux Mint 20.1, Ubuntu 14.04.5 for retro-testing
- Obsidian version: 0.12.4, installer 0.12.4
Additional information
I did disable all plugins, but should any plugin author read this, please comment if you modify moment’s locale!
FWIW, I’m usually using (worked until 0.12.3):
- the default theme, light
- Core Plugins:
- File explorer
- Search
- Quick switcher
- Graph view
- Backlinks
- Outgoing links
- Tag pane
- Page preview
- Command palette
- Daily Notes
- Templates
- Outline
- Word count
- Slides
- Audio recorder
- Open in default app
- File recovery
- Community plugins:
- Advanced tables
- Better word count
- Copy button for code blocks
- Dangling links
- Dataview
- Extract highlights
- Find unlinked files and unresolved links
- Hotkeys for templates
- Hotkeys++
- (Icons)
- Obsidian Leaflet
- (Pandoc Plugin)
- (Pomodoro plugin)
- Show whitespace
- Shuffle
- Sliding panes (Andy’s Mode)
- Sortable
- Templater
- Text snippets
Those in (parentheses) are only enabled for testing—I don’t regularly use these.