Child pages
  • Customization via I18N

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Formatting defaults need to be specified in the English format the dot (".") as decimal separator (and comma as 1000 separator)

...

Using databaseManager.addTableFilterParam to filter I18N keys

It is also possible to have multiple values for one key, and create a extra column in the database to use in a filter.
For example when working with a SaaS solution and there should be some custom labels for one of the clients. Add a extra column to the i18n table for example called "message_owner" like:


Image Added

In the onOpen method this code can be added to filter on the message_owner column:

Code Block
function onOpen()
{ 
	databaseManager.addTableFilterParam('i18n_db', "i18n_table", "message_owner", "IN", ['servoy', null]);
}

This means that only keys with 'message_owner' = 'servoy' or null, and if there are more entries for the same key for different 'message_owner', then,
the order of the values in the filter defines what is used (ex: you have 'lbl.3'  with 'message_owner' = 'servoy', but also, 'lbl.3' with 'message_owner' = null, then the first one will be used) 

So the usage of lbl.1 to lbl.3 keys would on labels would result in:

Image Added


If you want your users to be able to make their own labels for i18n keys, this is easily possible by making a form on the I18N table. It might be preferred to have the user work in a on a  duplicate of the record they want to edit and then enter the message_owner column with the logged in owner. This way the key will turn up for this owner but not for the others.