0

I currently have a small problem using saleor:

First, I set the following configuration in saleor/settings.py:

# other settings config
LANGUAGE_CODE = 'pt_BR'
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
LOCALE_PATHS = ( 
    os.path.join(PROJECT_ROOT, "locale"),
)
USE_I18N = True
USE_L10N = True
USE_TZ = True

Then I created the directory tree /locale/pt_BR/LC_MESSAGES at the project's root.

After that, I opened up rosetta and started translating everything to my language code (pt_BR). Everything worked as expected, but I can't see the changes I made on the website.

I already tried:

  • restarting the server (python manage.py runserver)
  • manually running python manage.py compilemessages with no errors on my edited .po file.

It generates the .po and .mo files inside the expected folder, but nothing seems to change (everything is still in english)

Additional info: Django version 1.9.3 Python version 2.7

Does anybody have the same problem? Thank you

----- Edit -----

This is my final (with the problem solved) .po file:

http://pastebin.com/EwrMYYyA

Seanny123
  • 8,776
  • 13
  • 68
  • 124
lucaschain
  • 33
  • 6

1 Answers1

1

My problem was:

My django.po file was not filled with the correct language code:

"Language: \n"

so I changed to

"Language: pt_BR\n"

after re-compiling messages (python manage.py compilemessages) everything worked nicely.

Also, I found out the LOCALE_PATHS setting needed a slash after the path like this:

LOCALE_PATHS = ( 
    os.path.join(PROJECT_ROOT, "locale/"),
)
lucaschain
  • 33
  • 6
  • could you please paste somewhere your translation? I'm working on an italian one but getting errors with forms plurals. – bre Jul 06 '16 at 22:52
  • Sure, I just added a pastebin URL with my .po file inside the question body, you can take a look at it. – lucaschain Jul 08 '16 at 21:47