Batch processing & i18n

I have a database serving many different clients, each one of them with their own locale, potentially localized for languages other than English. I’m storing each client’s language preference in the database.

I’m in the process of creating a batch processing procedure which will need to find an i18n key in each particular client’s preferred language. Is this possible now? If not, can Servoy be enhanced with that capability?

Hi Morley,

Servoy Editor has a i18n node with loads of functions to get and set the locale settings and (only) get the i18n messages.
Ofcourse you do need to know the keys to do that.

On the other hand the i18n data is stored in a messages table so you can just place a form on top of that and start typing.

Hope this helps.

ROCLASI:
Servoy Editor has a i18n node with loads of functions to get and set the locale settings and (only) get the i18n messages.
Ofcourse you do need to know the keys to do that.

I saw that. And yes, I can easily get the current locale language and store it into a client preference field for future reference. However I don’t see how I can get the get the Spanish or French or German terminology for the “Active” key and place that into a variable for further work.

Remember, I’m doing this in a Batch Processing solution, something that is going to run once daily across all clients. That Batch Processing solution will be finding all records that meet certain criteria and setting a text field to “Active”, but in that client’s preferred language.

Currently I see no way to specify which locale language when getting the text of a key. It would appear the current structure assumes always to supply the locale of the current user of Servoy.

Hi Morley,

If I understand you correctly you don’t want to know i18n message keys but you want to know locale codes since your batchprocessor will paste a literal string into some field based on this locale code.

I did a quick google search and found this small list.

http://www.mozilla.org/docs/l10n/l10nki … ocodes.htm

Keep in mind that locale codes can have a language AND country code.

Hope this helps.

Sorry Robert, I’m not being clear enough. I’ve built a separate solution from the main one for batch processing, utilizing the new protocol. This special solution will launch automatically once a day through the headless client and proceed to run some housekeeping routines. To facilitate batch processing I’ve already fetched and stored the preferred language of each client in a Client Control table.

Thus, no matter what record, what table I can know the unique language code for the owner of that record. Therefore if I’m automatically resetting a text field for that record to read “Active” or “Inactive”, I should be able to fetch the appropriate translation for that client.

As far as I can make out, a conditional property is not part of the current makeup of getting a particular key. Servoy appears to always assume the key to get is that of the current locale. But when batch processing all records for all clients, this assumption doesn’t apply.

Thanks for getting me to clarify myself. Anyone from Servoy have a comment on this?

Hi Morley,

I slowly see what you are trying to do here.
Why not use a integer column. 0 is inactive, 1 is active.
Then create a valuelist that you fill by a method with 2 i18n keys for inactive (0) and active (1).
Now you only have to define the values for these keys like you do for any i18n key. Assign this valuelist to the field and it will show it in the correct language for the user.

This way your batchprocessor only have to set 1 or 0 and doesn’t have to know what Locale a user has.

Hope this helps.

ROCLASI:
I slowly see what you are trying to do here.
Why not use a integer column. 0 is inactive, 1 is active.
Then create a valuelist that you fill by a method with 2 i18n keys for inactive (0) and active (1).
Now you only have to define the values for these keys like you do for any i18n key. Assign this valuelist to the field and it will show it in the correct language for the user.

This way your batchprocessor only have to set 1 or 0 and doesn’t have to know what Locale a user has.

Thanks, Robert.

You’ve triggered me into an even better way. The i18n data is in the Messages table. It’s a simple matter of forming a relationship between the language key in the Client’s Table and the same key in the Messages table to look up the appropriate message value for the required message key.

Excellent. Thanks for tumbling to the right solution.