Multilingual application (without locales or internationalisation)

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Fri Feb 07, 2020 3:42 pm Just remember that "de_DE" will contain German German translations and "de_SWITZERLAND" (sorry don't know the country code on top of my head) will contain German Swiss translations.

How will you program will differentiate between them?

The German-speaking Swiss will make do with "de". There won't be sub-translations. Same goes for the Brazilians with their Portuguese.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
And Mexican with Spanis?

Did you consider the language differences?

One word can have a different meaning in different dialects...

Thank you.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Fri Feb 07, 2020 4:16 pm Hi,
And Mexican with Spanis?

Did you consider the language differences?

One word can have a different meaning in different dialects...

Thank you.
There is no limit to how far you can go with that. People who live on one street in a housing estate might use different words to people who live across the road in a bungalow.

The Mexicans will make do with es.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
Well, that's goiong to be one very weird application. At least for me.

Thank you.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Fri Feb 07, 2020 4:55 pm Well, that's goiong to be one very weird application. At least for me..
Do you speak Mexican Spanish?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
No. But my daughter most likely does. As well as Spanish from Spain.
And so I know that there are some differences in the language.

But me - I'm tri-lingual. Russian, Ukrainian and English. So I know what I'm talking about.
There a lot of omonims in different languages that is written and sounded the same but has different meaning in different languages/dialects.

Also, I think Brazilian Portuguese is a language itself. It is not Portuguese at all.
At least that's what I gather talking to different people.

And don't let me start on different Chinese dialects. Those are completely different beasts.

So if I were you, I'd rely on the locale selection making sure that I have all of them for user selection in the combo menu and then get the translations right from the native language speakers.

I would also think twice before presenting the numbers to a different people. Because "4,096", "4096" and "4.096" are the same for programmers but different for different locales. And therefore different people will interpret it differently.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Multilingual application (without locales or internationalisation)

Post by PB »

The language discussion aside...

I still do not get why you wish to abandon the true and tried way of storing translations catalogues, i.e., in the expected folder with folders for individual languages (btw, the domain is not a language). It works as expected out of the box and can be used without wxLocale.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

PB wrote: Fri Feb 07, 2020 7:15 pm The language discussion aside...

I still do not get why you wish to abandon the true and tried way of storing translations catalogues, i.e., in the expected folder with folders for individual languages (btw, the domain is not a language). It works as expected out of the box and can be used without wxLocale.
I'll be doing away with separate MO files and embedding the catalogues in the executable file. Not sure if I'll put them in as resources or if I'll do hex values in char arrays.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
So basically you want to save a couple of micro-seconds on loading the files from disk.
Good luck on that.

Personally I don't think it is worth it, but YMMV.

Thank you.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Fri Feb 07, 2020 8:55 pm Hi,
So basically you want to save a couple of micro-seconds on loading the files from disk.
Good luck on that.

Personally I don't think it is worth it, but YMMV.

Thank you.
I will distribute my application as one executable file that does not need to be installed
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Fri Feb 07, 2020 8:55 pm So basically you want to save a couple of micro-seconds on loading the files from disk.
I don't know what you meant by this.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
Instead of loading translation file from the disk you want to link it in the binary and grab the translation from memory.

Nevertheless, the scenario you are trying to implement seems like you are reinventing the wheel.
But that's of course is your program.

Thank you.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Sun Feb 09, 2020 11:27 pm Instead of loading translation file from the disk you want to link it in the binary and grab the translation from memory.
And how did it get into memory?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Multilingual application (without locales or internationalisation)

Post by ONEEYEMAN »

Hi,
I'll be doing away with separate MO files and embedding the catalogues in the executable file. Not sure if I'll put them in as resources or if I'll do hex values in char arrays.
I interpret it as: "I will put the translation files inside my executable".

Do ou have different interpretation?

Thank you.
Virchanza
I live to help wx-kind
I live to help wx-kind
Posts: 172
Joined: Sun Jul 19, 2009 6:12 am

Re: Multilingual application (without locales or internationalisation)

Post by Virchanza »

ONEEYEMAN wrote: Mon Feb 10, 2020 3:36 pm
I interpret it as: "I will put the translation files inside my executable".

Do ou have different interpretation?
The point I was trying to make is that the translation files need to be loaded from disk into RAM at some point. I won't save microseconds anywhere.

If you wanted to shave those microseconds off then I think you'd have to go down the road of "mmap". See here:

https://en.wikipedia.org/wiki/Mmap
Post Reply