i18n keys as display values with value-list filter option

Questions and answers for designing and implementing forms in Servoy

i18n keys as display values with value-list filter option

Postby nisalaperera » Wed Jul 30, 2014 10:12 am

Hi All,

I have used "Apply valuelist name as filter on column 'valuelist_name'" option to populate the value-list in my solution.

In this case, I have used i18n keys (Eg: i18n:mysolution.valuelist1.value1) as display values. But it's not loading the i18n value properly.

Is it possible to use i18n keys as display values with above implementation?

Servoy Version : Version: 7.4.1 - build 2028
Regards
Nisala Perera
Returnpool Lanka Pvt Ltd.
nisalaperera
 
Posts: 16
Joined: Fri Sep 12, 2008 6:23 am

Re: i18n keys as display values with value-list filter optio

Postby pradiptab » Wed Jul 30, 2014 1:02 pm

Hi Nisala,

You can create an un-stored calculation, which will return the i18n value for the specified i18n key. (I guess you are keeping the i18n key in one of the column of the field)

Code: Select all
// Code for calculation
function calculation_name() {
    return i18n.getI18NMessage(column_name_holding_the_i18n_key);
}

Use that calculation as the display field in your valuelist. It will work.
Pradipta
Mindfire Solutions
SAN Developer | Servoy Certified Developer
pradiptab
 
Posts: 59
Joined: Tue Mar 10, 2009 2:32 pm
Location: India, Orissa, Bhubaneswar

Re: i18n keys as display values with value-list filter optio

Postby nisalaperera » Thu Jul 31, 2014 9:45 am

Hi Pradipta,

Thanks for the quick solution. It works perfectly.
Regards
Nisala Perera
Returnpool Lanka Pvt Ltd.
nisalaperera
 
Posts: 16
Joined: Fri Sep 12, 2008 6:23 am


Return to Forms

Who is online

Users browsing this forum: No registered users and 4 guests