Rhodecode localization

Issue #117 resolved
Néstor Díaz Valencia created an issue


I managed to create an updated po file. Steps:

create an empty pylons app.

paster create --template=pylons dummy

copy dummy/setup.py to your rhodecode-egg directory

excute python setup.py make_messages -o yourlanguage.po

move yourlanguage.po to a new dir in i18n/yourlanguage/LC_MESSAGES/

Then use poedit to edit yourlanguage.po file. When saving poedit will create a compiled filed named yourlanguage.mo.

Go to production.ini and change language setting to yourlanguage.

Caveats: this method doesn't extract many strings in templates, I'm trying to fix this.

But, you can add manually with a text editor this strings (not with poedit).

The enhancement would be to distribute a full localizable strings template file rhodecode.pot.

Comments (8)

  1. Marcin Kuzminski repo owner

    H, the how_to in i18n have just one mistake that it points You to dir with .ini files that is true only for dev version(if You wold download 1.1.4 sources), if You installed using pip or easy_install You should just go to the place When You installed RhodeCode (probably You virtualenv site-packages) and then run python setup.py extract_messages that will create proper .pot file. and then python setup.py init_catalog -l <your_language>

  2. Néstor Díaz Valencia reporter

    Update about extracting localizable strings from templates:

    Pylons manual refers to this: http://pylonsbook.com/en/1.1/internationalization-and-localization.html

    Edit setup.py file. At line 23 you will see this:

        message_extractors={'rhodecode': [
                #('**.py', 'python', None),
                #('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
                ('templates/**.html', 'mako', None),
                #('public/**', 'ignore', None)

    But it doesn't work and creates a .pot file without any string.

  3. Néstor Díaz Valencia reporter

    I have two setups:

    • Ubuntu server 10.04 - rhodecode in virtualenviroment
    • Ubuntu 10.10 - rhodecode in system dist-packages

    I can't find this setup.py in none of the machines.

  4. Marcin Kuzminski repo owner

    Ok I'm sorry for the misunderstanding You need to download the 1.1.4 sources (just download the 1.1.4 tag) and than You have to make the translation using sources, and not installed package from easy_install or pip. There is no need to make new pylons project etc, all those steps are not needed.

  5. Log in to comment