Adding new language to loginnlist

Questions about interface translations go here
christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Adding new language to loginnlist

Postby christian » 26 Dec 2007, 15:06

How do I add a new language to the loginnlist, so that I can test my translation?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 26 Dec 2007, 16:02

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 ./update-translations.sh)

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

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 27 Dec 2007, 02:19

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: http://www.tony-franks.co.uk/UTF-8.htm
The french one also seems to render wrongly

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 27 Dec 2007, 09:33

What do you mean - broken? The file is in utf-8:

Image

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 27 Dec 2007, 14:34

But it looks ugly on the menu: http://feeds.vindstille.net

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 27 Dec 2007, 15:36

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 http://online.tt-rss.org and see for yourself.

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 27 Dec 2007, 17:52

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

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 27 Dec 2007, 18:09

I normally use nano to edit files, any solution for it not to break the encoding?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 27 Dec 2007, 19:00

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.

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 27 Dec 2007, 23:42

Got the explanation, my server uses ISO-8859-1

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 28 Dec 2007, 17:47

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 http://feeds.vindstille.net and drupal at http://vindstille.net) and there the translation is working.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 28 Dec 2007, 20:26

Check ENABLE_TRANSLATIONS option in config.php.

christian
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 25 Dec 2007, 16:06
Contact:

Postby christian » 28 Dec 2007, 21:53

How stupid of me.
Thanks


Return to “Translations”

Who is online

Users browsing this forum: No registered users and 1 guest