Proposal: new version for /usr/local/lib/desktop-menu/translate-menus-antix

Forum Forums antiX-development Development Proposal: new version for /usr/local/lib/desktop-menu/translate-menus-antix

  • This topic has 10 replies, 5 voices, and was last updated Mar 15-7:56 pm by marcelocripe.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #136296
    Member
    PPC

      The GUI that allows to easily change antiX’s language was a very clever idea that was implemented by Xecure (if memory serves me right).
      It works perfectly, with a single terrible problem: it depends on the bash script /usr/local/lib/desktop-menu/translate-menus-antix to correctly localize the first layer of antiX menu (under IceWM, Fluxbox and JWM).
      The problem with that is that translate-menus-anti depends on language files that don’t exist (at least not in pt)… so clicking the button to “translate menus”, if the system is already localized, instantly turns the first layer of the menu into English.

      I patched together a very simple script that merely tries to copy any existing menu templates in the system locale to the correct user configuration folders. If no correct localization folder exists, nothing should get rewritten.

      I tried to test this on a “virtual” antiX, in distrosea, but it seems that the complete locale change requires a reboot (that I can’t do on that web service). I tried forcing the script’s variable to point to “pt” and yes, the script worked correctly and instantly turned my IceWM and Fluxbox menu from English to portuguese… so it *should* work perfectly.

      Please test. If no bugs are found, I think this script should replace the original /usr/local/lib/desktop-menu/translate-menus-antix

      I currently don’t have that much time to write scripts, so this is a very simple, initial version, that anyone can improve, if required. As always, I try to use comments to explain each section of the script.

      EDIT: I found a copy & paste error. Line 11 should be:
      cp ~/.icewm/menu /tmp/_icewm_menu_backup

      P.

      • This topic was modified 1 month ago by PPC.
      #136305
      Member
      PPC

        Revised version: I fixed the copy & paste error, but more importantly, now the script searches the “locale” for the “LANGUAGE” value, not “LANG”.
        I just tested, in my own computer, in antiX 22- the script works as it should. (Note: at least in pt-pt, the “Refresh menu” entry, available in /usr/share/antiX/localisation/pt/icewm/menu (and it’s variants is not localized, for some reason. That’s not he script’s problem… it merely copies the template file to the user’s folder.) In antiX 23, the localization of the first layer of the menu is perfect!

        Note: if you run this script, you’ll lose any customization that you did to antiX menu, and will get it’s original version, in your own locale (if that translation exists).

        P.

        • This reply was modified 1 month ago by PPC.
        • This reply was modified 1 month ago by PPC.
        • This reply was modified 1 month ago by PPC.
        #136425
        Member
        marcelocripe

          Hello PPC.
          The lack of time caused by real life has prevented me from participating and helping with the tests as I usually do. At least today I managed to do some tests.
          I started antiX 23 from the full 64-bit ISO without persistence in “pt_BR”, clicked on the “User Language” menu.
          I changed the language to “fr_BE” and clicked the “Translate Menus” button.
          I left the session and logged in again with the demo user.
          The Applications submenus have been translated into the “fr_BE” language, but the main menu has been translated into “en”.
          I ran your program “translate-menus-antix2.zip” and received the message “Your menus seem to not have chagend.”.
          I left the session and logged in again with the demo user.
          I ran your program “translate-menus-antix2.zip” and received the message “Your menus seem to not have chagend.”.
          Then I downloaded your program “translate-menus-antix.zip”, changed line 11 to “cp ~/.icewm/menu /tmp/_icewm_menu_backup”, ran your program and got the message “Your menus seem to have been correctly localized.”, the main menu was successfully translated to “fr_BE”.
          I carried out other tests with the languages “es_AR”, “es_MX” and “gl_ES”, to translate the submenus of the Applications it is always necessary to click on the “Translate the Menus” button, and only then run your program “translate-menus-antix .zip” (with line 11 corrected) to translate the main menu into the language I had selected before.
          I don’t know of any other operating system that has a menu translation feature as flexible and versatile as the “User Language” program. This ability to change the language and still be able to correct the main menu with your program, makes antiX Linux even more complete and better every day.
          I hope these tests help you with something and that other people can help with more tests.
          Thank you very much!

          – – – – –

          Olá, PPC.
          A falta de tempo causada pela vida real vem me impedindo de pode participar e de ajudar com os testes como eu costumo fazer. Ao menos hoje eu consegui fazer alguns testes.
          Eu iniciei o antiX 23 da ISO full de 64 bits sem persistência em “pt_BR”, cliquei no menu “User Language” (Configurações de Idioma do Usuário).
          Alterei o idioma para “fr_BE” e cliquei no botão “Traduzir os Menus”.
          Sai da sessão e entrei novamente com o usuário demo.
          Os submenus dos Aplicativos foram traduzidos para o idioma “fr_BE”, mas o menu principal foi traduzido para “en”.
          Eu executei o seu programa “translate-menus-antix2.zip” e recebi a mensagem “Your menus seem no not have chagend.”.
          Sai da sessão e entrei novamente com o usuário demo.
          Eu executei o seu programa “translate-menus-antix2.zip” e recebi a mensagem “Your menus seem no not have chagend.”.
          Em seguida, baixei o seu programa “translate-menus-antix.zip”, alterei a linha 11 para “cp ~/.icewm/menu /tmp/_icewm_menu_backup”, executei o seu programa e recebi a mensagem “Your menus seem have been correctly localized.”, o menu principal foi traduzido para com sucesso para “fr_BE”.
          Eu realizei outros testes com os idiomas “es_AR”, “es_MX” e “gl_ES”, para traduzir os submenus dos Aplicativos sempre é necessário clicar no botão “Traduzir os Menus”, para só depois executar o seu programa “translate-menus-antix.zip” (com a linha 11 corrigida) para traduzir o menu principal para o idioma que eu havia selecionado antes.
          Eu não conheço nenhum outro sistema operacional que possui um recurso de tradução dos menus tão flexível e tão versátil como do programa “User Language”. Esta capacidade de alterar o idioma e ainda poder corrigir o menu principal com o seu programa, torna o antiX Linux ainda mais completo e cada dia melhor.
          Eu espero que estes testes te ajudem em alguma coisa e que outras pessoas possam ajudar com mais testes.
          Muito obrigado!

          #136675
          Member
          RJP

            translate-menus-antix2 corrected the main menu locale (Finnish). Very good script. 🙂

            #136687
            Member
            PPC

              @marcelocripe and @RJP – thanks for testing and for your feedback!

              Dear Marcelo – I’ve tested the second version of the script and it always worked perfectly in several languages. The script is supposed to replace the script that the main Language GUI runs when users click the “Translate menu” button, so please use the GUI to select the desired language (do not click the “Translate menu” button!!!) and log off and log back on. Run my script then also click the menu entry that updates the “Apps” menu (it’s the other thing that the “Translate menu” button does, so you have to do it manually, when running my script).
              The entire antiX menu never failed to get translated when I do that.

              @anticapitalista – if no problem is found with my script, it should, as soon as possible, replace the original “translate-menus-antix” one that is currently included in antiX (since, in my tests, all it does is to completely set the first layer of the menu to English, if it’s already localized, so it’s a dangerous feature to have, in a script that is supposed to help non English speaking users, right?).
              The main script that sets antiX language is also in need of a few tweaks (mainly the non localized buttons and the non localized warning that the path of the default system folders (downloads, documents, etc) will be localized)… also I think the warning that pops up in pt_br (but not in pt_pt) is scary for people that don’t speak a word of English (it has big letters in red, like it’s warning that it will do something very dangerous, instead of just asking folks to help with the localization) and has no obvious button to close it.

              P.

              • This reply was modified 4 weeks, 1 day ago by PPC.
              • This reply was modified 4 weeks, 1 day ago by PPC.
              #136690
              Forum Admin
              anticapitalista

                @PPC – If the script is ready and all I have to do is package it, I will.
                There seem to be several improved scripts but they are all over the forum and none have appeared at GitLab.
                BTW – I have seen your fluxbox merge request, but I’m not going to accept it.
                Users will have to make the changes by themselves (if they wish).

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

                antiX with runit - leaner and meaner.

                #136691
                Member
                PPC

                  none have appeared at GitLab

                  @anticapitalista –

                  I have no idea where to send the merge request for this script… other than that, recently I created the xinput “pointing device manager” that seems to have been well tested, but I have no idea where to send it to- antiX goodies? Yad goodies? ( also If adopted, will it replace ds-mouse, be used side-by-side with it or will it be launched from Control Centre instead of ds-mouse, if synaptics is not installed?)

                  I had very little feedback regarding from my proposed new version of antiX-updater, so I can’t recommend it for now (it’s almost unchanged, except for the part that checks if apt is already running and the added function that kicks in if the flag is used, making the script just check if the user has to be reminded to check for updates- IF, and it’s a big if, that version of antiX-updater is used, I can then recommend tiny changes to the .deb post-install, and if possible to what the system does when coming off suspension, etc- because, if the user wants to be reminded regularly to check for updates, that should kick in on those occasions, and also every time antiX starts)

                  In conclusion: if you point me to the right git address, I’ll upload this script… The mouse and touchpad one, it all depends on where and how you’ll want to use it…

                  P.

                  #136692
                  Forum Admin
                  anticapitalista

                    @PPC – @all If they are new scripts and not edited/improved existing ones then you could create a git repo and send me the link when it is ready.
                    At the moment, we have very useful scripts all over the forum and it is impossible to keep track.
                    To be ready for packaging and uploading, the scripts need to have been tested satisfactorily, translations (desktop and/or po files) provided so they can be added to transifex (if needed).

                    Is dave working on ds-mouse?

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

                    antiX with runit - leaner and meaner.

                    #136715
                    Member
                    PPC

                      @anticapitalista – last time I heard from Dave he said he was inspecting by bash code to eventually use it on a new version of his script. That was about a week ago, maybe?

                      I changed my translate-menus-antix script a tiny bit. It’s not “perfect” but at least, in my tests, it seems to work better than the original (and more complex and powerful version), so I made a commit here: https://gitlab.com/antiX-Linux/locale-antix/-/merge_requests/1 – if possible, please try testing it in live mode and, for example, start antiX in English, use the “user language” GUI to change it to Greek, restart your session and then run my proposed script. Now both the first layer of the menu and the Applications sub-menu should come up in Greek… Then, in Greek, run my script again. Nothing should change, hopefully and the menu should still be in Greek.

                      EDIT: I just noticed that, at least in antiX 23 (that I tested Live, in distrosea.com), the folder /usr/share/antiX/localisation/es_ES (Spanish from Spain, I assume) does not have all the required menus, just Fluxbox and strangely some rox config folder… It seems to be the only language where that happens… the “es” folder seems fine.

                      P.

                      • This reply was modified 4 weeks, 1 day ago by PPC.
                      #136745
                      Member
                      abc-nix
                        # Localization for this script:
                        TEXTDOMAINDIR=/usr/share/locale
                        TEXTDOMAIN=translate-menus-antix

                        The locale-antix package seems to be missing translation files, and that is why the original translate-menus-antix doesn’t properly translate the strings for the menu templates. Was this a feature planned for the future or are they missing after migrating the source from a different package?

                        #136747
                        Member
                        marcelocripe

                          … also I think the warning that pops up in pt_br (but not in pt_pt) is scary for people that don’t speak a word of English (it has big letters in red, like it’s warning that it will do something very dangerous, instead of just asking folks to help with the localization) and has no obvious button to close it.

                          PPC, you are absolutely right, the entire text in English is displayed for Brazilians, even when the translations are available at https://app.transifex.com/antix-linux-community-contributions/antix-contribs/antix-translation-info/. In the first implementation of this program (either in ISO or through updates), the “pt_BR” translation worked correctly, I don’t know why it is no longer working.

                          – – – – –

                          … also I think the warning that pops up in pt_br (but not in pt_pt) is scary for people that don’t speak a word of English (it has big letters in red, like it’s warning that it will do something very dangerous, instead of just asking folks to help with the localization) and has no obvious button to close it.

                          PPC, você tem toda razão, o texto todo em idioma Inglês sendo exibido para os Brasileiros, mesmo quando as traduções estão disponíveis no https://app.transifex.com/antix-linux-community-contributions/antix-contribs/antix-translation-info/. Na primeira implementação deste programa (seja na ISO ou por meio das atualizações), a tradução “pt_BR” funcionava corretamente, eu não sei por qual motivo não está mais funcionando.

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.