Localisation

Dear Forum,

please help me out. I have to provide my app in - at least - three different languages:

  • English (which is also the default and build setting)
  • German
  • French

The goal is that the app uses english whenever the user chose a language different to German or French.
Unfortunately, it seems this “mechanism” does not work.

If I set the language to Danish, the last out of the three “built-in” languages is chosen - not english.

Any ideas?

Have you set the first language as English or as Default ?

The first language is German, the second one is English, the third one is French.
you can find the mini-project here: Sprachtest

If you want English to be default, don’t set it as “English”, set it as “Default”. It will show on all machines that are not set for German or French, including of course English ones.

If you do so, a Danish system will show English.

Hi Michel,

sorry - this is NOT how XOJO works. Setting the “English” values of the translation table to “default” doesn’t alter the false behavior.
When changing the system langue to Danish, still the last used language will be taken as app language. ;-(

Have you tried out my sample app?

By the way: thanks for your input :slight_smile:

[quote=271844:@Heinz-Jürgen Groß]Hi Michel,

sorry - this is NOT how XOJO works. Setting the “English” values of the translation table to “default” doesn’t alter the false behavior.
When changing the system langue to Danish, still the last used language will be taken as app language. ;-(

Have you tried out my sample app?

By the way: thanks for your input :-)[/quote]

Well, I don’t know what is happening with your test app. I have changed English to Default, and on my English system, it still insists on picking up French.

My latest app, Fonts Manager, is localized in English as default French and Spanish by name (over 60 constants). It picks English when not French or Spanish. And has been on the MAS for a couple month in all three languages, and nobody reported bizarre display.

I created a brand new project where I set for a dynamic constant named “Test” Default as “English”, French as “Français” and German as “Deutsch”. It shows English on my system, not French.

What happens if you set your system language to Danish?
And - again: have you tried out my sample app?

It’s as tiny as maybe 5 lines of code…

[quote=271856:@Heinz-Jürgen Groß]What happens if you set your system language to Danish?
And - again: have you tried out my sample app?

It’s as tiny as maybe 5 lines of code…[/quote]

Heinz, I did try your project, and confirm it does not behave correctly in other languages than German and French. I modified your constants to make English default, but yet, the problem persists. It even does not show English on my English system, more than it does on a Danish system. I have absolutely no idea why.

Repeat : I created a brand new project where I set for a dynamic constant named “Test” Default as “English”, French as “Français” and German as “Deutsch”. It shows English on my system, not French.

May I recommend you start a new project, and this time, affect English sentences to “Default”.

I use dynamic constants all the time in Desktop as well as Web, and it has always worked for me that way.

If I run your project on an Italian system (that’s equal to your Danish test) I see the english translation, since you set the default language to English Uk and I have English as second language in my system

If I change your english translation to some other language and set the default to another language I got your default text.

The translation system works by looking in order for your system languages if none match it will use the default one, if the default one is in your list then it will use the default labeled translation (if exists) otherwise the defined translation that’s the one you see when you create your app
The default language on build setting is only to define what you will see in the IDE as translation (you should use #Localize.UserLanguage instead of OK for you button in order to see how it works)

Hello Michel,

Unfortunately, this doesn’t solve my problem.

I’m currently using XOJO 2015 r2.4.
As I found out meanwhile, until XOJO 2015 r2.1 the behaviour was as following:

If the user’s preferred language is one of those provided with the app, this language is chosen,
otherwise the app will use the content of the “default value” of the individual dynamic constants.

So if I provide English, German and French, but the user had chosen Japanese as his standard language,
the app will start in English, as all defaults had been translated to English.

With 2015 r2.4 the app behaves like Antonio described.
If the user’s language is not provided by the app, than the first matching language from the preferences list is used.

That make the default values useless.
For me, that’s a bug.

Well, the bug is no longer here in 2016R1.1.

Maybe you can pick the language yourself in the app ?

See http://blog.xojo.com/2014/03/05/picking_a_language_at_runtime/

Also, you probably need to detect which language the system is in :
http://forums.realsoftware.com/viewtopic.php?f=1&t=46949

Thats actually how it is supposed to work
This means that the USER is in charge of what language an application shows rather than the application

I want to localize a project of us.
English should be the default language and german should be a translation.
So on systems with language german (does this also work for e.g. Austria and Swiss???) the translation should be used and every other language (french, italian and so on) should use english.

If I create a constant for a label then I would use it like this:

My problem is that now the whole app is in german.
So english should be translated via Lingua but the Default Value of a constant can’t be changed in Lingua.

Am I doing something wrong - is there a better practise?

Are-you using the German Xojo IDE ?

Does a german Xojo IDE even exist?
We use an english IDE.

the xojo ide is in english only for quite some versions now.

This could be of interest : https://forum.xojo.com/21389-mac-app-store-missing-language/0

So this is the best practice?

  • always explicitly set the language that a project is built in (see Build Settings > Language)
  • always put in values for each localization in the listing for each localized constant

This means in my case that I should set the language of the project to german and put in values in the constants for german and english (also default value in german) like this?

But wouldn’t this mean that someone with language e.g. french gets the german version instead of the english one?

Yes, it seems so.

I get German File / Edit menu names (also Hilfe I think), and the user ran a German IDE (version unknow).

I cannot comment more because… the last time I localized an application of mine it was pre-Xojo (I think).

FWIW: I downloaded Heinz-Jürgen Groß mini project (go to near the top and download it), load it, fire it and…

I get the French window title (on my French El Capitan). The File and Edit Menus are… in English while the Edit MenuItems are in English excepted for the Cancel entry (Annuler).