I wanted to change the language text shown on the Webchess webpages to Dutch. Unfortunately of the used versions none did work for me in achieving this. I've made some changes after which the language translation in the interface now is working in my installation. For everybody else interested in achieving this, I've documented the steps I've done.
Steps done:
1 changed lang.php to pick up the language translation files (see code below)
2 under webchess_root created the directories /locale/nl_NL/LC_MESSAGES
3 created Dutch translations from English file by using poedit (http://www.poedit.org/)
The en.po was retrieved from https://sourceforge.net/p/webchess/patches/_discuss/thread/c756e65b/dd1e/attachment/en.po
4 copied translation files (named webchess.po and webchess.mo) in the dir from step 2
After these changes the text translations in Webchess webpages are Dutch as desired by me.
###### changed code (php part only) in lang.php
$GETTEXT_SUPPORT = true;
if ( ! function_exists('gettext')) {
function gettext($text) {
return $text;
}
}
// Must do some testing before releasing it to mainstream
if($GETTEXT_SUPPORT) {
// Set language to Dutch
putenv('LC_ALL=nl_NL');
setlocale(LC_ALL, 'nl_NL');
// Set the text domain as 'webchess'bindtextdomain("webchess","./locale");// Choose domaintextdomain("webchess");// Translation is looking for in ./locale/nl_NL/LC_MESSAGES/webchess.mo now
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wanted to change the language text shown on the Webchess webpages to Dutch. Unfortunately of the used versions none did work for me in achieving this. I've made some changes after which the language translation in the interface now is working in my installation. For everybody else interested in achieving this, I've documented the steps I've done.
Steps done:
1 changed lang.php to pick up the language translation files (see code below)
2 under webchess_root created the directories /locale/nl_NL/LC_MESSAGES
3 created Dutch translations from English file by using poedit (http://www.poedit.org/)
The en.po was retrieved from
https://sourceforge.net/p/webchess/patches/_discuss/thread/c756e65b/dd1e/attachment/en.po
4 copied translation files (named webchess.po and webchess.mo) in the dir from step 2
After these changes the text translations in Webchess webpages are Dutch as desired by me.
###### changed code (php part only) in lang.php
$GETTEXT_SUPPORT = true;
if ( ! function_exists('gettext')) {
function gettext($text) {
return $text;
}
}
// Must do some testing before releasing it to mainstream
if($GETTEXT_SUPPORT) {
// Set language to Dutch
putenv('LC_ALL=nl_NL');
setlocale(LC_ALL, 'nl_NL');
}
?>