Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
    18 Posts 4 Posters 5.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yon
      last edited by

      where are download .po files?  ::)

      If you are interested in free peering for clearnet and dn42,contact me !

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

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

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • Y
          yon
          last edited by

          @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  ?

          If you are interested in free peering for clearnet and dn42,contact me !

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            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.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • B
              bardelot
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • Y
                yon
                last edited by

                @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 ?

                cn.jpg
                cn.jpg_thumb
                20121012003721.jpg
                20121012003721.jpg_thumb

                If you are interested in free peering for clearnet and dn42,contact me !

                1 Reply Last reply Reply Quote 0
                • B
                  bardelot
                  last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • Y
                    yon
                    last edited by

                    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.

                    20121012012919.jpg
                    20121012012919.jpg_thumb
                    20121012013204.jpg
                    20121012013204.jpg_thumb

                    If you are interested in free peering for clearnet and dn42,contact me !

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      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.

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • jimpJ
                        jimp Rebel Alliance Developer Netgate
                        last edited by

                        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.

                        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • Y
                          yon
                          last edited by

                          @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?

                          If you are interested in free peering for clearnet and dn42,contact me !

                          1 Reply Last reply Reply Quote 0
                          • B
                            bardelot
                            last edited by

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

                            1 Reply Last reply Reply Quote 0
                            • Y
                              yon
                              last edited by

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

                              If you are interested in free peering for clearnet and dn42,contact me !

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.