Simplicty and flexibility!


Multiple language settings


Started by Daniel Kron
Search
You will need to Sign In to be able to add or comment on the forum!

Multiple language settings

Hi.

Is it possible to have multiple language settings, i.e. personalize the display language in the forms for the users?

Sincerely,

Daniel Kron


Written by Daniel Kron 08/06/20 at 16:35:20 DataEase 9 Developer

Re:Multiple language settings

Download Sample


Hi Daniel.

Depends a little on which version of DataEase you use.

In DE8.5 onward you can basically manipulate anything.

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 onwards you can 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 17:22:02 DataEase 9 Developer
DG3_ForumList