Easy to Create, Easy to Change - Easy to use!


DE8.5 - How to make generalised Language Version with ExecDQL and GetCurrent() etc.


Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DE8.5 - How to make generalised Language Version with ExecDQL and GetCurrent() etc.

Download Sample


How to create language versions of documents has been discussed before.

How to acheive this depends a little on which version of DataEase you use.

The simplest way to do this would be to use Virtual fields as labels. This way you can base it all on a relationship where you have a field that look up from your user profile what langauge the user prefer and then basically create a relationship from each form based on that language code.

Then you have a virtual field instead of a label - this trick will work in any version of DataEase.

In DE8.5 onward you can basically manipulate anything which make this a little more exiting.

You can for istance change the text on any label (and size, style, visibility etc) with SetLabelText(). You can use this one to change the label on a button too.

You can then for instance just run an ExecDQL when you load the form that will change all the labels.

define "retval" text .

define "vLanguage" text .

vLanguage := any UserProfile with User=current user name Language .

if vLanguage = blank then

vLanguage := any UserProfile with User=blank Language .

end

For MyLabels with FormID=getcurrent("DocName") and Language=vLanguage ;

retval := SetLabelText(MyLabelName,NewLabelText) .

 The DQL above is from the attached sample.

it is not exhaustive but it should give you the general gist of how to achieve this.

If we have time we will make a more exhaustive and general/automated sample in DE9 later.

All the best and good luck.

Written by DataEase 09/06/20 at 18:50:01 Dataease [{8}]FIVE
/static/images/blank.png