-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Flask-Babel does not translate zh_TW and zh_CN #4413
Comments
The problem is caused by the Pylons uses Python's A similar situation happened on |
@u10313335 Please check #4402. I think its fixing this issue |
Sorry, i didnt read your comment, just went through the issue description :/ |
flask-babel needs to allow passing through args to babel.parse, specifically |
@TkTech thanks. But I got the |
@TkTech any pointers on how to progress with this? |
I didn't change resolve_likely_subtags=False |
@ltf9651 You should set the And, renaming dirs resolve this issue but it will break backwards compatibility in CKAN if people bookmark urls with old /zh_TW or /zh_CN path. Please refer to my previous comment here: #4413 (comment) |
@u10313335 |
@ltf9651 I know that renaming dirs will resolve this issue. But it will break the links with /zh_TW or /zh_CN in the older versions of CKAN. |
It does work properly, thanks |
Thanks. It is working. |
The links remain zh_CN or zh_TW when using the workaround above provided by @u10313335. |
When switch the language to zh_CN, an error occurs with the details page of an organization: [Note: This is the only problem After renaming the the locale folder 'zh_CN' to 'zh_Hans_CN' and Update the locale name from 'zh_CN' to 'zh_Hans_CN' in the config file ckan.ini but not changing any other things. That is to say, everything is okay but displaying the details page of an organization in this locale and the page can be normally displayed in the other locales. The page shows "Error [500] - CKAN" on the page tile bar and "Internal server error " in the section of the oganization details. The details page of an organization is okay when switch the language to other language such as ja or zh_TW. The error is still there even after the database has been cleared and initialized. |
Did you encounter the internal server error about showing the details page of an organization? |
Is there any solution or workaround for this issue? Thanks. |
|
Workaround to be fully evaluated: |
The formal solution seems within the snippet feeds.html |
eg http://localhost:5000/zh_CN/dataset -> http://localhost:5000/zh_Hant_TW/dataset
Which doesn't support the new Babel syntax
@u10313335 @linforestzhang @TkTech could you please check #6008? I think that is a good compromise between doing things as Babel expects them and supporting old URLs. |
LGTM, thanks @amercader! |
To the format expected by Babel
eg http://localhost:5000/zh_CN/dataset -> http://localhost:5000/zh_Hant_TW/dataset
Which doesn't support the new Babel syntax
eg http://localhost:5000/zh_CN/dataset -> http://localhost:5000/zh_Hant_TW/dataset
Which doesn't support the new Babel syntax
eg http://localhost:5000/zh_CN/dataset -> http://localhost:5000/zh_Hant_TW/dataset
Which doesn't support the new Babel syntax
To the format expected by Babel
CKAN Version if known (or site URL)
≧ 2.8.0
Please describe the expected behaviour
When switching to
zh_TW
orzh_CN
languages on the pages written in Flask (ex./
and/user
), the pages should be shown in corresponding languages.Please describe the actual behaviour
It shows English instead of
zh_TW
orzh_CN
.What steps can be taken to reproduce the issue?
Switch language to Chinese on the above-mentioned pages.
The text was updated successfully, but these errors were encountered: