I’m currently using i18n keys in generating a value list via the “custom values” panel. However for a new VL I need a mix – some items as i18n keys and some as actual fields.
The value list itself is used to display Search options. i18n is ideal for those with static text such as Customers, Suppliers, Clients, etc. However I also need to give users the option of searching by the name of fields which are unique to that particular user. Thus the use of a global as the pk in the field relationship.
I’ve tried three ways. 1, by adding the field with tags in the custom values panel; 2, by creating i18n keys whose sole content is the tagged fields; and 3, by creating an array with the field values and then calling on the array with {0}, a technique I’ve successfully used in other i18n keys for calling the array.
All ways simply print the literal text rather than interpret them. Meanwhile, those keys which do NOT call on a field are properly interpreted.
Note the fields I need to display are dependent on a global primary key. Not sure whether this requirement is significant in this situation.
You can just query the “messages” table (that holds the i18n values) directly in a SQL statement - that takes into consideration the country of the user (you can get that now as a function in the i18n node in the Editor).
You can just query the “messages” table (that holds the i18n values) directly in a SQL statement - that takes into consideration the country of the user (you can get that now as a function in the i18n node in the Editor).
Thanks Bob, but that’s to obscure for me to follow. (I’m making good progress but am still very green at this.) What’s an SQL statement and where can I find some docs on that? And what’s this business of “takes into consideration the country of the user” all about?
However, I’m delighted there appears to be a solution.
I can’t take the space or time to teach you how to write SQL statements - but if you go into the Editor and click on the “DatabaseManger” and move the sample for “getDataSetByQuery” you’ll see how you can use SQL statements to query databases and get back values.
An example SQL statement is:
SELECT custId, first_name, last_name FROM customers WHERE state = 'CA'
All the i18n data is held in a database. It’s called “messages” by default - so look in your preferences to see where you set it up. You can then query that database with something like:
SELECT message_value FROM messages WHERE messagesid IN ('sol.type1, sol.type2')
You can tell the location the client is using:
var x = i18n.getCurrentLanguage()
That will put the language in the variable x. It will be something like “en” (english), “fr” (French), etc.