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

    PfSense® software translations with Zanata

    Scheduled Pinned Locked Moved Messages from the pfSense Team
    22 Posts 7 Posters 6.4k 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.
    • S
      Steve_B Netgate
      last edited by

      Signing up to help with a translation

      If you would like to contribute your language skills to the pfSense® project, please:

      • Visit www.zanata.org

      • Click "Go to the App"

      • Click "Sign Up"

      • Create a user account

      • Send an email to sbeaver@netgate.com or to renato@netgate.com. Provide your Zanata username and the language you wish to contribute

      This will allow us to add you to the project as quickly as possible

      Thanks.

      Als ik kan

      1 Reply Last reply Reply Quote 0
      • A
        athurdent
        last edited by

        I ran into quite a few translations that need to be tested for context and proper use of all those %s.
        Is there quick way to copy the necessary files to my test KVM to see how bad it really looks? :)

        1 Reply Last reply Reply Quote 0
        • D
          doktornotor Banned
          last edited by

          Well yeah that's exactly what I meant by #2.

          1 Reply Last reply Reply Quote 0
          • A
            athurdent
            last edited by

            @doktornotor:

            Well yeah that's exactly what I meant by #2.

            I know :)

            The .po file can be downloaded, but I cannot find any way to download the .mo file. Then again I haven't really looked into what those files are doing and if maybe the .po is the only thing I need. Guess I will try to abuse the Brazilian language folder and see where that takes me.

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              Well you need to compile it; IIRC the command was something like

              msgfmt -o lang.mo lang.po
              

              but that's not exactly useful for people since that tool of course is not available on pfSense.

              1 Reply Last reply Reply Quote 0
              • A
                athurdent
                last edited by

                This seems to do the job for me:
                https://po2mo.net/

                1 Reply Last reply Reply Quote 0
                • P
                  phil.davis
                  last edited by

                  @athurdent:

                  I ran into quite a few translations that need to be tested for context and proper use of all those %s.
                  Is there quick way to copy the necessary files to my test KVM to see how bad it really looks? :)

                  gettext() strings for translation that include multiple "%s" should have all the "%s" numbered:

                  sprintf(gettext('Interface %1$s has IP address %2$s'), "LAN", "1.2.3.4")
                  

                  Then a translator can re-order the sentence if they need to in a target language where the whole sentence happens a different way around.

                  I made a start on that in /etc with PR https://github.com/pfsense/pfsense/pull/3460
                  and finished it with https://github.com/pfsense/pfsense/pull/3462

                  Both those have been merged and I see that Renato just regenerated the ".pot" file. So I guess there are up-to-date translations strings waiting for any keen translators.

                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                  1 Reply Last reply Reply Quote 0
                  • A
                    athurdent
                    last edited by

                    Thanks Phil!

                    I guess something like this in firewall_rules_edit.php cannot be translated yet because it's missing those gettext thingies?

                    $group->setHelp(sprintf('Specify the %s port or port range for this rule. The "To" field may be left empty if only filtering a single port.',strtolower($name)));
                    
                    1 Reply Last reply Reply Quote 0
                    • P
                      phil.davis
                      last edited by

                      @athurdent:

                      Thanks Phil!

                      I guess something like this in firewall_rules_edit.php cannot be translated yet because it's missing those gettext thingies?

                      $group->setHelp(sprintf('Specify the %s port or port range for this rule. The "To" field may be left empty if only filtering a single port.',strtolower($name)));
                      

                      PR https://github.com/pfsense/pfsense/pull/3464 should fix it.

                      As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                      If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                      1 Reply Last reply Reply Quote 0
                      • A
                        athurdent
                        last edited by

                        Great, thanks!

                        1 Reply Last reply Reply Quote 0
                        • S
                          Steve_B Netgate
                          last edited by

                          The correct syntax is actually:

                          $group->setHelp('Specify the %s port or port range for this rule. The "To" field may be left empty if only filtering a single port.', array(strtolower($name))));
                          

                          setHelp accepts a second argument which is an array of arguments to be passed to sprintf. The first argument (format string) does get gettext()

                          I want to see if we actually use that syntax anywhere, and if not (or few) I may update it to use a more conventional syntax.

                          Als ik kan

                          1 Reply Last reply Reply Quote 0
                          • KOMK
                            KOM
                            last edited by

                            You'll know you've hit the bigtime when someone does a translation to Klingon.

                            ghItlh bIngDaq ghItlh leghlu' pa' tlhIngan Hol

                            1 Reply Last reply Reply Quote 0
                            • S
                              Steve_B Netgate
                              last edited by

                              Just pushed a change as described above. setHelp now likes the more conventional syntax:  e.g.:```
                              setHelp("%d interfaces have been detected", $numIfs);

                              Als ik kan

                              1 Reply Last reply Reply Quote 0
                              • A
                                athurdent
                                last edited by

                                @KOM:

                                You'll know you've hit the bigtime when someone does a translation to Klingon.

                                ghItlh bIngDaq ghItlh leghlu' pa' tlhIngan Hol

                                Klingon 0.0001% complete now.
                                Sadly there's no Klingon, Elvish, Kölsch or FarCry Primal on Zanata. But you can always ask Steve to include Esperanto or Latin.

                                1 Reply Last reply Reply Quote 0
                                • P
                                  phil.davis
                                  last edited by

                                  A few more bits of unneeded sprintf and gettext in setHelp removed by https://github.com/pfsense/pfsense/pull/3466

                                  You can all get busy with the Klingon translation now. Maybe I will have a go at English-Pirate en-PI.

                                  As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                                  If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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

                                    Sadly, unless I'm overlooking something I don't see an option for either Pirate or Klingon on Zanata

                                    Consider me timbers shivered.

                                    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
                                    • A
                                      athurdent
                                      last edited by

                                      Is there anything special about those?

                                      #: src/usr/local/www/system_advanced_network.php:186
                                      msgid "IPv4 address of Tunnel Peer"
                                      msgstr "IPv4 Adresse der Tunnelgegenstelle"
                                      

                                      It's translated but it does not show. Might be my test setup, I just replace the Turkish .po and .mo files and reroot afterwards.

                                      I also believe that I have translated some Console messages a while ago, but they don't show either.

                                      #: src/etc/inc/config.console.inc:43
                                      msgid "Press ENTER to continue."
                                      msgstr "Drücken Sie die Eingabetaste um fortzufahren."
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • KOMK
                                        KOM
                                        last edited by

                                        I suppose new subforums will be created to match every additional language?

                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          athurdent
                                          last edited by

                                          @KOM:

                                          I suppose new subforums will be created to match every additional language?

                                          Want to lure out those Klingons hidden all over earth? Neat.

                                          If memory serves Gonzopancho once said that he only creates forums for languages he has someone for to speak/understand.

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