Page 1 of 1

Adding new language to loginnlist

Posted: 26 Dec 2007, 15:06
by christian
How do I add a new language to the loginnlist, so that I can test my translation?

Posted: 26 Dec 2007, 16:02
by fox
1. Add your language to get_translations() (functions.php line 12 and below).

2. Create directory locale/(your locale)/LC_MESSAGES and copy messages.po there

3. Update .po if needed and compile .po to .mo (run ./

If you are just starting, creates messages.pot which you can use as a starting point.

Posted: 27 Dec 2007, 02:19
by christian

Code: Select all

        function get_translations() {
                $tr = array(
                                        "auto"  => "Detect automatically",
                                        "en_US" => "English",
                                        "nb_NO" => "Norsk Bokmål",
                                        "fr_FR" => "Français",
                                        "ru_RU" => "Р�^��^��^�кий",
                                        "pt_BR" => "Portuguese/Brazil",
                                        "zh_CN" => "Simplified Chinese");

Shouldnt the different languages be spelled using correct letters?
From the UTF-8 Char-table:
The french one also seems to render wrongly

Posted: 27 Dec 2007, 09:33
by fox
What do you mean - broken? The file is in utf-8:


Posted: 27 Dec 2007, 14:34
by christian
But it looks ugly on the menu:

Posted: 27 Dec 2007, 15:36
by fox
The fact that you have edited the file with some broken editor that doesn't support UTF-8 and screwed up the encoding doesn't mean that the file in question was originally broken.

Try it on and see for yourself.

Posted: 27 Dec 2007, 17:52
by christian
It was like that before I touched the files...

Posted: 27 Dec 2007, 18:09
by christian
I normally use nano to edit files, any solution for it not to break the encoding?

Posted: 27 Dec 2007, 19:00
by fox
No idea about nano, I'm mostly using vim.

I have the following in my ~/.vimrc so it defaults to utf-8:

Code: Select all

set fileencodings=utf-8,koi8-r

It was like that before I touched the files...

That is weird. Maybe something on your server is mucking up the output PHP generates? Things like that always just worked for me, so I can't help you here. It should work.

Posted: 27 Dec 2007, 23:42
by christian
Got the explanation, my server uses ISO-8859-1

Posted: 28 Dec 2007, 17:47
by christian
Is there anything that needs to be enable on the server or in the script for the language to change?
I tested it now, the server has gettext, but even if I try other languages as russian or brazilian it just seems to display the english language.

I have a drupalinstallation on the same server (TTRSS is at and drupal at and there the translation is working.

Posted: 28 Dec 2007, 20:26
by fox
Check ENABLE_TRANSLATIONS option in config.php.

Posted: 28 Dec 2007, 21:53
by christian
How stupid of me.