Setting Language of Application from Language Sharing Option

Hello,

I am developing an application which display its text in different languages, i.e. English and Marathi. Here I am using UTF-8 character as encoding type. I have to use default language of application Marathi. When user goes to login to application, he/she can choose language for login from login screen. If user selects English, then whole application should display in English. Otherwise Marathi language will display.

I have blank forms in my application where I used language variables to display text, variables such as {lang_var_name} which print text in English and Marathi depending upon language used as locale of application. I defined lot of language variables in language library of ScriptCase.

When I login using English as application language, the blank forms cannot displays texts in English. What can I do for displaying the texts in Marathi or English depending upon login language? I tried searching solution in SESSION variable, it does not display such variable such as str_lang and str_conf_reg every time. I set Share Location Variable to YES and Language variable to none in application settings.

When I choose Language variable to English from application settings, whole application displays in English but cannot change to Marathi as my requirement to set language from login form and when it is Marathi, application cannot change to English. How can I use shared language variable to set language of display?

Thanks in advance.


Milind Wakale

I have a bit trouble answering this question. Are you saying that setting the language on the login panel doesn’t work? Did you add the SC language dropdown to the login form? Then it would mean that there’s a bug in scriptcase because only blank application does not respond to the setting? We create our applications in English and Dutch where Dutch is default. Afaik we do not have similar issues… So there must be a difference between what we have done and you are doing?

I am developing application containing blank forms, grids and forms. When someone login to application, user can choose language he or she is comfortable with. After login to application, application should display in the language of users choice.

In control form, there is language bar where user can select the language. Following to login form, there is blank form consisting of a frame which display grid or form. I want the blank form to use language variable shared by login form, which is not happening right now. Manually selecting language form application settings, application can display both languages.

How can I use language shared by login form?

[QUOTE=milind.wakale;24744]I am developing application containing blank forms, grids and forms. When someone login to application, user can choose language he or she is comfortable with. After login to application, application should display in the language of users choice.

In control form, there is language bar where user can select the language. Following to login form, there is blank form consisting of a frame which display grid or form. I want the blank form to use language variable shared by login form, which is not happening right now. Manually selecting language form application settings, application can display both languages.

How can I use language shared by login form?[/QUOTE]

mmm, there’s the difference, we only allow to set a language at logon time. I’ll try to find some time to check things out. In general you could try to find the name of the global variable and find out what it’s value is in your blank application. You could consider binding the variable to your session. But that’s just some things to try as i actually don’t know.

Yes, as I mentioned in my first post, there are two variables in session namely, str_lang and str_conf_reg, but these variable doesn’t appears every time. These variables, only display when we change language value from language bar. I didn’t find any other such variables.

I see. Perhaps you can try to make/force these variables global and session. I’m not too familiar with all the generated code, but I think that if these variables are not set SC will take the defaults.

[SOLVED] Setting Language of Application from Language Sharing Option

Thanks for suggestion.


$_SESSION["scriptcase"]["str_lang"] = "en_us";
$_SESSION["scriptcase"]["str_conf_reg"] = "en_in";

Putting above code in my blank application at top of application, solved the problem. I passed values of language variable, values such as “mr”, “en_us”, “en_in” in parameter and set above variables. :cool: :cool: