[NUUG fiksgatami] Fixmystreet translation for nb_NO.UTF-8

Matthew Somerville matthew at mysociety.org
Thu Jan 15 13:08:33 CET 2009


Petter Reinholdtsen wrote:
> What is required to get it to take effect?  I tried copying it to
> locale/nb_NO.UTF-8/LC_MESSAGES/FixMyStreet.po, but the front page did
> not show any Norwegian texts, even if my browser ask for it.

No, afraid it's slightly more complicated than that.

> Any idea how to get the translated texts to show up?

http://matthew.fixmystreet.com/ :-)

Steps to get that working:

1. Your server needs to be aware of the nb_NO locale. On our Debian, 
that involves editing /etc/locale.gen and running locale-gen.

2. Your .po file had a few errors in it, please check out the version 
I've committed to CVS which fixes them.

3. Apache looks for .mo files, which are compiled versions of .po files. 
Once you have the .po file checked out, run bin/gettext-makemo which 
generates the .mo files.

4. The FixMyStreet code wasn't actually looking for any other languages 
besides English. I have added a couple of lines to Page.pm to negotiate 
the language using your browser settings - will Norwegians have "nb" set 
as a language, or just "no"? Currently it will only work if you 
specifically have "nb". I'm afraid I'm not aware of your local language 
issues!

Then I had what you can see at my staging site. Hope that's helpful.

ATB,
Matthew


More information about the fiksgatami mailing list