Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localized names of week days -> disconnected with configuration #68

Closed
dariuszkowalski-com opened this issue Dec 8, 2020 · 7 comments
Closed
Labels

Comments

@dariuszkowalski-com
Copy link

@dariuszkowalski-com dariuszkowalski-com commented Dec 8, 2020

Before version 0.9.22 Plugins like Calendar or Natural Languages Dates use always
English version of days: Monday, Friday.

I have set the language of Obsidian to English. My Windows 10 has Polish Localisation.

Begining from Obsidian 0.9.22 I have got Polish names o week days (Poniedziałek, Piątek)

Now the Calendar plugin does not show me my previous notes (which have got an English name) and all new ones are created using Polish language localization.

For me, the language in Obsidian should be determined by the option set in the configuration.

@liamcain
Copy link
Owner

@liamcain liamcain commented Dec 8, 2020

Oh that's an interesting edge case. Currently the calendar plugin does the following: use the language specified in obsidian, then fall back to OS locale to disambiguate between language/locale pairs. Mainly en-US and en-GB. This is important because US starts the week on Sunday and GB starts on Monday.

I can update it to the following: if language is English, make sure language settings are always English.


Note: The calendar plugin is currently changing the global moment locale so this might be why it's affecting other plugins. Sorry about that~ was hoping it would only be beneficial.

Thanks for the quick report! Will try to have this fixed ASAP

@liamcain
Copy link
Owner

@liamcain liamcain commented Dec 8, 2020

I just released v1.4.4 which should fix this. The new logic will always prefer your obsidian language setting and only use the OS locale to differentiate between en-US and en-GB. This should fix the other plugins as well.

@dariuszkowalski-com let me know if you're still having issues after updating! (you might need to restart obsidian for the change to take complete effect)

@Quorafind
Copy link

@Quorafind Quorafind commented Dec 9, 2020

@liamcain I used the plugin with CN locale, it only output every monday. But it worked well after I changed ob default lanuage from CN to en-US.

@liamcain
Copy link
Owner

@liamcain liamcain commented Dec 9, 2020

it only output every monday

@Quorafind, hi, could you provide a bit more detail about this? Not sure quite sure what you mean.

But it worked well after I changed ob default lanuage from CN to en-US.

I see, so it sounds like you have the day-of-the-week included in your note name and existing notes have that in English and now the calendar isn't finding them anymore. Okay, that's an issue.

I'm curious, from your perspective, would you prefer if the days of the week in the filename were showing in English or in Chinese? If it were easy to migrate the existing notes to Chinese, would you want that? I want to figure out the best path forward.

My current thinking so far (and I could be wrong):

  • The calendar UI should always match the language configured in Obsidian
  • I might need to introduce a separate configuration for users to select the localization used by the templates
    • this way, you could keep Obsidian set to Chinese and have the templates insert the English days of the week to keep compatibility.

Want to get as much input as I can on this!

@Quorafind
Copy link

@Quorafind Quorafind commented Dec 9, 2020

@liamcain Hmmm, sorry, I didn’t make it clear just now. I have adopted new features({{sunday:YYYYMMDD}}) in my weekly note template.
Then I want to get my whole week's every day note by using:

![[{{sunday:YYYYMMDD}} DailyNote]]
![[{{monday:YYYYMMDD}} DailyNote]]
![[{{tuesday:YYYYMMDD}} DailyNote]]
![[{{wednesday:YYYYMMDD}} DailyNote]]
![[{{thursday:YYYYMMDD}} DailyNote]]
![[{{friday:YYYYMMDD}} DailyNote]]
![[{{saturday:YYYYMMDD}} DailyNote]]

Its output (Ob's default language is Simplified-Chinese) after weekly note generated:

![[20201205 DailyNote]]
![[20201128 DailyNote]]
![[20201121 DailyNote]]
![[20201114 DailyNote]]
![[20201107 DailyNote]]
![[20201031 DailyNote]]
![[20201024 DailyNote]]

I also try it with another non-EN language as default language. It seems the same problem. But it worked well when I use EN as default lanuage.
Then I also tried it in my new vault with any notes in it, things didn't change.

@Quorafind
Copy link

@Quorafind Quorafind commented Dec 9, 2020

@Quorafind So it seems like something happened when weekly note generates

@dariuszkowalski-com
Copy link
Author

@dariuszkowalski-com dariuszkowalski-com commented Dec 9, 2020

Thx. in the new version its working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants