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?
Posts: 2
what fields?
Posts: 8601
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.
Posts: 3
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.
Posts: 8601
language definitions are in modules/core/classes/GalleryTranslator.class
let us know if you find a change that works.
Posts: 3
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.
Posts: 8601
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?
Posts: 1
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.