Re: Translation is not working for Template even though po and mo files are created

2015-11-02 Thread Andreas Kuhne
Hi, I am unsure about the project level translations path, if they should be found as well. I have added them manually to settings, but only that path. Application paths get imported automatically. Regards, Andréas 2015-11-02 6:38 GMT+01:00 Sean Xu : > Sorry, > >

Re: Translation is not working for Template even though po and mo files are created

2015-11-01 Thread Sean Xu
Sorry, ~/django-swingtime/django-swingtime-master/demo should be the project path where project level translation files were generated under ~/django-swingtime/django-swingtime-master/demo/locale. The project level locale files should also be recognized, right? The application path should be

Re: Translation is not working for Template even though po and mo files are created

2015-11-01 Thread Andreas Kuhne
Hi Sean, That's interesting. You shouldn't have to add the locale paths explicitly. Good that it's wokring, but as long as you put the locale files in a directory named locale under each app and also under the project, it should just work (as long as all apps are included in the config). Just

Re: Translation is not working for Template even though po and mo files are created

2015-10-31 Thread Sean Xu
The translation for my template finally gets to work after I explicitly have LOCALE_PATHS configured in settings.py! Thanks very much for providing the hint :) Actually the models and template come from different applications: ~/django-swingtime/django-swingtime-master/swingtime # Models

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Andreas Kuhne
Hmmm I'm a bit at a loss here. But does Django know where to find the .mo files? Is it only your template that isn't getting translated, because you said that the form itself is? Regards, Andréas 2015-10-30 12:45 GMT+01:00 Sean Xu : > Now I have corrected the orders

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
Now I have corrected the orders of each Middleware class and removed the duplicated SessionMiddleware: MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware',

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
Hi Andréas, Thanks very much for providing the help. Currently the middleware classes are configured like this: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Andreas Kuhne
Hi, Have you made sure that you have activated the languages you want in your application? Also, how is the current language being selected? See: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#how-django-discovers-language-preference Regards, Andréas 2015-10-30 7:45 GMT+01:00

Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Sean Xu
Hi, I'm learning Django Translation using django-swingtime with Django 1.7.9 installed. I followed the official docs and embedded my string to translate with {% trans "String to translate" %} in my Template and managed to create both the po and mo files successfully. But, the page is still