Community
    • Login

    Replacing/Translating multi string values to other international language

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 2 Posters 637 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.
    • Faseeh ShahF
      Faseeh Shah
      last edited by

      Hi guys, a newbie here

      I have a strings.xml file.

      Is there a way to replace or translate multi string values to other international language

      <string name=“jewellery”>Jewellery</string>

      <string name=“photo_editor”>Photo Editor</string>

      <string name=“gallery”>Gallery</string>

      so basicaly I want to translate Jewellery, Photo Editor and Gallery from english to any other language of choice.

      Thanks in advance

      Alan KilbornA 1 Reply Last reply Reply Quote 2
      • Alan KilbornA
        Alan Kilborn @Faseeh Shah
        last edited by Alan Kilborn

        @Faseeh-Shah

        Do you have a list of the words/phrases to translate, and then the various translations, a possible short example might be:

        Jewellery,Joyas,Bijoux
        Gallery,Galería,Galerie
        
        Faseeh ShahF 1 Reply Last reply Reply Quote 0
        • Faseeh ShahF
          Faseeh Shah @Alan Kilborn
          last edited by

          @Alan-Kilborn

          Yes I have or I can mark copy the string values and use google translate.

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Faseeh Shah
            last edited by Alan Kilborn

            @Faseeh-Shah

            It’s hard to anticipate the larger framework of what you’re doing, in order to know what advice to provide, but with what you’ve given, if I were doing it, I’d think in terms of a “mail merge” (also a shameless plug for my recent script for such a thing).

            Let’s consider the technique shown in THIS THREAD for your situation.

            I’d prepare a “template” file/tab:

            ----<LANG>----
            Hi guys, a newbie here
            I have a strings.xml file.
            Is there a way to replace or translate multi string values to other international language
            <string name="jewellery"><JEWELLERY></string>
            <string name="photo_editor"><PHOTO EDITOR></string>
            <string name="gallery"><GALLERY></string>
            so basicaly I want to translate <JEWELLERY>, <PHOTO EDITOR> and <GALLERY> from english to any other language of choice.
            Thanks in advance
            

            and a “data table” file/tab:

            <LANG>|<JEWELLERY>|<PHOTO EDITOR>|<GALLERY>
            English|Jewellery|Photo Editor|Gallery
            Spanish|Joyas|Editora de fotos|Galería
            French|Bijoux|éditeur de photos|Galerie
            

            Then I’d run the “mail merge” to obtain:

            ----English----
            Hi guys, a newbie here
            I have a strings.xml file.
            Is there a way to replace or translate multi string values to other international language
            <string name="jewellery">Jewellery</string>
            <string name="photo_editor">Photo Editor</string>
            <string name="gallery">Gallery</string>
            so basicaly I want to translate Jewellery, Photo Editor and Gallery from english to any other language of choice.
            Thanks in advance
            ----Spanish----
            Hi guys, a newbie here
            I have a strings.xml file.
            Is there a way to replace or translate multi string values to other international language
            <string name="jewellery">Joyas</string>
            <string name="photo_editor">Editora de fotos</string>
            <string name="gallery">Galería</string>
            so basicaly I want to translate Joyas, Editora de fotos and Galería from english to any other language of choice.
            Thanks in advance
            ----French----
            Hi guys, a newbie here
            I have a strings.xml file.
            Is there a way to replace or translate multi string values to other international language
            <string name="jewellery">Bijoux</string>
            <string name="photo_editor">éditeur de photos</string>
            <string name="gallery">Galerie</string>
            so basicaly I want to translate Bijoux, éditeur de photos and Galerie from english to any other language of choice.
            Thanks in advance
            

            Then, if I were interested in the representation of the original data in Spanish, for example, I’d find that section in the output, and copy it to a new file/tab or wherever I needed it to be.

            If you wanted a semi-automated way of copying the data from the results, you could make a macro of a Mark All operation for regex ^----Spanish----\R\K(?s).*?(?=^----|\z), adding a Copy Marked Text to the macro after the mark. Then copying the data becomes as simple as running a macro (well, one macro per language).

            Faseeh ShahF 2 Replies Last reply Reply Quote 2
            • Faseeh ShahF
              Faseeh Shah @Alan Kilborn
              last edited by

              @Alan-Kilborn
              Thank you, will check the plug for merging and let you know how it went. Yes, theoretically what you advised should solve my prob.

              1 Reply Last reply Reply Quote 1
              • Faseeh ShahF
                Faseeh Shah @Alan Kilborn
                last edited by

                @Alan-Kilborn

                Luckily I found solution, a script.

                Script could be found here in action:
                https://asrt.gluege.boerde.de/

                Source:
                https://github.com/Ra-Na/GTranslate-strings-xml

                Thanks for helping tho.

                Alan KilbornA 1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Faseeh Shah
                  last edited by Alan Kilborn

                  @Faseeh-Shah said in Replacing/Translating multi string values to other international language:

                  Luckily I found solution, a script.

                  If that’s what you were looking for, you shouldn’t have asked your original question in a Notepad++ forum, as it is OFF-TOPIC.

                  Here we only deal with what Notepad++ can do for you, and what you can do with it.

                  In other words, your question must be related to Notepad++ in some way. Your question was NOT.

                  1 Reply Last reply Reply Quote 1
                  • Alan KilbornA Alan Kilborn referenced this topic on
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors