Unsolved Linguist - adding words manually.
-
Hi,
How can I add manually words with translation into my .ts files?
Not all the words locate in my code, and using update linguist is not enough.
I need to add them staticlly. Anyway for doing that?I have parsing mechanism from external files (which are a json files) on my code with content of words that will appear on my screen and I need translation for them.
Please advice,
Best regards,
IL -
@IL said in Linguist - adding words manually.:
I have parsing mechanism from external files (which are a json files) on my code with content of words that will appear on my screen and I need translation for them.
Could you please give a more concise example of this use case? A screenshot would be great. Would your JSON file have both the word and translation for a particular language?
-
Hi,
The json file have only the original words which in my case is English, those words do not appear in the code, but I do need translation for them.
I hope that this explain will clear my problem.Ilan
-
Hi,
Where are you getting these JSON file from ?
-
@SGaist Hi,
The .json files are written by me, the purpose is be able to change screens without compilation, but this is not the point.
Linguist give you the option to add translation only to text that locate in the code, I need option to add translation to text that will be generate during run-time.
Can I add translation to a pre-known words into .ts files?IL
-
Well yes it is, you seem to want dynamic text translation while having all possible translations statically built in your application.
How are these texts going to be handled by your application ?
-
@SGaist hi,
These texts will be load to the code and will be display on demand.
Each time that the user ask specific screen, the relevant text will appear.IL
-
Then why not provide your JSON in all required languages and use the appropriate one based on the language selection of your user ?
-
@SGaist I will do that or somthing similar if I don't have any other choice.
Do I have a choice?
Do I have the option to add translation for text that is out of the code?IL
-
You could use ID based translation rather that text.
Another idea would be to have a source file using QT_TRID_NOOP but that you don't compile as part of your application.