Sunday incorrectly named when used in template filename for daily, in "nb" locale

Steps to reproduce

  1. Create a new vault (or use Sandbox vault, tried in both)
  2. Make sure language is set to Norwegian
  3. Either test this on Sunday, or find some other way to get a Sunday date
  4. Set Daily dateformat to “dddd”
  5. Create a new daily note

Did you follow the troubleshooting guide? Yes

I created a completely new, blank, vault, with Norwegian configuration, but no plugins and no content.

Expected result

The daily note name should be named “søndag”

Actual result

The daily note name is “sundag”

Environment

SYSTEM INFO:
Obsidian version: v1.5.3
Installer version: v1.5.3
Operating system: Windows 10 Pro 10.0.22631
Login status: logged in
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

The reason is that Obsidian is using the dialect Nynorsk, there should be an additional setting for Bokmål. Please add this.

The text translations in Obsidian is Bokmål, but moment has been configured for Nynorsk.

Greetings from a fellow Norwegian…

I’m wondering in which context are you using this? Is it the Daily Notes plugin? Or within Templater ? Or in dataviewjs scripts?

If it’s in templates used by Templater, you can circumvent this, I believe, by having a startup template with the following text:

<%* moment.locale('nb') %>

This will change the locale used by both the Daily Note plugin and the Templater plugin. If you’re using dataviewjs you can add moment.locale('nb') to the start of your script. I’m not sure how to change the locale used by plain queries in dataview (I’ve struggled with that related to some localised date handling in its source code ).

It’s not a fix, but it will help your vault to be as you expect it to be in bokmål.

What exactly do you mean by “startup template”? Do you mean I just edit the Daily Notes template I’ve made and put this in there, or is there some other place I should place it?

The Templater plugin has in its setting the possibility to name a startup template, which is loaded when Obsidian starts. By inserting this code in there you’d change the locale to be your wanted locale until either you change it again, or Obsidian quits.

I got around to testing it today, and it worked wonders. For me, this solves it.

1 Like