How I translate the pf2.1 web to other language?
-
pfsense-utils.inc is in /etc/inc/
And look at
: ls -l /usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/
total 1744
-rw-r–r-- 1 root wheel 591471 Jul 7 19:54 pfSense.mo
-rw-r--r-- 1 root wheel 1144626 Jul 7 19:54 pfSense.poI'd guess that's where it goes... but I'm really not sure how that bit works.
-
The .po files are compiled into binary .mo files using the 'msgfmt' tool.
However the problem is that the encoding is currently always set to be ISO8859-1 (latin1), hence the "pt_BR.ISO8859-1" folder. ISO8859-1 is suitable for most "Western European" languages but not for Simplified Chinese. So the set_language() calls in the guiconfig.inc and system.php files (both in /usr/local/www) will have to be modified to take the encoding as its second argument (In case of Simplified Chinese probably GB18030 or UTF-8).
http://en.wikipedia.org/wiki/Gettext
http://en.wikipedia.org/wiki/ISO/IEC_8859-1 -
pfsense-utils.inc is in /etc/inc/
And look at
: ls -l /usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/
total 1744
-rw-r–r-- 1 root wheel 591471 Jul 7 19:54 pfSense.mo
-rw-r--r-- 1 root wheel 1144626 Jul 7 19:54 pfSense.poI'd guess that's where it goes... but I'm really not sure how that bit works.
I have edit pfsense-utils.inc and upload .po file. but it not work. where .mo file download ?
-
@yon:
I have edit pfsense-utils.inc and upload .po file. but it not work. where .mo file download ?
Copy the file as pfSense.po into /usr/local/share/locale/zh_CN.ISO8859-1/LC_MESSAGES/ (the encoding is wrong so no idea if this even works at all) and then cd into the directory and run "msgfmt pfSense.po" which should create your .mo file.
-
there are has no zh_CN.ISO8859-1 folder, just is gb2312.
I have po tool make .mo file and upload it. but it is still not work.
-
usr/local/www/guiconfig.inc:88:set_language($g['language']); usr/local/www/system.php:174: set_language($config['system']['language']);
Edit those lines to be:
usr/local/www/guiconfig.inc:88:set_language($g['language'], 'GB2312'); usr/local/www/system.php:174: set_language($config['system']['language'], 'GB2312');
Then press Save on System > General with your language selected. See if that helps.
-
If that does work then we'll have to somehow account for the encoding when setting the language. Either by a separate encoding drop-down or perhaps a hash containing the available encodings for a given language.
-
The .po files are compiled into binary .mo files using the 'msgfmt' tool.
However the problem is that the encoding is currently always set to be ISO8859-1 (latin1), hence the "pt_BR.ISO8859-1" folder. ISO8859-1 is suitable for most "Western European" languages but not for Simplified Chinese. So the set_language() calls in the guiconfig.inc and system.php files (both in /usr/local/www) will have to be modified to take the encoding as its second argument (In case of Simplified Chinese probably GB18030 or UTF-8).
http://en.wikipedia.org/wiki/Gettext
http://en.wikipedia.org/wiki/ISO/IEC_8859-1yes, ISO8859-1 not support chinese. but chinese support english. maybe change to UTF-8 for world.
but how fix these files?
-
Just try Jim's suggestion:
Copy the pfSense.po and pfSense.mo files into the 'zh_CN.GB2312/LC_MESSAGES' folder. And make sure the file names are correct (the S is upper case).Then change those two set_language function calls to be:
set_language($g['language'], 'GB2312'); // in usr/local/www/guiconfig.inc
set_language($config['system']['language'], 'GB2312'); // in usr/local/www/system.phpEdit 1:
Btw: Did you translate the correct file? The original file size (pfSense.pot) is 10x yours.Edit 2:
Looking at the translation project website I think you have used the Terminology project (http://pootle.pfsense.org.br/zh_CN/). However there should be a pfSense project as is the case here (http://pootle.pfsense.org.br/pt_BR/). I don't know how you can add the correct project, maybe send an email to the maintainer (vcoque). -
Just try Jim's suggestion:
Copy the pfSense.po and pfSense.mo files into the 'zh_CN.GB2312/LC_MESSAGES' folder. And make sure the file names are correct (the S is upper case).Then change those two set_language function calls to be:
set_language($g['language'], 'GB2312'); // in usr/local/www/guiconfig.inc
set_language($config['system']['language'], 'GB2312'); // in usr/local/www/system.phpEdit 1:
Btw: Did you translate the correct file? The original file size (pfSense.pot) is 10x yours.Edit 2:
Looking at the translation project website I think you have used the Terminology project (http://pootle.pfsense.org.br/zh_CN/). However there should be a pfSense project as is the case here (http://pootle.pfsense.org.br/pt_BR/). I don't know how you can add the correct project, maybe send an email to the maintainer (vcoque).yes, I am download the Terminology project, there has no other chinese file can downlaod. I don't know which file need tranlater.