I am using Django Rest Framework and its Internationalization function. I can now get a auto translated response on default errors response by adding "Accept-Language" on header. I tried "zh-hans" is working but "zh-hant" not working. I also tried "ja-JP" , "de" its working. Is there a list for me to check the language code? I found a name list from here https://explore.transifex.com/django-rest-framework-1/django-rest-framework/ it said its support Chinese Traditional and Chinese (Taiwan). I tried zh-tw not working too.
Asked
Active
Viewed 149 times
1 Answers
0
I have the same issue. I found simple-jwt don't have zh_hant within his ...\Lib\site-packages\rest_framework_simplejwt\locale directory. (the zh_hans is existed here)
Create a zh_Hant directory within ...\locale diretory, copy files with subdirectory of zh_Hans into zh_Hant, convert ...\zh_Hant\LC_MESSAGES\django.po content to be Chinese Traditional, and then compile it to be django.mo file, it is workable for me.
-
Create a zh_Hant directory within ...\locale diretory, copy files with subdirectory of zh_Hans into zh_Hant, convert ...\zh_Hant\LC_MESSAGES\django.po content to be Chinese Traditional, and then compile it to be django.mo file, it is workable for me. – Jinn Lin Nov 09 '22 at 16:01
-
If you have a new question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/33142927) – Lucas Grugru Nov 15 '22 at 13:08
-
Do you how how to convert a django.mo file back to django.po I found the django.mo file in rest-framework/locale, but it not providing any django.po. I try to open the mo but mostly is corrupted. – Wong Yat Cheong Jacky Dec 30 '22 at 04:13