[Mapbender-dev] it works: Define a language by 2 or 4 letters

Astrid Emde astrid.emde at wheregroup.com
Mon Dec 21 08:18:43 EST 2009


Hello devs,

last IRC meeting we discussed about i18n and locales like fr_BE. I 
suggested to change the definition for a locale from 2 to 4 letters.

I tried it for fr_BE already. There are only a few rows to add to 
class_locale to support fr_BE.

In mapbender.conf I changed language to:
define("LANGUAGE", "fr_BE");

In class_locale.php I added:
        function setSystemLocales() {
 ...
            $this->systemLocales['fr_BE'] = array(
                'linux' => 'fr_BE.utf8',
                'windows' => 'French_Belgium.1252',
                'bsd' => 'fr_BE',
                'posix' => 'fr_BE'
            );
...

and also:
       function setKnownLanguages() {
                $this->knownLanguages = array(
                                     ...
                                     'fr_BE' => 'fr_BE',   
                                     ....

This is all you have to do to add a new language. It does not  metter 
whether you define the language by 2 or 4 letters in mapbender.conf.

So we do not have to change anything in the Mapbender concept.


Have a look at ticket:
http://trac.osgeo.org/mapbender/ticket/549


Best regards

Astrid



More information about the Mapbender_dev mailing list