Locale string search

The use of specific JADE features and proposals for new feature suggestions
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Locale string search

Postby ConvertFromOldNGs » Fri Aug 07, 2009 10:48 am

by Desmond >> Wed, 18 Apr 2001 21:33:38 GMT

Hi
In our project we've got lots of locale strings, if Jade can allow us to do a search on that, it will be great.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Locale string search

Postby ConvertFromOldNGs » Fri Aug 07, 2009 10:48 am

by Graeme Joyce >> Thu, 19 Apr 2001 1:49:02 GMT

Hi Desmond - some of this might help.... ----------------------------------------------
vars
locale : Locale;
localeId : Integer;
stringDict : ConstantNDict;
xstring : Constant;begin

localeId := currentSchema.getCurrentLocaleId;
locale := currentSchema.getLocale (localeId.String);
stringDict := locale.getTranslatableStrings;

// You now have a dictionary of all translatable strings (key is string name) for the current locale.
// How you use it is up to you. eg you could do this:

xstring := stringDict ["currency_unit"];
if xstring <> null then
write xstring.valueAsString;
endif;

// which will write the value of the translatable string named "currency_unit" for the current locale.

// or this:
foreach xstring in stringDict do
if xstring.valueAsString = "yen" then
write xstring.name;
endif;
endforeach;

// which will write the name of the translatable string that has the value "yen" in this locale. ------------------------------------------------------

Using an iterator in conjunction with "startKeyGeq" will let you do "begins with" substring searches on string name....

HTH
Graeme


Return to “Feature Discussions”

Who is online

Users browsing this forum: No registered users and 12 guests