Locale, Multi language, revisited

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
pniehaus
Posts: 29
Joined: Fri Jun 24, 2011 2:36 pm
Location: Netherlands
Contact:

Locale, Multi language, revisited

Post by pniehaus »

Below is a simple use case to explain a complex problem.

Consider a BS which is deployed in an international company operating globally.

User Story: Customer Orders are entered in Spain, checked in France, fulfilled in Germany, and delivered by the Dutch logistics department.

The following BO exist.

Code: Select all

Product
- Product Name
- Product Size
- Product Stock Balance

OrderHeader
- Order Number 
- Customer Number

OrderDetail
- OrderHeader
- Product 
The Product name is to be shown to the local user in the user's own language.
  • At order entry: Spanish user selects from a list of products in Spanish.
    At order check: French user reads the order details and sees the product names in French. Not only that, s/he changes one order line to a different product because the ordered product was superseded by a new product. S/he chooses the new product from a list of products in French.
    At order fulfilment: German user reads the German names of products to be picked.
    At order delivery: Dutch truck driver checks the Dutch delivery note against the items to be delivered.
Solutions that were considered:
  • A. A locale attribute in the Product BO.
    B. ProductNameLocale BO containing an instance for each Product/Locale combination.
    C. Product.Name column each for the supported locales. Eg NameSpanish, NameGerman, NameFrench, NameDutch etc.
Solution A works only during selection and input of an OrderDetail instance. All other users will see the product name in the original selected entry. Besides which, the Stock Balance is now duplicated across all localised instances of a single produce.

Solution B could work the same way as solution A if one can use a presentation of some kind to show the product.productnamelocale.name somehow. (something like a shortcut that can contain a query matching the user.locale with the instance). The rest of the user story fails however.

Solution C does not work firstly because one cannot return a particular column(attribute) based on a WHERE clause in a query.

Has anyone else had to deal with this problem?

It seems to me that a great feature would be to have a new attribute type: LocaleArray which would allow entering the values for each locale and which will present the appropriate value depending on the user locale.
Version 5.9
AwareIM Server \ <-- Win7 Configtool
Ubuntu 14.04, MySQL
pniehaus
Posts: 29
Joined: Fri Jun 24, 2011 2:36 pm
Location: Netherlands
Contact:

Post by pniehaus »

In the meantime I have tried Solution D (variation on B):
Product Name is Calculated and a rule loads the correct Product Name from the ProductNameLocale BO.
The rule does however not execute at a Read/Query action. Therefore the Name does not get dynamically loaded....

Anything else I can try?
Version 5.9
AwareIM Server \ <-- Win7 Configtool
Ubuntu 14.04, MySQL
aware_support
Posts: 7536
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

There is an attribute "Locale" in all objects of the SystemUser group. You can set the value of this attribute by rules. This is essentially equivalent to your "LocaleArray" suggestion
Aware IM Support Team
pniehaus
Posts: 29
Joined: Fri Jun 24, 2011 2:36 pm
Location: Netherlands
Contact:

Post by pniehaus »

From what I can gather I only get the Locale attribute by having the Product BO in the SystemUser group. I am not sure if that is enough.

A Locale attribute is not the problem. A dynamic translation of the value of an attribute eg. a product.name is the problem.

Consider:
1. User enters a new product including the English, Spanish, French, German, Dutch translations of the product name.
2. Subsequent users are presented (in forms, grids, queries, etc) with the value of the attribute "Product Name" in the subsequent user's chosen locale.
Version 5.9
AwareIM Server \ <-- Win7 Configtool
Ubuntu 14.04, MySQL
aware_support
Posts: 7536
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Solution C should work if you add protection rules that will hide attributes in an inappropriate locale.

Protection rules will take care of most queries as well if you display all locale attributes in your queries (the inappropriate ones will be hidden and the proper one displayed).

The only issue is search by the product name attribute if your app allows such search. You will need to create a sophisticated query to cater for this - it will search by one attribute if current locale is English, by another attribute if it is Spanish etc. Can be done, though, especially if you use stored procedures for this.
Aware IM Support Team
pniehaus
Posts: 29
Joined: Fri Jun 24, 2011 2:36 pm
Location: Netherlands
Contact:

Post by pniehaus »

The problem with using protection is that I will have to create a role (Access Level) for each actual role/locale combination. If I have 10 roles and 27 languages, it means 270 roles! The management overhead on that will be too high!.
The development overhead with creating presentations is doable, but not really budgeted for.

Locale support with dynamic/variable master data, such as product names, product categories, country names, dynamic status descriptions etc etc is essential for an international software application.

The selection of a related BO from a master BO is not a problem here. Selection can be filtered based on the LoggedInSystemUser.Locale.
The subsequent presentation of the value using the right locale is the problem.

It can probably all be done by building custom forms and presentations for each affected BO. (Thats not really the idea when using a time saving tool like AwareIM)

It seems to me that a LocaleArray datatype is the only real solution for this problem.
Version 5.9
AwareIM Server \ <-- Win7 Configtool
Ubuntu 14.04, MySQL
aware_support
Posts: 7536
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Why do you need roles?

Protection rules could be:

If LoggedInSystemUser.Locale = 'Spanish' Then
READ PROTECT Product.NameEnglish FROM ALL EXCEPT System
READ PROTECT Product.NameFrench FROM ALL EXCEPT System
...
If LoggedInSystemUser.Locale = 'English' Then
READ PROTECT Product.NameSpanish FROM ALL EXCEPT System
READ PROTECT Product.NameFrench FROM ALL EXCEPT System
...
Aware IM Support Team
pniehaus
Posts: 29
Joined: Fri Jun 24, 2011 2:36 pm
Location: Netherlands
Contact:

Post by pniehaus »

Thanks support, I have finally managed to get back to this challenge. The rules as listed is a good work around (until one day when LocaleArray becomes available :)

It also works when searching and querying by allowing searching in any of the supported languages.

It does however create a maintenance overhead when adding another language, and when multiple BO's have the same functionality.
This is alleviated a bit by adding these BO's to a BO Group and maintaining the rules there. It does mean being very careful when propagating changes in a BO across the BOGs.
Version 5.9
AwareIM Server \ <-- Win7 Configtool
Ubuntu 14.04, MySQL
Post Reply