Different Languages (Idiom)...

Hello EveryOne. I’m working in my first project.
I want to know there is a way the final user can change the language of the application.

I mean a way they can change for example the label in a OK button. If the user choose in the settings Spanish the button says ACEPTAR instead of OK. The option the final user can change the CAPTION on the differents buttons and labels.


My approach to this issue is to maintain all the strings in a database. Each screen element is assigned a text number. My database contains a table with each text in two or more languages. The typical key is text number and language. At login, the user selects the language. The texts for this language are loaded in a session (for web) or global array. Each “shown” event of each window has a routine to assign the proper text to each control, based on the text number for that control.

I also control form texts the same way so that outputs are in the language either of the logged-on user, or the intended target. I maintain a preferred language in the custoimer master file, the vendor master file, and so on. This approach is a bit heavy to put in place at first, but it is extremely flexible. In my opinion, it beats any localization feature I found in any development environment so far.

Hope this helps.


If you use the dynamic constants feature to localize your app, you can include multiple languages within a single app. Your app will then present the language of the user’s system if you provide one. Otherwise, it will display the default language. See book 4 (Development) of the User’s Guide, section 5: Localization.

Indeed, dynamic constants are an excellent feature.

Am I correct thinking that dynamic constants are not available with WebApps? I have also encountered many cases of users preferring the US English keyboard on a Canadian French Windows install. Go figure… There are cases where it is very difficult to determine automatically what the preferred language of the user is. That said, perhaps I need to experiment further with dynamic constants.

Here we are with 2 very workable approaches. On a desktop app, with well a defined target audience, I would probably select dynamic constants. If I expect that my app may be translated in many different languages, and if my app is intended for the web, I still prefer the database approach. It is in my opinion much easier to provide expert translators with database views than it is opening the code with each tweak to the translation.

My 2 cents.


Actually, they are.

WE apps will display the language of the server that runs the app. Not the users language who visits the app.
I’m not 100% on that but that’s how I think it would work wil WE apps :slight_smile:

Edit: WE apps with dynamic constants…[/quote]

Starting with 2012r2, if you use Dynamic Contants, your web applications ARE localizable. The language is taken from the browser.

If for some reason you want to deliver pages in a different language, you can always change Session.LanguageCode to something else (which is also great for testing).

In my case it won’t be a web application.

In that case, you can still use Dynamic Constants. The difference is that the language that is set in the operating system is the one that is displayed.

I’m trying to localize a Web App on Xojo 2013 R1, but It returns an error:

I create the dynamic constant kLangAccess, and I set on a WebPage the property Text of a Label to #LocalizedStrings.kLangAccess, then when I execute de app it returns an error: “This element doesn’t exists MyWebPage”.

If I delete de # symbol the app doesn’t return error, but the label shows “LocalizedString.kLangAccess”.

Is this a bug or am I doing it wrong?

Thanks for your help.