mbi / django-rosetta

Rosetta is a Django application that eases the translation process of your Django projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to discover "zh_Hans" directory on Ubuntu server

dohsimpson opened this issue · comments

commented

To be clear, this failure only occurs with a specific setup(haven't test other setups yet). It works fine on my OSX 10.9 laptop:
When running on my Ubuntu 14.04 server hosted on Digital Ocean. It runs in a Python3.4 virtualenv, with Django 1.8.1 and django-rosetta 0.7.6 installed with pip.

In my django settings, I have LANGUAGES variable set to include zh-hans. I created locale folder with python manage.py makemessages -l zh_Hans(for some reason, Django won't discover zh_hans and zh_HANS folder in this setup). The translation works on the website. But the zh_Hans translation directory does not appear on example.com/rosetta/. Being able to discover language such as zh_Hans is necessary as it is the default way(see http://stackoverflow.com/a/29774856).

@mbi I created a new PR based on @dohsimpson 's previous PR. Test cases have been added, and they all pass. Since Django 1.9 , zh_Hans is the only valid locale code for Simplified Chinese, and I believe this bug troubles many users.

Merged, thanks to both of you.