Build Settings | Shared | Language ??

In Build Settings | Shared we can find on the right hand side some sections with properties: Version, Build, Debug.
In Build there is a property called “Language”

What language is this? I’ve tried with several different languages and I can’t see any difference in the produced application.
First I thought it was the language used by the OS to show some windows (Open a Folder, for example), but its is not.
So I have no idea what it means and I found nothing in the Help.
Could any one enlighten me? Thanks.

In Build Settings | Shared we can find on the right hand side some sections with properties: Version, Build, Debug.
In Build there is a property called “Language”

https://home.mycloud.com/action/share/d505517a-c85e-4666-867f-83a5cc4002b6

What language is this? I’ve tried with several different languages and I can’t see any difference in the produced application.
First I thought it was the language used by the OS to show some windows (Open a Folder, for example), but its is not.
So I have no idea what it means and I found nothing in the Help.
Could any one enlighten me? Thanks.

I found this topic .
If I open the Info.plist I can see that this change :

<key>CFBundleDevelopmentRegion</key> <string>fr</string>
It is en if I set Language to English.

I have the same question as Ramon, does it affect something else ?

I was looking for something else and I found the answer on this page UserGuide Localization :

[quote]Building the Localized App
On the Shared Build Settings, there is a Language property in the Build section of the Inspector. This property determines the language that is used by any localized strings that have “Default” as the language.[/quote]

For the purpose to get the actual system language I use in my apps a constant without default value as localized string.

Each language needed becomes an entry i.e.

Platform = any, Language = German, Value = DE
Platform = any, Language = Englisch, Value = EN
Platform = any, Language = French, Value = FR
Platform = any, Language = Dutch, Value = NL

Important for the needed functionality is in XOJO editor the switch “Localized”: It must be on!

when you have a constant with multiple localized values and the localized setting is NOT enabled the specific value used is selected AT COMPILE TIME
this is true even for all types of constants where you can put multiple value

if you create a new desktop project and on Window1 add this constant

Constant notDynamic as String = "default"
   Platform = Any, Language = de, value = "DE"
   Platform = Any, Language = en, value  = "EN"
   Platform = Any, Language = fr, value  = "FR"
    Platform = Any, Language = it, value  = "IT"
End Constant

if you also add the open event to Window1 implemented as

		Sub Open()
		  MsgBox notDynamic
		  
		End Sub

IF you leave the Shared build setting as “default” you will see the msgbox display “default”
If you change this setting to French you will see FR
And so on for English, Dutch, and German
And it you pick a language that you have NO localized value for then you will see “default”
The value the constant has is selected at compile time in this case
In fact if you look in the app bundle on macOS you will find there is NO localized strings for any language
Again this is because that single constant value has been selected at compile time and localized string files are only required at runtime IF you have dynamic strings

If you now switch the notDynamic to be a localized string you will get different behaviour
macOS will select, at runtime, whatever language you app supports that is closest to the top of the users selected languages in System Preferences > Language and Region.
YOU, as the developer, do not dictate what language the users sees any longer. You provide proper localized strings and the user can then influence what language is used.
The only time you will see “default” is if the user has NONE of the languages your app supports in their list of languages.
At that point the last fall back is to selected the “default” language - the language your app was compiled under

IF in the Xojo build settings you had selected “default” then the language is whatever language your machine was running when you compiled it.
Again you can see this in your app’s plist by opening the built apps plist and looking in the value for CFBundleDevelopmentRegion

https://blog.xojo.com/2013/12/17/how-os-x-chooses-a-language/
https://blog.xojo.com/2014/03/05/picking-a-language-at-runtime/

Thank you Norman, for this extra insight.

I was just lately setting up some language Constants for the first time, but I was also setting the “Localized” setting to “On” for each entry (assuming I had to).

Because “Localized” was “On”, the “Build Settings > Shared > Language” choice didn’t seem to make a difference when I ran my app with my English language OS. But I did see that if I reboot into another language, e.g., French, then my app would display in French.

So I guess for the purpose of tweaking my Desktop app layout, to ensure I have enough room for some long worded translated phrases, e.g., German, Italian, etc., I should have my Constants “Localized” setting to “Off”, so I can more easily switch between translated text during development - so I don’t have to reboot my machine into another language for testing?

And then, when I’m ready for the “Final” build, either:

A.) - Turn all the “Localized” settings back to “On”, for a single distributed app?
B.) - Leave the “Localized” settings “Off” and do separate builds for each supported language?

Or am I over thinking this, or not understanding something?

Any advice would be appreciated.

Note: The one benefit I did see to the “Build Settings > Shared > Language” choice, was if I use the #App.MultiLanguagePhrase syntax for Constants in the IDE Text/Caption inputs for Label & Button controls, the text would display in the chosen language in the IDE design views. But that syntax didn’t seem to work for all controls.

Yeah
Windows, because of how it works, makes language testing much more tedious
If you just set everything OFF then change Build Settings > Shared > Language then your localized strings will be shown in whatever language (but any OS related stuff wont be obviously)
macOS makes this much simpler as you can work in the IDE in whatever language you started it in, swap the System preference and then run and see the effects. its very simple

or work on a mac where swapping languages to test is trivial and you dont have to change most anything :stuck_out_tongue:
that said, on windows you could do either and I’m not sure which is better for you or your customers
Option A means you can build once and its internationalized from the outset so you can ship that to anyone and it will work in whatever language they are using. Nice & simple. And if they switch languages your software will adapt.
Option B means each build runs in one language only and that may not be as useful. And it wont adapt if the user switches languages. And you;d have to ship the right language to them when they need it.

[quote=454100:@Scott Cadillac]
Note: The one benefit I did see to the “Build Settings > Shared > Language” choice, was if I use the #App.MultiLanguagePhrase syntax for Constants in the IDE Text/Caption inputs for Label & Button controls, the text would display in the chosen language in the IDE design views. But that syntax didn’t seem to work for all controls.[/quote]
It should and if youre experiencing issues that could be a bug
Specific examples would make it clearer if it is a bug or not

Cool! When I changed languages before on macOS, I just went ahead and restarted. I didn’t realize I didn’t need to necessarily. So even with “Localized” set to “On”, the app appears in that alternate language. That is much easier. Thanks!

[quote=454102:@Norman Palardy]It should and if youre experiencing issues that could be a bug
Specific examples would make it clearer if it is a bug or not[/quote]
It was the Segmented Control and Toolbar is where I noticed the # syntax not working for localized Constants. I’ll poke around and see if I find any others, then I’ll submit a demo app to Feedback.

Thanks again!

[quote=454110:@Scott Cadillac]Cool! When I changed languages before on macOS, I just went ahead and restarted. I didn’t realize I didn’t need to necessarily. So even with “Localized” set to “On”, the app appears in that alternate language. That is much easier. Thanks!
[/quote]
quit the debug app
switch languages in the system prefs
run the debug app again

ah yeah is those arent working that would seem to be a bug as far as I can tell

<https://xojo.com/issue/57418>

The problem appears to be similar to <https://xojo.com/issue/1919>, but apparently that was resolved a long time ago.

ah yeah in the IDE I can believe there might be spots where its not picking up the right string value