How I translate the pf2.1 web to other language?



  • How I  translate the pf2.1 web to other language? I want to get other language,how I do ?  ???


  • Rebel Alliance Developer Netgate



  • ok. I have join. but the chinese Complete. how I download and upload my pf server?



  • Nice to see that. I will spent some time on the german language.
    But as yon said - how to implement this into pfsense ?

    Will there be a "language" selection on pfsense GUI sometimes in the future ?



  • @Nachtfalke:
    The language selection already exists under "System->General Setup".

    @yon:
    The language files need to be copied into the correct folder in "/usr/local/share/locale" and the language has to be added in the "pfsense-utils.inc" file in the "get_locale_list()" function.



  • where are download .po files?  ::)


  • Rebel Alliance Developer Netgate

    When you are looking at the language, there is a "Review" tab that has a download link for the .po



  • @bardelot:

    @yon:
    The language files need to be copied into the correct folder in "/usr/local/share/locale" and the language has to be added in the "pfsense-utils.inc" file in the "get_locale_list()" function.

    where are the pfsense-utils.inc file?

    copy to /usr/local/share/locale/zh_CN/ ? or /usr/local/share/locale/zh_CN/LC_MESSAGES  ?


  • Rebel Alliance Developer Netgate

    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.po

    I'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



  • @jimp:

    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.po

    I'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.





  • Rebel Alliance Developer Netgate

    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.


  • Rebel Alliance Developer Netgate

    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.



  • @bardelot:

    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

    yes, 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.php

    Edit 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).



  • @bardelot:

    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.php

    Edit 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.


Log in to reply