-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
The new Chinese translation of 7.15.0 is not effective. #3322
Comments
我也是,翻译无效,是什么问题??? Translation posted by @claremacrae
|
Thank you for logging this here, @dangehub. How it is supposed to workThe code that is supposed to detect the user's language is line 12 here: obsidian-tasks/src/i18n/i18n.ts Lines 11 to 24 in b0cd9c1
What might be going wrongSo I think possible causes might be:
Yes, looking at i18next-browser-languagedetector it does seem that detection is not automatic... |
According to https://www.moritzjung.dev/obsidian-stats/, the other two Obsidian plugins that use i18next-browser-languagedetector are:
With those licenses being compatible with Tasks, I can look at the code of both of them, to see how they work... |
I believe the problem is coming from the place you mentioned. I added console code to observe the detected language code
I have made some attempts, but still failed, I hope you can solve this problem. By the way, I kindly ask for a bit of time before you release the fix update. I've just noticed that there are still many areas in the Chinese translation that need improvement. I will strive to push out a better version within one to two hours. |
Thank you. There is a separate question about whether Tasks should honour the language in Obsidian's I think Tasks should honour the Obsidian settings, but that it should be changed in a separate step from this issue which is about fixing the automatic language detection. |
I am busy for several hours anyway - I do have other things to do than working on Tasks! 😄 |
I have found the solution, and I will submit the fix for this issue along with the improvement of the Chinese translation. In short, it's an issue with the language codes. Additionally, there's another problem: if you use For specific details, please check the PR when I submit it soon. |
Goal for this IssueThe definition of success for this issue is that if the user's computer is set to Chinese, then the Tasks plugin should auto-detect the language and show the settings in Chinese. Possible fix@dangehub, if I understand correctly, the following edit does recognise the language is Chinese, so perhaps I should just go ahead and make that change? What do you think?
|
Great!
I hadn't seen that message when I wrote the reply above. Yes you are right that the above will require more extensive changes, as the whole Tasks plugin code was not written to reload when things like settings change, so it definitely wouldn't refresh when the language changes... Feel free to log a separate request that Tasks should honour the Obsidian language setting at start-up and override the |
fix: detect Chinese language and refine the translation Fixes #3322
This is now released in Tasks 7.15.1. Many thanks @dangehub! 目前已在 Tasks 7.15.1 中发布。 非常感谢@dangehub! |
Steps to reproduce
tasks
Expected Behavior
If the user's Obsidian language setting is set to Chinese, the
tasks
should also be displayed in Chinese.Current behaviour
tasks
is still in EnglishWhich Operating Systems are you using?
Obsidian Version
1.8.4
Tasks Plugin Version
7.15.0
Checks
Possible solution
I tried cloning the latest repository and building it myself, but locally built plugin has the same issue.
If I modify this line of code and rebuild plugin ,
tasks
will become in Chinese and cannot be switched back to English.original code:
modified code:
This is also very strange, because we did not explicitly specify the language used in the code, and the fallback language is set to English.
I tried to modify the language settings of Obsidian and system, but there was no change at all.
The text was updated successfully, but these errors were encountered: