Serbian Language problem

ladjo78

Joined: 2007-04-12
Posts: 2
Posted: Thu, 2007-04-12 17:11

I install gallery 2.2.1 and I have problem with Serbian language. When i try to change from English to Serbian language nothing happens, but when I try to change from English to any other language everything works great. Can somebody help me to solve this problem?

 
ladjo78

Joined: 2007-04-12
Posts: 2
Posted: Sat, 2007-06-23 15:31

what fields?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-07-10 15:33

http://gallery.menalto.com/localization/gallery2

Serbian shows as over 90% translated, so you should definitely see some translated text if it is working correctly. Make sure the needed locale is installed in your operating system. You can also turn on buffered debug mode in config.php and look for "Warning: unable to select locale" in the debug output to see if that is the problem.

 
tasatasa

Joined: 2007-08-13
Posts: 3
Posted: Mon, 2007-08-13 20:01

Hi,

I think i know the reason behind this bug. Because Ygoslavia is no more, the Serbian locale has changed from sr_YU to sr_CS (which i think is the Serbian Cyrilic). On my hosting server, there does not seem to be a locale for Serbian latin. Serves us right. Not only we changed a country name, but we use two scripts as well...

I have tried to brute-force search replace sr_YU with sr_CS but it does not seem to do much. All the language drop downs still use sr_YU as a value, and Serbian setting is still ignored. I have looked in the database, but could not find a right (obvious) language table. I have tried to change a setting to the user and changed a language field to sr_CS but nothing happened.

Hope this will help someone fixing this.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-08-14 00:14

language definitions are in modules/core/classes/GalleryTranslator.class
let us know if you find a change that works.

 
tasatasa

Joined: 2007-08-13
Posts: 3
Posted: Tue, 2007-08-14 14:39

Thanks mindless! that fixed it.

Now, if you would excuse my brute force approach here, but i am not a PHP developer.

The solution is (on *nix):

1) cd to your gallery directory

2) find . -exec sed -i 's/sr_YU/sr_CS/g' {} \;

3) edit modules/core/classes/GalleryTranslator.class, change line 198 and 199 from:

/* Serbian */
$supportedLanguages['sr']['YU']['description'] = 'Srpski';
$defaultCountry['sr'] = 'YU';

to

/* Serbian */
$supportedLanguages['sr']['CS']['description'] = 'Srpski';
$defaultCountry['sr'] = 'CS';

To my surprise (and relief), this made my gallery use latin, not cyrilic script.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-08-14 15:59

I've made the change to CS country code. I also added a fallback so it will try YU in case no locale is found with CS, perhaps to support older systems?

 
cabrilo

Joined: 2008-05-16
Posts: 1
Posted: Fri, 2008-05-16 17:34

Actually, ALL you need do is:

3) edit modules/core/classes/GalleryTranslator.class, change line 198 and 199 from:

/* Serbian */
$supportedLanguages['sr']['YU']['description'] = 'Srpski';
$defaultCountry['sr'] = 'YU';

to

/* Serbian */
$supportedLanguages['sr']['CS']['description'] = 'Srpski';
$defaultCountry['sr'] = 'CS';

It works fine for me now, I didn't change anything else.