I have a commercial application hosted for multiple companies / industries.
I want to be able to define the following:
-System wide Default Language for all labels (ie English)
-Select another system wide language - eg German. Falls back to system wide English if any label is not defined in German
-Select an Industry - Should be able to change some labels specific to an industry for any language and display industry specific labels in German. Falls back to English version for the industry if not defined in German and then falls back to default English if not defined for the industry.
In a Multi-Tenant environment, Select a specific Company (organisation) - since we are multi- Company, each company might want to define their own text for a label for a selected language. If company specific text not defined, then falls back to industry / language / English as before
Each department within the company (company specific) might want a specific label. Display if defined in selected language then fall back to company label if not defined then follow Company rules.
proware:
-System wide Default Language for all labels (ie English)
-Select another system wide language - eg German. Falls back to system wide English if any label is not defined in German
This is default behaviour, so no problem at all.
proware:
-Select an Industry - Should be able to change some labels specific to an industry for any language and display industry specific labels in German. Falls back to English version for the industry if not defined in German and then falls back to default English if not defined for the industry.
In a Multi-Tenant environment, Select a specific Company (organisation) - since we are multi- Company, each company might want to define their own text for a label for a selected language. If company specific text not defined, then falls back to industry / language / English as before
Each department within the company (company specific) might want a specific label. Display if defined in selected language then fall back to company label if not defined then follow Company rules.
All 3 businessrules are ‘more of the same’. This can be done, just create a table which holds the name of the i18n key, language & value + other fields you might need to select 1 of the above records. UI will have to be designed yourself and will depend on how easy you want things to be.
On startup you will have to query the table and ‘overrule’ the values of the i18n keys in the set with ‘solution i18n’ with the industry/company/department specific labels you got back from your query.
Just loop through this dataset and use: ```
i18n.setI18NMessage(i18nKey, value)
Besides the method for the last three business rules Marc described, you also have the ability to add an extra column to the i18n table and use the i18n.setI18NMessagesFilter(…) to filter the used i18n keys based on a value in that column, see
pbakker:
Besides the method for the last three business rules Marc described, you also have the ability to add an extra column to the i18n table and use the i18n.setI18NMessagesFilter(…) to filter the used i18n keys based on a value in that column, see i18n | Docs
By the way, could anyone explain where i18n messages are stored?
I had a default and english message for each i18n key.
When I create values for additional lanugages in i18n editor in Servoy, I can’t find them in the database.
The settings seem ok, the i18n server and table in Servoy i18n preferences are set to the local server and table.
Also, when I change the message value directly in the database it does not affect the client.
Restart does not help
maria:
By the way, could anyone explain where i18n messages are stored?
I assume you use v4.0 or higher?
The i18n keys are stored in files in your workspace (if you look for a valid entry using ctrl-H in eclipse, you will see the name of the file)
to get the values in the database: export the solution (don’t forget to tick the export i18n checkbox as well), import on your application server.