translation.cpp and lexer

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Tecnoworld
In need of some credit
In need of some credit
Posts: 8
Joined: Fri Jun 24, 2016 11:21 am

translation.cpp and lexer

Post by Tecnoworld » Sat Jan 25, 2020 3:35 pm

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:

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4227
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: translation.cpp and lexer

Post by ONEEYEMAN » Tue Jan 28, 2020 10:21 pm

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.

Tecnoworld
In need of some credit
In need of some credit
Posts: 8
Joined: Fri Jun 24, 2016 11:21 am

Re: translation.cpp and lexer

Post by Tecnoworld » Wed Jan 29, 2020 3:37 pm

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.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4227
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: translation.cpp and lexer

Post by ONEEYEMAN » Wed Jan 29, 2020 4:59 pm

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.

Post Reply