• GitHub
  • Documentation
  • Discord
  • Tip
search
  • chevron_right Threads
  • label Feedback
  • label Bugs Bug reports

language change: when change LANGUAGE_CODE to 'zh_Hans' IO Error occurred

shelltrain
July 20, 2017
chat_bubble_outline 14
  • link
    shelltrain
    Members 34 posts
    July 20, 2017, 10:15 p.m. July 20, 2017, 10:15 p.m.
    link

    Hi,

    Is anyone having the same problem:
    When I change LANGUAGE_CODE to 'zh_Hans' in settings, and was trying to run server. An IO Error occurred.
    IOError: No translation files found for default language zh_Hans.

    Thanks!

  • arrow_forward

    Thread has been moved from Development Discussion.

    • By rafalp on July 20, 2017, 10:24 p.m..
  • link
    rafalp
    Project Lead 2027 posts
    July 20, 2017, 10:27 p.m. July 20, 2017, 10:27 p.m.
    link

    This is support question, not development discussion. Please be more careful when starting threads.

  • link
    shelltrain
    Members 34 posts
    July 20, 2017, 10:30 p.m. July 20, 2017, 10:30 p.m.
    link
    @rafalp

    This is support question, not development discussion. Please be more careful when starting threads.

    Sorry

  • link
    shelltrain
    Members 34 posts
    July 20, 2017, 11:36 p.m. July 20, 2017, 11:36 p.m.
    link

    Solved by myself.
    Should be 'zh-hans' instead of 'zh-Hans'.
    @rafalp Excellent work. May need a small change in Misago 0.8.0 release post.

    dofine likes this.

    favorite 1

  • arrow_forward

    Thread has been moved from Questions, Problems and Issues.

    • By rafalp on July 21, 2017, 10:31 a.m..
  • link
    rafalp
    Project Lead 2027 posts
    July 21, 2017, 10:31 a.m. July 21, 2017, 10:31 a.m.
    link

    Nice catch, I've updated release announcement.

    Thanks!

  • link
    dollar
    Members 6 posts
    Aug. 9, 2017, 11:17 a.m. Aug. 9, 2017, 11:17 a.m.
    link

    Thanks a lot for replying me.

    I think this is not the answer of my problem.
    my issue is here, misago-project.org/t/after-setting-the-language-to-chinese-i-meet-a-problem-i-can-not-solve-plz-help-me-with-that/439/

    Before I start the thread, I changed the settings.py with both LANGUAGE_CODE = 'zh-hans' and LANGUAGE_CODE = 'zh-Hans', the problem remains the same.
    My problem is when I open the site some text show as Chinese firstly, after about 500ms, it shows English again. for example, the texts All My New Unread Subscribed Unapproved.
    With the debug tool of Chrome, I think maybe some js script rewrite the text to English. What can I do about it?

  • link
    dofine
    Members 8 posts
    Aug. 9, 2017, 5:12 p.m. Aug. 9, 2017, 5:12 p.m.
    link

    Manually renamed zh_Hans to zh_hans in /site-packages/misago/locale. Solved.
    Same problem here. Even when I set zh_hans, I get OSError No translation files found for zh_hans.

  • link
    rafalp
    Project Lead 2027 posts
    Aug. 9, 2017, 5:43 p.m. Aug. 9, 2017, 5:43 p.m.
    link

    Yeah, thats bug then. How other django packages handle it? Is that lang named zh_hans in them too?

  • link
    dollar
    Members 6 posts
    Aug. 10, 2017, 3:07 a.m. Aug. 10, 2017, 3:07 a.m.
    link
    @rafalp

    Yeah, thats bug then. How other django packages handle it? Is that lang named zh_hans in them too?

    Thanks for your reply, but above did not solve my problem.
    My problem is when I open my site, some texts of my page show as Chinese, then then changed to English after about 500~1000ms.
    Here is the setting I have changed.

    LANGUAGE_CODE = 'zh-Hans'
    USE_I18N = True
    USE_L10N = True
    
  • link
    dollar
    Members 6 posts
    Aug. 10, 2017, 3:11 a.m. Aug. 10, 2017, 3:11 a.m.
    link
    @dofine

    Manually renamed zh_Hans to zh_hans in /site-packages/misago/locale. Solved.
    Same problem here. Even when I set zh_hans, I get OSError No translation files found for zh_hans.

    Did not solve my problem. I have only changed the setting about language to bellow:

    LANGUAGE_CODE = 'zh-Hans'
    

    whether I change /site-package/misago/locale/zh_Hans to zh_hans, the problem remains same.

  • link
    rafalp
    Project Lead 2027 posts
    Aug. 10, 2017, 10:17 p.m. Aug. 10, 2017, 10:17 p.m.
    link

    Allright, I've checked this and I'm bummed out.

    Manually renamed zh_Hans to zh_hans in /site-packages/misago/locale. Solved

    zh_Hans is how it should be named according to Django's 1.11 source code and it works for me:

    github.com/django/django/tree/stable/1.11.x/django/contrib/admin/locale/zh_Hans

    LANGUAGE_CODE = 'zh-Hans'

    This works for me on localhost. Entire forum is in Chinese now.

    I'm running MacOs Sierra. What OS are you guys running? What Django versions? Is this python manage.py runserver or proper setup with wsgi container?

  • link
    dofine
    Members 8 posts
    Aug. 11, 2017, 5:41 a.m. Aug. 11, 2017, 5:41 a.m.
    link
    @rafalp

    Allright, I've checked this and I'm bummed out.

    Manually renamed zh_Hans to zh_hans in /site-packages/misago/locale. Solved

    zh_Hans is how it should be named according to Django's 1.11 source code and it works for me:

    github.com/django/django/tree/stable/1.11.x/django/contrib/admin/locale/zh_Hans

    LANGUAGE_CODE = 'zh-Hans'

    This works for me on localhost. Entire forum is in Chinese now.

    I'm running MacOs Sierra. What OS are you guys running? What Django versions? Is this python manage.py runserver or proper setup with wsgi container?

    Hi, here is my setup.

    • Debian 9 x64, Linux kernel 4.12.3
    • Python 3.5.3, django version 1.11.4, misago fresh installed from pip, version 0.9.0
    • Server nginx and gunicorn.

    And here are weird things.
    LANGUAGE_CODE = 'zh-Hans', site-packages/misago/locale/zh_Hans: OS Error, no translation files found for zh_Hans.
    LANGUAGE_CODE = 'zh-Hans', site-packages/misago/locale/zh_hans: Good.
    LANGUAGE_CODE = 'zh-hans', site-packages/misago/locale/zh_hans: Good, too.
    Maybe django version problem in Debian?
    However the right two setups also have a small bug at users/active-posters/:

    snipaste_20170811_114005.png

    snipaste_20170811_114005.png

    PNG, 16.4 KB, uploaded by dofine on Aug. 11, 2017.

  • link
    rafalp
    Project Lead 2027 posts
    Aug. 12, 2017, 7:25 p.m. Aug. 12, 2017, 7:25 p.m.
    link

    LANGUAGE_CODE = 'zh-Hans', site-packages/misago/locale/zh_Hans: OS Error, no translation files found for zh_Hans.

    This forum, LANGUAGE_CODE = 'zh-Hans', running latest Debian:

    Zrzut ekranu 2017-08-12 o 19.17.36.png

    This forum, LANGUAGE_CODE = 'zh-hans':

    Zrzut ekranu 2017-08-12 o 19.18.24.png

    Zero errors as you guys can see.

    But, hey @dollar, I've found out that Misago's JS language is aggressively cached by the browsers and I've had to clear cache for browser to download english language translations after it got fixated on chinese lang, so I'm guessing I'll add cachebuster to i18n links. ;)

    I've been planning to release 0.10 when some features are implemented, but it's delayed long enough, so I'll ship what I've got so far as 0.10 later today.

    Zrzut ekranu 2017-08-12 o 19.18.24.png

    PNG, 610.7 KB, uploaded by rafalp on Aug. 12, 2017.

    Zrzut ekranu 2017-08-12 o 19.17.36.png

    PNG, 601.7 KB, uploaded by rafalp on Aug. 12, 2017.

  • link
    WayneChen
    Members 3 posts
    Aug. 15, 2017, 10:34 a.m. Aug. 15, 2017, 10:34 a.m.
    link

    This post is hidden. You cannot see its contents.

    Hidden by rafalp on Aug. 15, 2017, 4:37 p.m..

  • link
    rafalp
    Project Lead 2027 posts
    Aug. 15, 2017, 4:38 p.m. Aug. 15, 2017, 4:38 p.m.
    link

    @WayneChen I've made your post in this thread invisible per forum rules:

    This is English speaking forum. Posts in languages other than English will be removed.

    If you wish to participate in discussion, please post messages that are understandable to all members of this community.

    Thanks!

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Tip
  • Terms of service
  • Privacy policy
powered by misago