Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 1 Monat
Letzter Beitrag:
vor 2 Jahren
Beteiligte Autoren:
Sara Joy, Arie, Fabrice Harari, Peter Holemans

Switching between languages WD 20

Startbeitrag von Sara Joy am 19.05.2016 09:09

Hi all,

I am currently working on a project which supports multi language English and Arabic...I designed a form for entering some datas ..I need to enter datas parallally on another form in second language.. I will explain in detail..
From the main window itself,program receives the user option that on which language to continue ...so the further forms will change language accordingly using the following code
PROCEDURE Changelanguagesettings()
IF gnLanguage=1 THEN



so the data entry form will appear in arabic if i choose 'gnlanguage' as 2..In that form i am again giving an option to switch language to enter data..If user select switch language, a new form will be opened with following end of initialisation code..

IF gnLanguage=1 THEN

so that user can enter datas in English there..

and also on closing this form again switch language to previous ..
Everything works perfect..but on switching to second form ,the language settings of the current also changes to that, So that already filled edit controls resets its values..
What i want is User can enter data PARALLALLY on both forms....ie Arabic in first form and English in second form OR viceversa.ie switching language should affect only individual forms not all..when control goes to second form the language change should happen only there and moving on to the first form langauge supported there should be the old one.

In short changelanguage settings to be affected to newly opened form only ..not all windows..Previously opened windows to be continued in old languagesettings..

In the image attached you can see both forms 1 and 2 changes language to English..

Help Plz
[attachment 1996 pic2.jpg]


Hi Sara,

What you are describing is the normal behavior of the languages functions. You may ask PCSoft for an improvement/option, but as I've never seen anybody asking for that in 20+ years, I wouldn't hold my breath if I were you...

So in order wot work around the problem, I have 2 ideas. If the first one doesn't work, the second will:
1. use the When taking Focus area of each window to change the language to what you need in that window.

if that's not enough, then you'll need to restart your exe in a special mode, with a command line making it open only the desired window in the desired language. This way, you have 2 exe running at the same time, each in one language. It's up to you to decide what to do in the second exe when closing the window.

Best regards

von Fabrice Harari - am 20.05.2016 12:33

did you check this setting. It looks like it does exactly what you want.

"The change will be effective:•WinDev immediately if "Change language immediately after the call to Nation" is selected in the "Advanced" tab of the project description. If this option is not checked, the change of language will be performed when the next window is opened. "

von Arie - am 20.05.2016 13:28
Option 3, if you have WDMSG.

Extract all texts with WDMSG. If you use the FIC extension for the output file, you will get a very useable Hyperfile-file, with the window and controlname on every record.
Then on opening of the window you can translate the the window yourself, by reading this file and change captions and so on

More or less what the WD framework does behind the scenes.

von Arie - am 20.05.2016 13:33
Hi Arie

Thanks for your reply,,

I have checked that settings already..It wont give the result as i expect..By that setting ,i can enter data in another language, but the text for the controls remains in the previous language...
I didnt check option3


von Sara Joy - am 22.05.2016 04:31
Mr,Fabrice Herrari,,
Thank you for your kind reply..

Can you explain in detail how it will workout?


von Sara Joy - am 22.05.2016 04:33

do you use the Nation() function in the opening of the window? I think you have to set the language BEFORE opening the new window.
I did a little test and it seems to work thaat way. I also use this for reports. Where a report is printed depeding on the choosen customer (let's say to print an invoice in the customers own language).

von Arie - am 22.05.2016 10:41
Hi Sara,

I'm not sure what else to say. Maybe you can ask questions about what you did not understand in my previous post.
The principle is:

You exe accepts parameters in its command line. These parameters will contain the window name and it's parameters
If you receive that in your exe, then you directly open that window (instead of the regular first one) with the parameters you received.

At that point, one of the parameters is of course the display/input language, and that means that you can open any window of your application in any language, as a standalone exe.

So you have your regular window in your regular program, and you want to open the same one in the other language, you just start a second instance of your program with the appropriate parameters.

Best regards

von Fabrice Harari - am 22.05.2016 13:53
Hi Sara,

Not sure, but this may work:
Use Nation() to change language during the windows declaration. Next refresh the window to the new language using the Use() function and after that reset the language again without refreshing the window so the rest of the application remains in the previous language.

This should alter the language settings of that window only.
Not sure about it, but it may work.

I believe there is also an option on edit controls (might be an attribute) to set the input language and force right to left writing. Something like (EditControl..RightToLeft = True) This might give you the option to only modify the language setting for a single control instead of a whole window.

I hope this may work for you!


Peter Holemans

von Peter Holemans - am 23.05.2016 09:08
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.