i18n issues

I’m using Beta 3.3 on Windows XP Pro, and I’m trying to make some sense of the I18N docs.

The manual says:

A Servoy i18n language key (record) in the messages table stores:
??? The name of the language key.
??? The default language Reference text
(based on the locale selected in the Locale preferences).
For more information, see Preferences: Locale (page 533).
??? The Locale text for each additional language
(you wish to support in your solution).

My Locale is set to English, and what is shown in the Default column is in English. What is shown in the locale (english) column is nothing. There are no values for this locale.

For example:

key default locale(English)

servoy.aboutDialog.title About

If I change my locale to francais and restart Servoy I see

key default locale(francais)

servoy.aboutDialog.title About

So what is going on here?
Clearly the default values are in English. But why are there no values in the English column, and why then, if I change my locale to English, do I still see values in menus and on buttons?

If I add a new key clearly I need to specify its default value in English but should I not also add the same string under the locale(English) column too?

This is confusing and appears to contradict what the documentation says.

thanks,

Terry

To make a long story short: the reference value is used if no local version is available.

Is there a quick way to transfer all those default values to the English column? And would all those keys then show up on a form using the ‘messages’ table? That would be really swell in a scenario where I want to dynamically reference those keys, which would almost be the equivalent of switching locales on the fly… :roll:

TIA,

Ben

Hi Ben,

When you want to move stuff around in the messages table, that table si what it is: only one table so it is quite easy to build a little solution for that.

There is just something I don’t get: if I create a form that points to the messages table, the default values do not show up, only if I enter values for one of the specified locales. So how do I get those default values, to put them in other records with the English locale?

TIA,

Ben

Are you talking ‘default value’ when you say default or default keys of Servoy?

I know think of one hurdle though.

The reason you might not see anything is because there is a row/record created for every language. A default value is also a language. Not so simple after all maybe…

That’s exactly what I mean - and those values have to be somewhere, because we can see them in the i18n interface…

Hi Ben,

The default language has no value in the message_language column.
By the way maybe you might find an open source solution I made a while ago handy.

See http://www.servoyforge.net/index.lasso?go=polyglot

Hope this helps.

Thanks for the link Robert - your solution looks promising in a situation where I would like to rollout my application in a completely different language. I’ll keep it it my left pocket. :wink:

However, I would like to get this straight: When I open up the i18n editor, I can see, among other things, a portal that has 3 columns: the i18n key, the default value, and a third column for my chosen locale. Now, maybe it’s just me, but I can’t help but think that those default values have to be stored somewhere in relation to said keys, or else they wouldn’t show up. :? All I really want to do is take those default values and put them in the English locale column. I’m wondering if this is at all possible at this point… :cry:

Maybe I’ll have to resort to a keyboard macro thingy to copy those values over without getting carpal tunnel syndrome - unless there is an easier and better way to achieve this… :?:

Sorry for not letting go of this issue, but I would really like to give my users the ability to change languages on the fly (using a global field in a prefs table and a relationship to the i18n table). Since Servoy uses the i18n messages table for a lot of system and user messages, I feel I must work from within the already established structure to get the results I’m looking for.

TIA,

Ben

HI Ben,

just build a form on the i18n table, with all the columns.
make a global relation, at the left side a global(text) and the left-side to the language column

if you put, for example, nl in the global, only the dutch translation will show up through that relation.

If you do that, you will see how it works.

btw: changing the language-key on the fly, will mostly need a restart of the application

Thanks Harjo, but I now realize that, to achieve what I want to accomplish, it’s not enough to just link to the correct i18n column. I would have to fill in (using a onDataChange method on the LANG global) about a thousand other globals to accomodate the i18n keys, according to the user’s language of choice, and then use those to display form labels. And even then, the solution wouldn’t be perfect, because the system messages would still appear in the locale set at application start… :(

Unless there’s something obvious I’m missing here, it seems that what I’m looking for is a new (or at least enhanced) feature, and I will request it through the right channels.

Sincerely,

Ben