tendenci / tendenci

Tendenci - The Open Source Association Management System (AMS)
https://www.tendenci.com
Other
493 stars 202 forks source link

Translacation for custom template #1102

Open yyss8 opened 2 years ago

yyss8 commented 2 years ago

Hi, thanks for the great system

I'm wondering if there is anyway to add multilanguage support in the custom template overrides? Am I suppose to see a .po or .mo file in my local codebase like these?

image

yyss8 commented 2 years ago

I actually don't see a locale folder anywhere installed on my server

nvm, found them.

I noticed that not everything on the site is being translated even I see them in the .po file

For example,

image

image

jennyq commented 2 years ago

Hi @yyss8,

Thanks for raising the issue. We'll look into it.

As for the custom templates pulled down to your site, you can create a locale directory in your theme's directory, then run the commands to generate a .po file:

django-admin makemessages --locale=zh_CN

After you're done updating the .po file, you can then compile it with the command:

django-admin compilemessages
cnliuxud commented 2 years ago

I have met the same issue, can someone share the procedure on how to configure to chinese or other languanges?

jennyq commented 2 years ago

Steps to configure a language for your site: 1) Set the LANGUAGE_CODE setting in your conf/settings.py:

LANGUAGE_CODE = 'zh-CN'
USE_I18N = True

2) Change the site setting "Localization Language" to the language you selected. https://www.example.com/settings/site/global/#id_localizationlanguage

For the existing users, the default language is English. You can change their language by editing their profiles. Logged in users can also change their language by clicking their name on the top left menu bar, then clicking "Change" next to the Language.

cnliuxud commented 1 year ago

Thanks,here setting LANGUAGE_CODE = 'zh-CN,but in the global setting Localization Language is 'zh-hans', some pages can not be translated to chinese simple,is this thre root cause ? How to fix it?

cnliuxud commented 1 year ago

Hi Jenny, the issue (some pages can not be translated to chinese simple)is still here, could you give a guide on how to fix it?

jennyq commented 1 year ago

Which pages can not be translated? Note that, the dynamic content, such as page title, content.., are not translated by the software. It is up to the content authors to enter the content they want.

Also note that the translation to zh-CN hasn't been fully completed yet. You're welcome to join us on Transifex https://app.transifex.com/tendenci/tendenci/.