How to use Weblate with source strings that are merely IDs?












1














I have my project localisations in .json files, here’s an english example:



{
"AreYouSure" : "Are you sure?",
"DescriptionText" : "This is a very long description text, used to aid the user.",
}


As shown in the example my source strings are merely IDs and not sentences on their own which gives me quite a few issues, for example:




  • I am getting a lot of errors due to source and translation not both ending with a stop / question / exclamation mark

  • Machine translation is not working as it is translating only the id

  • When translating I am seeing only source id which is not helpful when writing for additional languages. I can bypass this by selecting additional languages in user preferences but this will not work in zen mode.


My ideal solution would be to define English as a base language by which English translations would be treated as the source for checklist comparison, machine translations, etc.



My question then, is this possible at all? How should I proceed with this issue?










share|improve this question



























    1














    I have my project localisations in .json files, here’s an english example:



    {
    "AreYouSure" : "Are you sure?",
    "DescriptionText" : "This is a very long description text, used to aid the user.",
    }


    As shown in the example my source strings are merely IDs and not sentences on their own which gives me quite a few issues, for example:




    • I am getting a lot of errors due to source and translation not both ending with a stop / question / exclamation mark

    • Machine translation is not working as it is translating only the id

    • When translating I am seeing only source id which is not helpful when writing for additional languages. I can bypass this by selecting additional languages in user preferences but this will not work in zen mode.


    My ideal solution would be to define English as a base language by which English translations would be treated as the source for checklist comparison, machine translations, etc.



    My question then, is this possible at all? How should I proceed with this issue?










    share|improve this question

























      1












      1








      1







      I have my project localisations in .json files, here’s an english example:



      {
      "AreYouSure" : "Are you sure?",
      "DescriptionText" : "This is a very long description text, used to aid the user.",
      }


      As shown in the example my source strings are merely IDs and not sentences on their own which gives me quite a few issues, for example:




      • I am getting a lot of errors due to source and translation not both ending with a stop / question / exclamation mark

      • Machine translation is not working as it is translating only the id

      • When translating I am seeing only source id which is not helpful when writing for additional languages. I can bypass this by selecting additional languages in user preferences but this will not work in zen mode.


      My ideal solution would be to define English as a base language by which English translations would be treated as the source for checklist comparison, machine translations, etc.



      My question then, is this possible at all? How should I proceed with this issue?










      share|improve this question













      I have my project localisations in .json files, here’s an english example:



      {
      "AreYouSure" : "Are you sure?",
      "DescriptionText" : "This is a very long description text, used to aid the user.",
      }


      As shown in the example my source strings are merely IDs and not sentences on their own which gives me quite a few issues, for example:




      • I am getting a lot of errors due to source and translation not both ending with a stop / question / exclamation mark

      • Machine translation is not working as it is translating only the id

      • When translating I am seeing only source id which is not helpful when writing for additional languages. I can bypass this by selecting additional languages in user preferences but this will not work in zen mode.


      My ideal solution would be to define English as a base language by which English translations would be treated as the source for checklist comparison, machine translations, etc.



      My question then, is this possible at all? How should I proceed with this issue?







      weblate






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 '15 at 15:22









      Dusan SmolnikarDusan Smolnikar

      132




      132
























          3 Answers
          3






          active

          oldest

          votes


















          2














          Yes, it's possible and covered in the Weblate documentation:




          ... monolingual formats identify the string by ID and each language file contains only mapping of those to given language (typically Android string resources). Some file formats are used in both variants, see detailed description below.



          For correct use of monolingual files, Weblate requires access to file containing complete list of strings to translate with their source - this file is called "Monolingual base language file" within Weblate, though the naming might vary in your application.




          So just set English file as "Monolingual base language file" and you're done.






          share|improve this answer





















          • Indeed, this solved my issue, thank you.
            – Dusan Smolnikar
            Mar 26 '15 at 8:16





















          0














          For further reference, I achieved this by specifying “--base-file-template” when importing the project:



          ./manage.py import_project --base-file-template=en-GB/%s.json --file-format=json {project_name} {git_url} {git_branch} *-*/**.json





          share|improve this answer





























            0














            All our keys got changed to the English translation when using the "Monolingual base language file" option.



            Example:



            STRING001:"Hello World!" became "Hello World!":"Hello World!"



            And the "Base file template" does not do anything about those checks.



            We still have issues with checks because of the difference between key and source translation (English translation).



            Setup:



            en/file.csv (source)



            STRING001:"Hello world!"


            sv/file.csv



            STRING001:"Hej världen!"


            Warning:



            Trailing exclamation





            share|improve this answer























            • It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
              – Jonathan
              Nov 16 '18 at 14:20











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29184407%2fhow-to-use-weblate-with-source-strings-that-are-merely-ids%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Yes, it's possible and covered in the Weblate documentation:




            ... monolingual formats identify the string by ID and each language file contains only mapping of those to given language (typically Android string resources). Some file formats are used in both variants, see detailed description below.



            For correct use of monolingual files, Weblate requires access to file containing complete list of strings to translate with their source - this file is called "Monolingual base language file" within Weblate, though the naming might vary in your application.




            So just set English file as "Monolingual base language file" and you're done.






            share|improve this answer





















            • Indeed, this solved my issue, thank you.
              – Dusan Smolnikar
              Mar 26 '15 at 8:16


















            2














            Yes, it's possible and covered in the Weblate documentation:




            ... monolingual formats identify the string by ID and each language file contains only mapping of those to given language (typically Android string resources). Some file formats are used in both variants, see detailed description below.



            For correct use of monolingual files, Weblate requires access to file containing complete list of strings to translate with their source - this file is called "Monolingual base language file" within Weblate, though the naming might vary in your application.




            So just set English file as "Monolingual base language file" and you're done.






            share|improve this answer





















            • Indeed, this solved my issue, thank you.
              – Dusan Smolnikar
              Mar 26 '15 at 8:16
















            2












            2








            2






            Yes, it's possible and covered in the Weblate documentation:




            ... monolingual formats identify the string by ID and each language file contains only mapping of those to given language (typically Android string resources). Some file formats are used in both variants, see detailed description below.



            For correct use of monolingual files, Weblate requires access to file containing complete list of strings to translate with their source - this file is called "Monolingual base language file" within Weblate, though the naming might vary in your application.




            So just set English file as "Monolingual base language file" and you're done.






            share|improve this answer












            Yes, it's possible and covered in the Weblate documentation:




            ... monolingual formats identify the string by ID and each language file contains only mapping of those to given language (typically Android string resources). Some file formats are used in both variants, see detailed description below.



            For correct use of monolingual files, Weblate requires access to file containing complete list of strings to translate with their source - this file is called "Monolingual base language file" within Weblate, though the naming might vary in your application.




            So just set English file as "Monolingual base language file" and you're done.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 23 '15 at 7:33









            Michal ČihařMichal Čihař

            7,72923465




            7,72923465












            • Indeed, this solved my issue, thank you.
              – Dusan Smolnikar
              Mar 26 '15 at 8:16




















            • Indeed, this solved my issue, thank you.
              – Dusan Smolnikar
              Mar 26 '15 at 8:16


















            Indeed, this solved my issue, thank you.
            – Dusan Smolnikar
            Mar 26 '15 at 8:16






            Indeed, this solved my issue, thank you.
            – Dusan Smolnikar
            Mar 26 '15 at 8:16















            0














            For further reference, I achieved this by specifying “--base-file-template” when importing the project:



            ./manage.py import_project --base-file-template=en-GB/%s.json --file-format=json {project_name} {git_url} {git_branch} *-*/**.json





            share|improve this answer


























              0














              For further reference, I achieved this by specifying “--base-file-template” when importing the project:



              ./manage.py import_project --base-file-template=en-GB/%s.json --file-format=json {project_name} {git_url} {git_branch} *-*/**.json





              share|improve this answer
























                0












                0








                0






                For further reference, I achieved this by specifying “--base-file-template” when importing the project:



                ./manage.py import_project --base-file-template=en-GB/%s.json --file-format=json {project_name} {git_url} {git_branch} *-*/**.json





                share|improve this answer












                For further reference, I achieved this by specifying “--base-file-template” when importing the project:



                ./manage.py import_project --base-file-template=en-GB/%s.json --file-format=json {project_name} {git_url} {git_branch} *-*/**.json






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 26 '15 at 8:19









                Dusan SmolnikarDusan Smolnikar

                132




                132























                    0














                    All our keys got changed to the English translation when using the "Monolingual base language file" option.



                    Example:



                    STRING001:"Hello World!" became "Hello World!":"Hello World!"



                    And the "Base file template" does not do anything about those checks.



                    We still have issues with checks because of the difference between key and source translation (English translation).



                    Setup:



                    en/file.csv (source)



                    STRING001:"Hello world!"


                    sv/file.csv



                    STRING001:"Hej världen!"


                    Warning:



                    Trailing exclamation





                    share|improve this answer























                    • It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                      – Jonathan
                      Nov 16 '18 at 14:20
















                    0














                    All our keys got changed to the English translation when using the "Monolingual base language file" option.



                    Example:



                    STRING001:"Hello World!" became "Hello World!":"Hello World!"



                    And the "Base file template" does not do anything about those checks.



                    We still have issues with checks because of the difference between key and source translation (English translation).



                    Setup:



                    en/file.csv (source)



                    STRING001:"Hello world!"


                    sv/file.csv



                    STRING001:"Hej världen!"


                    Warning:



                    Trailing exclamation





                    share|improve this answer























                    • It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                      – Jonathan
                      Nov 16 '18 at 14:20














                    0












                    0








                    0






                    All our keys got changed to the English translation when using the "Monolingual base language file" option.



                    Example:



                    STRING001:"Hello World!" became "Hello World!":"Hello World!"



                    And the "Base file template" does not do anything about those checks.



                    We still have issues with checks because of the difference between key and source translation (English translation).



                    Setup:



                    en/file.csv (source)



                    STRING001:"Hello world!"


                    sv/file.csv



                    STRING001:"Hej världen!"


                    Warning:



                    Trailing exclamation





                    share|improve this answer














                    All our keys got changed to the English translation when using the "Monolingual base language file" option.



                    Example:



                    STRING001:"Hello World!" became "Hello World!":"Hello World!"



                    And the "Base file template" does not do anything about those checks.



                    We still have issues with checks because of the difference between key and source translation (English translation).



                    Setup:



                    en/file.csv (source)



                    STRING001:"Hello world!"


                    sv/file.csv



                    STRING001:"Hej världen!"


                    Warning:



                    Trailing exclamation






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 13 '18 at 7:53









                    Armali

                    6,98093699




                    6,98093699










                    answered Nov 13 '18 at 7:34









                    JonathanJonathan

                    486




                    486












                    • It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                      – Jonathan
                      Nov 16 '18 at 14:20


















                    • It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                      – Jonathan
                      Nov 16 '18 at 14:20
















                    It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                    – Jonathan
                    Nov 16 '18 at 14:20




                    It worked better to use the "Monolingual base language file" and uncheck the option "Edit base file" just below.
                    – Jonathan
                    Nov 16 '18 at 14:20


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29184407%2fhow-to-use-weblate-with-source-strings-that-are-merely-ids%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Xamarin.iOS Cant Deploy on Iphone

                    Glorious Revolution

                    Dulmage-Mendelsohn matrix decomposition in Python