Page 1 of 1

translation.cpp and lexer

Posted: Sat Jan 25, 2020 3:35 pm
by Tecnoworld
Hello,

I have a smal problem in relation with the translation. The path order expected is (one of them)
share/Appname/lang/de_DE/appname.mo

Ok - this is the "normal" system of the locale in Linuxsystems and since a couple of years also in Windows.
But I like for my own applications the system like:
share/Appname/lang/english.mo

Why? The usage of the same filename for different content is very strange. So send this files for the translatione/interpretations its difficult, a lot of mistakes can happens...

So, I changed the translations.cpp to support my needs.
How can I put this changes in the normal release? Or it´s not recommended?

Also I wrote a Lexer for GCode. Could we implement in the actual branch? Its, since 5 years I must always change the new branches localy :roll:

Re: translation.cpp and lexer

Posted: Tue Jan 28, 2020 10:21 pm
by ONEEYEMAN
Hi,
1. About translation.
If I understand correctly, the path share/Appname/lang/de_DE/appname.mo is for the German german translation.
Now, if you have Austrian, Switzerland or any other places that speks german you need to specify a proper locale in the directory.
You will not have such beauty with you directory structure.

That is my understanding and I might be just wrong.

2. About the lexer.
The current wxWidgets release allows you to add the lexer that is custom one.
Please check the documentation and the stc sample.

Thank you.

Re: translation.cpp and lexer

Posted: Wed Jan 29, 2020 3:37 pm
by Tecnoworld
Ok, I understand the system of the locale.
But this automatism I don´t like and can´t use.
In example, I live in Spain, I´m german, but a couple of programs I like to have in english, some in german, and other ones in spanish.
I.e. the software we provide is for numeric control. I will, that the user can change the language on runtime, because some workers are russians, some germans and so on.

So, with the locale I can not work :-)

The other thing is, that we allow to our clients to provide own translation files (.mo) and for reasons of sharing this files it´s better, that the .mo file has a uinique name. For this reason we provide the complete path/name to the .mo files.

Re: translation.cpp and lexer

Posted: Wed Jan 29, 2020 4:59 pm
by ONEEYEMAN
Hi,
So how do you manage the language difference between German/german and German/Swiss?
Or Spanish/Spain or Spanish/Mexican?

Also, did you look in the internat sample? It has a way of switching language on the fly...

Now naming the translation files is completely different issue.
Your clients are better submit those files to you and you incorporate them in your software.

Otherwise - how is your software knows what translation file to pick for that specific language/company?

Thank you.