TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.56k stars 589 forks source link

zh_Hans Simplified Chinese language support #3270

Closed ttimasdf closed 2 months ago

ttimasdf commented 2 months ago

Is your feature request related to a problem? Please describe.

zh_Hans language is currently in a half-way-done state. I would love this application with Chinese interface, though the search and index may still need improvement for the language, but the translated UI could be a start 😄

Describe the solution you'd like

I went through most of the untranslated strings and revamped some of the strings that are too machine translated.

The current state on weblate: Tandoor - Chinese (Simplified) @ Tandoor Translate

Describe alternatives you've considered

No response

Additional context

related issue: #2627

smilerz commented 2 months ago

Any translations you add will automatically be included in the next release.

vabene1111 commented 2 months ago

actually the language currently does not show up I am afraid. The problem is that django needs zh-Hans as a langauge code while the file by weblate is named zh_Hans. I already implemented langauges for the new frontend which will just scan trough the files and use these. This is probably fixable for the old version as well but I dont want to spend time on the old version so I will leave it to the new one, just another motivation to get done with it sooner :)

Thanks for helping with translations btw, appreciate it :)

ttimasdf commented 2 months ago

In addition to the translated strings that the Weblate bot will commit, I believe some other adjustments are necessary for it to work. (I may be mistaken, but the current code base just doesn't work for me...)

On the backend, 'zh-hans' could be included in settings.py to provide the option in the system settings. However, on the frontend, specifically the Vue side, the language setting does not take effect.

https://github.com/TandoorRecipes/recipes/blob/beb1823a5704003cdbce26219e06188c371976bf/recipes/settings.py#L477-L495

ttimasdf commented 2 months ago

actually the language currently does not show up I am afraid

just saw the comment above, and this's also the problem I see when I try to hack my translation in to our existed docker image. and currently we also use zh_CN for Chinese which is also unsupported by django (\cookbook\locale\zh_CN\LC_MESSAGES\django.po)

ttimasdf commented 2 months ago

I already implemented langauges for the new frontend which will just scan trough the files and use these.

and there's a nuance between zh-Hans and zh_Hans prevents it from loading even though it found the file. which I think is already fixed like you've mentioned?

image

vabene1111 commented 2 months ago

yes. the new vue 3 frontend just scans the translation files that are in the locale directory of the frontend and allows the user to choose any of those files, thus eliminating the need to put the languages into the locale settings. But as this is a bit of work I dont want to backport it to the current (vue 2) branch, so for now you will sadly have to live with the other locales.