Internationalisation of antiX community scripts

Forum Forums General Tips and Tricks Internationalisation of antiX community scripts

  • This topic has 56 replies, 7 voices, and was last updated Mar 8-3:48 pm by Anonymous.
Viewing 15 posts - 16 through 30 (of 57 total)
  • Author
    Posts
  • #50259
    Anonymous
      Helpful
      Up
      0
      ::

      do you really think a standard user will be able to create his own po type translation file to a community script? Where should he look for the strings and texts to be translated? And where should he put them after he did the work? Does he even know about the existence of po files? I didn’t… Maybe this could be worth to investigate and provide a convenient solution for antiX community

      You’re a hero for identifying an apparent deficiency and having the motivation to pursue a solution. Really, I haven’t “studied it” ~~ as a monoglot, while inspecting the antiX scripts I have only “tripped over” noticing those gettext-related functions. I have also noticed inline comments within some scripts, comments intended to provide guidance and warnings (e.g., translators: do not translate the following line!)

      websearching while typing this post, I skimmed https://pymotw.com/2/gettext/
      Apparently, multiple tools (utilities) are availble, including one which serves to extract “message catalog” sets from existing .mo files

      a debian “gettext-doc” package is available
      but its installed content https://packages.debian.org/buster/all/gettext-doc/filelist
      does not suggest much focus toward bash//shell scripting.

      #50262
      Member
      Robin
        Helpful
        Up
        0
        ::

        Actually I took notice of this circumstances (mot even .po but .mo only) some minutes ago in this thread concerning a bug in translation which prevents script from functioning in french language obviously.
        Since the replacement in transifex is blocked by proof-reader/reviewer flag this bug was actually marked three times with a suggestion to fix it, which is to say 6 years if I am not mistaken. I edited the corresponding french .mo file from my antiX 17 using a hex editor and appended the result to my answer in hope it would fit in his newer version of antiX still. Downlodaing the file directly from transifex “for use” delivers a .po file actually (but only, no .mo file available there), but I wouldn’t know where I should this user tell to put the also corrected .po file now. This structure looks very efficient to me from point view of workflow while creating translations, but it is not very transparent for users in case you are in need to fix something on your own.

        From transifex .po file:
        original (malfunctional)

        #: add-desktop.sh:15
        msgid "1) Application Menu|2) Desktop Shortcut|3) Personal"
        msgstr "1) Menu des applications 2) Raccourci Bureau 3) Personnel"

        (replacement, probably working)

        #: add-desktop.sh:15
        msgid "1) Application Menu|2) Desktop Shortcut|3) Personal"
        msgstr "1) Menu des applications|2) Raccourci Bureau|3) Personnel"

        I’d appreciate if you could point him in the right place, since I have to study this whole structure a little more detailed first. I’ll attache the corrected .po file here, just in case he will need it rather than the 17er .mo version I have given him already.

        Best regards
        Robin

        • This reply was modified 2 years, 3 months ago by Robin.
        • This reply was modified 2 years, 3 months ago by Robin.

        Windows is like a submarine. Open a window and serious problems will start.

        #50270
        Forum Admin
        Dave
          Helpful
          Up
          0
          ::

          @skidoo: Along with C/C++; Python also uses “_()” as the translation function. As previously mention/noticed bash used $ as _ is not a valid function/variable name.

          My memory is that the .po files are stored / managed via the transifex site. Only the “needed” (for program operation and packaging) .mo files are in the various app repositories.
          I cannot recall exactly how the translation files are made (.po/.mo/.pot/etc). My memory is that there are scripts from bitjam; the ones used are stored in the antiX-Linux gitlab I believe. These are used for the making/converting of the various files.
          https://gitlab.com/antiX-Linux/Translations
          I have notes / instructions on how to go about this stored somewhere. I have never been able to get the instructions ingrained in my mind. Nor how how to test correctly. Using app-select as an example. I wrote it with the gettext functions inside. Beyond that my brainspace holds so little information as to the actual translation files / text domains (The other missing parts to make translation function) I may as well say my brainspace contains zero information on the subject. Actually for testing I would use the text domain and one string from another app and launch it in terminal preceded with LANG=…; If it works, then change the string in the app I am testing to what it should be and try the next one. Time to dig out those instructions and try again while others a looking into this as well.

          Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown

          #50279
          Member
          Robin
            Helpful
            Up
            0
            ::

            hello @skidoo and @Dave,
            my last answer from yesterday has gone lost (maybe it was considered automatically as spam by filters only and will turn up some time later again) two times after I appended a tar’d .po file I had corrected. Never mind, I’ll add it’s original content as a fullquote now so you may read it anyway. This time I’ll abstain from appending the tar’d .po file a precaution.

            Actually I took notice of this circumstances (not even .po but .mo only) some minutes ago in this thread concerning a bug in translation which prevents script from functioning in french language obviously.
            Since the replacement in transifex is blocked by proof-reader/reviewer flag this bug was actually marked three times with a suggestion to fix it, which is to say 6 years if I am not mistaken. I edited the corresponding french .mo file from my antiX 17 using a hex editor and appended the result to my answer in hope it would fit in his newer version of antiX still. Downlodaing the file directly from transifex “for use” delivers a .po file actually (but only, no .mo file available there), but I wouldn’t know where I should this user tell to put the also corrected .po file now. This structure looks very efficient to me from point of view of workflow while creating translations, but it is not very transparent for users in case you are in need to fix something on your own.

            From transifex .po file:
            original (malfunctional)

            #: add-desktop.sh:15
            msgid "1) Application Menu|2) Desktop Shortcut|3) Personal"
            msgstr "1) Menu des applications 2) Raccourci Bureau 3) Personnel"

            (replacement, probably working)

            #: add-desktop.sh:15
            msgid "1) Application Menu|2) Desktop Shortcut|3) Personal"
            msgstr "1) Menu des applications|2) Raccourci Bureau|3) Personnel"

            I’d appreciate if you could point him in the right place, since I have to study this whole structure a little more detailed first. I’ll attache the corrected .po file here, just in case he will need it rather than the 17er .mo version I have given him already.

            Best regards
            Robin

            P.S.: I’ll check the tools you directed me to for editing .mo files before long. Thanks!

            The main problems are: even in the german transifex tranlations (in which I started to look into not long ago for the first time) can found many strings containing really insufficient translations, I fixed as many of them as I was able to make it. In order to make the attempt of fixing the aforementioned bug in french strings I had to figure out how to join french translation team additionaly to german team in tranifex in order to get alowed to edit this entry it at all. But this bugy entry is probably set to “reviewed”, which keeps my fix from being saved.
            And now the .mo and .po file comes into the game: How can the user in the thread I linked to fix this on his own in his system without knowledge about operating a hex editor?

            Time to dig out those instructions and try again …

            I’ll do the same during next period of time.

            Robin

            P.S.: Sorry for answering in french language over there, I just wanted to be polite towards the user as he started with saying he was french native speaker from Belgium and new to our board. I hadn’t thought about you having to be able to understand it also. I should have answered in English language of cause for better understanding each other.

            • This reply was modified 2 years, 3 months ago by Robin.

            Windows is like a submarine. Open a window and serious problems will start.

            #50292
            Member
            Robin
              Helpful
              Up
              0
              ::

              Sometimes things can be really easy:

              msgunfmt add-desktop.mo >add-desktop.po

              will decompile .mo file back to editable .po type of file.

              Windows is like a submarine. Open a window and serious problems will start.

              #50293
              Member
              Robin
                Helpful
                Up
                0
                ::

                The reverse order (.po –> .mo) will be done by
                msgfmt -o add-desktop.po add-desktop.mo
                after editing the lines in question.
                I’ll inform user in the other thread about the way he can fix it on his own.

                this makes things a little more handy when using the standard way of script translation you pointed me to.

                Edit: Here is a Comprehensive and rather complete source of information about the structure I just digged out (gnu.org).

                • This reply was modified 2 years, 3 months ago by Robin.
                • This reply was modified 2 years, 3 months ago by Robin.

                Windows is like a submarine. Open a window and serious problems will start.

                #50302
                Member
                Xecure
                  Helpful
                  Up
                  0
                  ::

                  Since the replacement in transifex is blocked by proof-reader/reviewer flag

                  This is the third time this comes up. Can we ask the translators/reviewers to NOT block translation strings? They don’t seem to review it properly, so it is better if they are not blocked.
                  DO I need to register in the MX Linux forum to make them aware that this blocking is detrimental to project translations? It doesn’t seem that the ones reviewing translations ever enter this forum (even though the transifex project has “antiX” in its name), so I assume the one in charge is also an MX linux follower.

                  antiX Live system enthusiast.
                  General Live Boot Parameters for antiX.

                  #50303
                  Member
                  Robin
                    Helpful
                    Up
                    0
                    ::

                    hmm…

                    15.3.12 Shell Format Strings

                    Shell format strings, as supported by GNU gettext and the ‘envsubst’ program, are strings with references to shell variables in the form $variable or ${variable}. References of the form ${variable-default}, ${variable:-default}, ${variable=default}, ${variable:=default}, ${variable+replacement}, ${variable:+replacement}, ${variable?ignored}, ${variable:?ignored}, that would be valid inside shell scripts, are not supported. The variable names must consist solely of alphanumeric or underscore ASCII characters, not start with a digit and be nonempty; otherwise such a variable reference is ignored.

                    (from GNU “Translators for other Languages “)

                    Well then?

                    • This reply was modified 2 years, 3 months ago by Robin.

                    Windows is like a submarine. Open a window and serious problems will start.

                    #50305
                    Member
                    Robin
                      Helpful
                      Up
                      0
                      ::

                      Can we ask the translators/reviewers to NOT block translation strings? They don’t seem to review it properly, so it is better if they are not blocked.

                      Good idea. I’ll ask in transifex translation team message system whether this is possible.

                      Unbelievable! This bug has survived in french version for 6 years now!

                      Windows is like a submarine. Open a window and serious problems will start.

                      #50306
                      Member
                      Robin
                        Helpful
                        Up
                        0
                        ::

                        Bad news:
                        msgfmt doesn’t do the job, I have tested right now the steps I posted in the other thread. I just had derived them from the contents of “man msgfmt”. But:

                        $ msgfmt -o add-desktop.po add-desktop.mo
                        add-desktop.mo:1:2: syntax error
                        add-desktop.mo:1: Schlüsselwort »a« ist unbekannt
                        add-desktop.mo:4: Schlüsselwort »v« ist unbekannt
                        add-desktop.mo:5: Schlüsselwort »Application« ist unbekannt
                        add-desktop.mo:6: Schlüsselwort »Report« ist unbekannt
                        add-desktop.mo:7: Schlüsselwort »POT« ist unbekannt
                        add-desktop.mo:8: Schlüsselwort »PO« ist unbekannt
                        add-desktop.mo:9: Schlüsselwort »Last« ist unbekannt
                        add-desktop.mo:10: Schlüsselwort »Language« ist unbekannt
                        add-desktop.mo:11: Schlüsselwort »MIME« ist unbekannt
                        add-desktop.mo:12: Schlüsselwort »Content« ist unbekannt
                        add-desktop.mo:13: Schlüsselwort »Content« ist unbekannt
                        add-desktop.mo:14: Schlüsselwort »Language« ist unbekannt
                        add-desktop.mo:15: Schlüsselwort »Plural« ist unbekannt
                        add-desktop.mo:16: Schlüsselwort »X« ist unbekannt
                        add-desktop.mo:17: Schlüsselwort »Menu« ist unbekannt
                        msgfmt: es sind 16 fatale Fehler aufgetreten
                        

                        no clue what’s going wrong. Anybody an idea?

                        • This reply was modified 2 years, 3 months ago by Robin.
                        • This reply was modified 2 years, 3 months ago by Robin. Reason: typo

                        Windows is like a submarine. Open a window and serious problems will start.

                        #50310
                        Member
                        Xecure
                          Helpful
                          Up
                          0
                          ::

                          msgfmt add-desktop.po add-desktop.mo

                          Which is the output? Is it the .mo?
                          msgfmt add-desktop.po -o add-desktop.mo
                          Is it the .po?
                          msgfmt add-desktop.mo -o add-desktop.po

                          If you want to attach compressed files, attach them as .zip (jpg, png, txt, pdf and zip attach OK)

                          • This reply was modified 2 years, 3 months ago by Xecure.

                          antiX Live system enthusiast.
                          General Live Boot Parameters for antiX.

                          #50314
                          Member
                          Robin
                            Helpful
                            Up
                            0
                            ::

                            Really, we should set up a test suite to be used by our transifex translators of antiX, which could consist of a set of scripts.

                            I envisage something like

                            get .po file form transifex
                            compile file from .po to .mo
                            prepare everything necessary for user to temporarily start the script/program in question using this .mo file instead of the original one on his system
                            Give him feedback what he should be interested to look at in particular

                            in terms of pseudocode/process chart.

                            I mean, something functioning like what I had in mind when writing

                            DIAG_VARS=0            # [0/1] should be always set to zero. Set this value to 1 for testing purposes to activate printing to screen the values all the variables used contain while running
                            LANGUAGE_DETECTION=0    # [0/1] is to be set to zero for normal operation. Set this value to "1" in order to get detailed information and instructions about determination of language code to be used in language filenames.
                            LANGUAGE_TEST="en"	# [ "0" / "Lang.-Code" ] should be always set to zero enclosed in double quotes ("0") for normal operation. For testing purposes set this variable to the language code (between "speech-signs") you want to test program with ( e.g. LANGUAGE_TEST="fr" or LANGUAGE_TEST="fr_FR" for french language testing)

                            in my script from post #1 above, but realised for the gettext way of utilisation.

                            Windows is like a submarine. Open a window and serious problems will start.

                            #50316
                            Member
                            Robin
                              Helpful
                              Up
                              0
                              ::

                              Which is the output? Is it the .mo?

                              it was the output of
                              msgfmt -o add-desktop.po add-desktop.mo
                              EDIT: (sorry, there was a typo in the original post, the -o was missing in both of my replies.)

                              If you want to attach compressed files, attach them as .zip (jpg, png, txt, pdf and zip attach OK)

                              Well I have files always present in .tar.gz format only, which is actually zip. Since this is standard format when using “New–>Archive” entry from spaceFM context menu after right clicking on a file in antiX, I should think every standard user would employ this. Actually I do use
                              tar -zcf archive.tar.gz some-file
                              on command line instead. Should I rather install an extra zip tool?

                              Btw, both of the .jpg files went through unmodified some minutes later after fifth shot only, in a separate posting above. I don’t hope mods will have to clean up too much after all these failed upload attempts.

                              • This reply was modified 2 years, 3 months ago by Robin. Reason: typo
                              • This reply was modified 2 years, 3 months ago by Robin.

                              Windows is like a submarine. Open a window and serious problems will start.

                              #50324
                              Member
                              Xecure
                                Helpful
                                Up
                                0
                                ::

                                Since this is standard format when using “New–>Archive” entry from spaceFM context menu after right clicking on a file in antiX,

                                From Spacefm (antiX 19.3)
                                Right-click file, New > Archive
                                At the bottom-right
                                Archive Format: (select) Zip (*.zip *.ZIP)
                                Click OK

                                Sometimes we don’t see it, until we see it.
                                After the second time trying to post a .tar.gz file last year on the forums, and getting blocked, I go .zip only for the forum attachments.

                                antiX Live system enthusiast.
                                General Live Boot Parameters for antiX.

                                #50326
                                Forum Admin
                                anticapitalista
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Use poedit to turn .po files to .mo fies.

                                  Philosophers have interpreted the world in many ways; the point is to change it.

                                  antiX with runit - leaner and meaner.

                                Viewing 15 posts - 16 through 30 (of 57 total)
                                • You must be logged in to reply to this topic.