Changing language dynamically

hi all,
I want to have buttons on my pages to change the language of the application dynamically. I tried to do this with no result; for example I want my application to support two languages arabic and english. Here is what I did:
I added the following code to faces-config.xml
<locale-config>
<default-locale> en </default-locale>
<supported-locale> ar </supported-locale>
</locale-config>
Then, I added the following code to adf-faces-config.xml
<right-to-left>true</right-to-left>
Finally, I've created a button with the following action:
FacesContext fc = FacesContext.getCurrentInstance();
Application app = fc.getApplication();
DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(fc,"bindings");
BindingContext bc = binding.getBindingContext();
LocaleContext en = new DefLocaleContext(new Locale("en"));
LocaleContext ar = new DefLocaleContext(new Locale("ar"));
if(bc.getLocaleContext().getLocale().getLanguage().equalsIgnoreCase("ar"))
bc.setLocaleContext(en);
else
bc.setLocaleContext(ar);
return null;
Did I miss something ??
I am stucked here, any help plz?
Bassam

hi all,
now it works with only this action:
public String commandButton_action() {
// Add event code here...
FacesContext fc = FacesContext.getCurrentInstance();
if(fc.getCurrentInstance().getViewRoot().getLocale().getLanguage().equalsIgnoreCase("ar"))
fc.getCurrentInstance().getViewRoot().setLocale(new Locale("en"));
else
fc.getCurrentInstance().getViewRoot().setLocale(new Locale("ar"));
return null;
Note: I found it on another thread
Bassam

Similar Messages

  • Change Language Dynamically in Adobe Interactive Form with Webdynpro

    Hi Experts,
    I want to display some text in Arabic in my Adobe Form. Where do I store the translations for the english text and how do I substitute it to display the translations. I also noticed one issue. When I hardcode some arabic text in the text field. It appears as a junk character when my form is displayed in the application. We are using ECC 6.0 and non unicode. Is it possible to display arabic in such an environment.
    Regards,
    Abdullah

    Solved using JDBC

  • How can change language of application dynamic?

    In the dialog I have combo box in which I can select desire language for application. When I select value I save this value in the config file. But language change ONLY when I exit and again enter to the application. How can change language of application dynamic (without exit from application) ?

    alexpass wrote:
    In the dialog I have combo box in which I can select desire language for application. When I select value I save this value in the config file. But language change ONLY when I exit and again enter to the application. How can change language of application dynamic (without exit from application) ?I guess your application sets the locale at "startup", based on the contents of the config file, using a call to java.util .Locale.setDefault(Locale). Did you try to call this method in response to the selection in the combobox?
    This won't refresh all widgets already created however. You probably have to re-create them all.
    There may be case-by-case way to refresh them, for example Locale-dependent layout may be taken into account dynamically. Try and tell us.

  • Errorlog filling with changed language setting and changed database context messages

    On one of my servers, the ERRORLOG is filling with messages for "Changed language setting to..." and "Changed database context..." for every single connection.  They are generated for any kind of connection--such as Management Studio.
     How did this get turned on?  How do I suppress the messages in the errorlog?  This is the only server that's having the problem.
    Example at the bottom.
    SQL is: SQL 2008 R2 SP2 
    Trace flags set on this server are 3226, 1118, 1117
    Date,Source,Severity,Message
    01/24/2014 11:23:14,spid65,Unknown,Changed language setting to us_english.
    01/24/2014 11:23:14,spid65,Unknown,Changed database context to 'master'.
    01/24/2014 11:23:14,spid64,Unknown,Changed language setting to us_english.
    01/24/2014 11:23:14,spid64,Unknown,Changed database context to 'master'.
    01/24/2014 11:23:13,spid64,Unknown,Changed language setting to us_english.
    01/24/2014 11:23:13,spid64,Unknown,Changed database context to 'master'.
    01/24/2014 11:23:13,spid55,Unknown,Changed language setting to us_english.
    01/24/2014 11:23:13,spid55,Unknown,Changed database context to 'master'.
    01/24/2014 11:23:11,spid55,Unknown,Changed language setting to us_english.
    01/24/2014 11:23:11,spid55,Unknown,Changed database context to 'master'.
    01/24/2014 11:23:05,spid61,Unknown,DBCC execution completed. If DBCC printed error messages<c/> contact your system administrator.
    01/24/2014 11:23:05,spid61,Unknown,The error log has been reinitialized. See the previous log for older entries.
    01/24/2014 11:23:05,spid61,Unknown,Logging SQL Server messages in file 'F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\Log\ERRORLOG'.
    01/24/2014 11:23:05,spid61,Unknown,Authentication mode is MIXED.
    01/24/2014 11:23:05,spid61,Unknown,System Manufacturer: 'HP'<c/> System Model: 'ProLiant DL580 G5'.
    01/24/2014 11:23:05,spid61,Unknown,Server process ID is 20096.
    01/24/2014 11:23:05,spid61,Unknown,All rights reserved.
    01/24/2014 11:23:05,spid61,Unknown,(c) Microsoft Corporation.
    01/24/2014 11:23:05,spid61,Unknown,Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) <nl/>
    Jun 28 2012 08:36:30 <nl/> Copyright (c) Microsoft Corporation<nl/>
    Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

    Here's the relevant parts of the startup from today.  I snipped out some specific database info (noted with ...), but the main events are still there.
    ... [Several lines of changed database context/changed language]
    01/24/2014 10:03:33,spid52,Unknown,Changed database context to 'master'.
    01/24/2014 10:03:33,spid51,Unknown,Changed language setting to us_english.
    01/24/2014 10:03:33,spid51,Unknown,Changed database context to 'master'.
    01/24/2014 09:59:44,spid6s,Unknown,Recovery is complete. This is an informational message only. No user action is required.
    01/24/2014 09:59:40,spid11s,Unknown,Service Broker manager has started.
    01/24/2014 09:59:39,spid11s,Unknown,The Database Mirroring protocol transport is disabled or not configured.
    01/24/2014 09:59:39,spid11s,Unknown,The Service Broker protocol transport is disabled or not configured.
    01/24/2014 09:59:35,spid28s,Unknown,CHECKDB for database 'userdb' finished without errors on 2014-01-19 12:19:29.640 (local time). This is an informational message only; no user action is required.
    01/24/2014 09:59:25,spid10s,Unknown,Starting up database 'tempdb'.
    01/24/2014 09:59:25,spid14s,Unknown,CHECKDB for database 'msdb' finished without errors on 2014-01-19 12:20:23.410 (local time). This is an informational message only; no user action is required.
    01/24/2014 09:59:25,spid16s,Unknown,CHECKDB for database 'userdb' finished without errors on 2014-01-19 12:21:44.847 (local time). This is an informational message only; no user action is required.
    01/24/2014 09:59:23,Server,Unknown,SQL Server is now ready for client connections. This is an informational message; no user action is required.
    01/24/2014 09:59:23,Server,Unknown,The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x2098<c/> state: 15. Failure to register an SPN may cause integrated authentication to
    fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
    01/24/2014 09:59:23,spid10s,Unknown,Clearing tempdb database.
    01/24/2014 09:59:23,spid31s,Unknown,Starting up database 'userdb'.
    01/24/2014 09:59:23,spid14s,Unknown,Starting up database 'msdb'.
    01/24/2014 09:59:23,spid10s,Unknown,CHECKDB for database 'model' finished without errors on 2014-01-19 12:20:20.393 (local time). This is an informational message only; no user action is required.
    01/24/2014 09:59:23,spid11s,Unknown,A new instance of the full-text filter daemon host process has been successfully started.
    01/24/2014 09:59:23,Server,Unknown,Dedicated admin connection support was established for listening locally on port 53067.
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ 127.0.0.1 <ipv4> 53067].
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ ::1 <ipv6> 53067].
    01/24/2014 09:59:23,Server,Unknown,Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$ETL\sql\query ].
    01/24/2014 09:59:23,Server,Unknown,Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\ETL ].
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ 'any' <ipv4> 50537].
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ 'any' <ipv6> 50537].
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ 'any' <ipv4> 5427].
    01/24/2014 09:59:23,Server,Unknown,Server is listening on [ 'any' <ipv6> 5427].
    01/24/2014 09:59:23,Server,Unknown,A self-generated certificate was successfully loaded for encryption.
    01/24/2014 09:59:22,spid6s,Unknown,Server name is 'MYSRV\ETL'. This is an informational message only. No user action is required.
    01/24/2014 09:59:22,spid10s,Unknown,Starting up database 'model'.
    01/24/2014 09:59:22,spid6s,Unknown,The resource database build version is 10.50.4000. This is an informational message only. No user action is required.
    01/24/2014 09:59:22,spid6s,Unknown,Starting up database 'mssqlsystemresource'.
    01/24/2014 09:59:22,spid6s,Unknown,SQL Trace ID 1 was started by login "sa".
    01/24/2014 09:59:21,spid6s,Unknown,FILESTREAM: effective level = 0<c/> configured level = 0<c/> file system access share name = 'ETL'.
    01/24/2014 09:59:21,spid6s,Unknown,SQL Server Audit has started the audits. This is an informational message. No user action is required.
    01/24/2014 09:59:21,spid6s,Unknown,SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    01/24/2014 09:59:21,spid6s,Unknown,Resource governor reconfiguration succeeded.
    01/24/2014 09:59:21,spid6s,Unknown,CHECKDB for database 'master' finished without errors on 2014-01-19 12:20:10.410 (local time). This is an informational message only; no user action is required.
    01/24/2014 09:59:21,spid6s,Unknown,Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
    01/24/2014 09:59:21,spid6s,Unknown,1 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
    01/24/2014 09:59:20,spid6s,Unknown,Starting up database 'master'.
    01/24/2014 09:59:20,Server,Unknown,Node configuration: node 0: CPU mask: 0x000000000000ffff:0 Active CPU mask: 0x000000000000ffff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user
    action is required.
    01/24/2014 09:59:20,Server,Unknown,Lock partitioning is enabled.  This is an informational message only. No user action is required.
    01/24/2014 09:59:20,Server,Unknown,Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
    01/24/2014 09:59:20,Server,Unknown,Using locked pages for buffer pool.
    01/24/2014 09:59:19,Server,Unknown,Large Page Allocated: 32MB
    01/24/2014 09:59:19,Server,Unknown,Large Page Granularity: 2097152
    01/24/2014 09:59:19,Server,Unknown,Large Page Extensions enabled.
    01/24/2014 09:59:19,Server,Unknown,Detected 16 CPUs. This is an informational message; no user action is required.
    01/24/2014 09:59:19,Server,Unknown,SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    01/24/2014 09:59:19,Server,Unknown,Registry startup parameters: <nl/>
    -d F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\DATA\master.mdf<nl/>
    -e F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\Log\ERRORLOG<nl/>
    -l F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\DATA\mastlog.ldf<nl/>
    -T 3226<nl/> -T 1118<nl/>
    -T 1117
    01/24/2014 09:59:19,Server,Unknown,This instance of SQL Server last reported using a process ID of 1060 at 1/24/2014 9:57:16 AM (local) 1/24/2014 3:57:16 PM (UTC). This is an informational message only; no user action is required.
    01/24/2014 09:59:19,Server,Unknown,Logging SQL Server messages in file 'F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\Log\ERRORLOG'.
    01/24/2014 09:59:19,Server,Unknown,Authentication mode is MIXED.
    01/24/2014 09:59:19,Server,Unknown,System Manufacturer: 'HP'<c/> System Model: 'ProLiant DL580 G5'.
    01/24/2014 09:59:19,Server,Unknown,Server process ID is 20096.
    01/24/2014 09:59:19,Server,Unknown,All rights reserved.
    01/24/2014 09:59:19,Server,Unknown,(c) Microsoft Corporation.
    01/24/2014 09:59:19,Server,Unknown,Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) <nl/>
    Jun 28 2012 08:36:30 <nl/> Copyright (c) Microsoft Corporation<nl/>
    Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

  • Change language programming

    how change language programming

    how change language programming
    I'm guessing English is probably not your first language and hence posting in English is probably rather difficult.
    Unfortunately, it's impossible to tell what the question is.
    If you say have vb and want c# then there are online translators.  But they're not very reliable and re-writing yourself is usually better.
    If you have a solution which is c# and you want to use some VB in it.
    You can't in the one project but each project in a solution can be different languages.  This is because they are essentially compiled separately.  Each project is compiled to an exe or dll.
    You can therefore have as many languages as you have projects in a solution.
    If you mean how do you learn a different language.
    You already have a head start in that everything use .net libraries so the methods and classes are the same.
    You "just" have to learn the rest of the language and I would suggest video training if your English is up to it ( pluralsight is good ) and or a book.
    It took me a week to transfer from vb.net to c#.net.  Admittedly, I had already done some pascal as part of my degree and know a number of other languages but it was pretty easy to pick up.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • What key(s) do i type to change language from english to other? i am writing s story in dual languages. i was told to click command and space bar together but it is not working.

    what key(s) do it type to change language from english to other? i am writing a story in dual languages. I was told to click command and space bar together but it is not working.

    Command Spacebar opens Spotlight as you have found out. If you want to change languages you need to say what app you are using to write the story in, I'm guessing you are using Pages or MS Word. If that's the case
    Pages: Open Inspector - Click the T tab - Click Language and change your language.
    MS Word: Tools Menu - Language - Choose your language.

  • How to reload the screen when changing languages in JavaFX 2?

    I'm beginner with javaFX and i need to change language of the screen. but i have no idea how to reload the screen when the language was changed. The application have a button where have the language available. I want just refresh screen when the user change language.
    Here is the start method to show the stage.
        @Override
        public void start(Stage stage) throws Exception
            this.stage = stage;
            Locale locale = Locale.getDefault();
            ResourceBundle rb = ResourceBundle.getBundle("resources/Label",locale);
            loader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"),rb);
            root = (Parent)loader.load();
            FXMLDocumentController controller = (FXMLDocumentController) loader.getController();
            controller.setMain(this);
            scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
    here is the function to change the language(in the same class with start function),the rb is the new ResourceBundle:
        public void refresh(ResourceBundle rb)
              //change the language here
    1. I don't want to use the resourceBundle to get value in resource file and set label in scene one by one.like following:
    this.btnLabel.setText(rb.getString(key.test));
    2. I don't want to reload the scene,like following:
        public void refresh(ResourceBundle rb)
             try
                loader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"),rb);
                root = (Parent)loader.load();
                scene.setRoot(root);
                FXMLDocumentController controller = (FXMLDocumentController) loader.getController();
                controller.setMain(this);
            catch(Exception err)
                err.printStackTrace();
    So do we have a solution to just set the resourceBundle and reload the scene easier?
    Thanks and best regards!

    Your option 2 (reload the FXML for the scene using the new resource bundle as a parameter), is the way this would normally be done and what I would recommend.
    Failing that, you could use option 1 of individually resetting the label text of labeled items (I don't really recommend this).
    Why don't you want to use option 2?
    Perhaps it is because there is some internal state of the UI which differs from the initial state when the the UI is first loaded (e.g. user has typed text in a text field and you want to preserve that).  If that's the case you will need to either go with your option 1 of individually resetting the label text of labeled items, or implement something which preserves the UI state and user data by saving it in memory or to disk, reloading the UI via the FXMLLoader (essentially your option 2), then restoring the UI state and user data to what it was before the language change.  Preserving and restoring the modified state seems complicated to me if you have a lot of state, so I wouldn't really advise this approach unless you really needed it.

  • I changed language from EN-GB to EN-US but my keyboard is still British (only when using FF). How can I change it to EN-US? in English

    I changed language (based on an answer in this forum) from EN-GB to EN-US but my keyboard is still British (only when using FF). How can I change it to EN-US?
    Should I just export my bookmarks, uninstall and reinstall the proper version? That may just be shorter than anything else.

    GREAT!. Thanks a lot for educating me. There seem to be a million things we have to learn about our computers and when we run into them the first time they seem insurmountable. You pointed me to the solution. Thanks again. Ben

  • Changing Language in 6120

    Hi all
    I am having trouble with changing language in 6120.
    Usually, I am use to change language by pressing the # key when i write some thing... BUT the thing is that in 6120, it will change the language only to the language you choose.
    E.G main language is English, I write a URL in english that i want to get to, now, i am in the site and wants to write in Hebrew, However, the options of changing language by pressing on # key is only 123, abc, ABC but not Hebrew, even when i have Hebrew fonts installed. thus, i need to go to the language section, choose Main language as Hebrew, go back to the site and write in hebrew ... cant i do it just with the # key ?! so i will have 123, abc, ABC, אבג ... BTW, i had this option in my old 6230i

    In July of this year, Apple made a change to the iTunes store which essentially makes this impossible (for now). Until that time, there was a workaround you could use as per their Knowledgebase which would let you set the language of the iTunes Store back to English, regardless of what country your iTunes account was based in.
    There have been repeated attempts from the user community to get Apple to acknowledge and address this issue, but the customer service staff have thusfar only referred to the KB article, which doesn't actually help. For now, your only option is to select a different country's store by selecting the flag icon/button on the lower right corner of the iTunes store and reading about applications or music in another store...of course, this actually will log out out of your itunes store account, which means you can't purchase anything, and as soon as you sign back in, you will be forced to the language of the country your account is based in.
    I find this policy of Apple's to be truly repugnant and counter everything they've strived to stand for - but it seems it's here to stay, as they won't acknowledge nor fix it.
    Apple's staff only point to:
    http://support.apple.com/kb/HT2242
    This will not fix the problem we've all been having since July.

  • How to change language in photoshop CC 2014 with rksskogo into English?

    how to change language in photoshop CC 2014 with rksskogo into English?

    go to your installed photoshop directory select locales folder "nl_NL" folder "support files" "tw10428.dat" rename to "tw10428.dat.old" press yes, and restart the tool again

  • Change language in Acrobat XI Pro - It does not work

    I installed Acrobat XI Pro using the Adobe Application Manager (AAM) on Windows 7, English. I am on a Creative Cloud subscription, so i have no .exe file to install from.
    Acrobat XI Pro defaults the  Application Language to English when installing from AAM since Windows is an English version. I want Acrobat XI Pro in Swedish language.
    If i go to Acrobat's Preferences > Language and change the Application Language from English to "Choose at application startup" i never get the dialog that should provide me with the option to change language when i re-launch Acrobat XI Pro. If i hold down Shift-Ctrl when launching Acrobat XI Pro i don't get that dialog either.
    I see the same issue on three computers, two with Win 7 and one with Win 8. Both OS versions are English.
    So, how do i change the Application Language from English to Swedish?
    /Roger

    In case anyone else run into the same issue, here is the solution:
    1. Add remove programs -> Select Acrobat
    2. Then click on Change button  present next to Uninstall option. Acrobat setup dialog will be launched.
    3. Now select Modify option in Acrobat setup dialog
    4. In the dropdown list  select View Adobe PDF
    5. Select the desired language support
    6. Install the required language packs
    When i did, i got the dialog that let me change the language next time i launched Acrobat XI.
    Special thanks goes to Rohit from Adobe!
    /Roger

  • Firefox freeze whenever tired to change language input

    Hi. Whenever I tried to change language input to enter other languages Firefox freeze (program not responding).
    It happens as soon as I hit alt+shift or when I click language bar to select other language.
    It also happens with several languages (that I tested, might be all), and I tried various input software/mode including windows default, all freeze. Reset Firefox under help does not work either.
    This issue occur with Firefox and Chrome, but not IE... Might not be Firefox problem as it happen w Chrome, but and ideas please? Thanks.
    J
    Edit:
    * regedit might be changed, but do not believe touched internet setting.
    * I can enter foreign language as long as I set that language to default, and do not change to other language in the language bar. Currently I am using foreign language input software as default, and switch to English input '''within '''that software.

    Hi. karaoke I am not sure if its the same issue. The crash at language switch on my computer was due to the IME for Eastern Language Banks (Language option -> Detail under text services and input languages -> Properties -> reset/untick auto learn).
    If you are not using Eastern Language IME... I am sure others here have more experience and can better help you. =)

  • How to change language?

    I accidently selected "English" as application language at the first startup of Adobe Reader. Now I do not know how to change it to German, Edit -> Preferences -> International -> Application Language -> "Choose at Application startup" does NOT work. Do I have to uninstall Adobe Reader and reinstall it to change language?!?
    Sorry for my broken English.
    Kind regards - Oliver
    OS: Windows Vista
    Adobe Reader: 8.1.2

    >
    Claudio González, "How to change language?" #2, 26 Mar 2008 5:31 am If you go to Preferences > International (Display in older versions of Reader), you are offered limited language options. These are between English and the language you chose when downolading (older versions), and the present language and selecting language at startup (newer versions), which will probably offer the same two lternatives.
    As I have written, selecting one of these Options does
    b not work!
    Wich means no matter what I choose here it has
    b no effect
    (even after restarting adobe reader or my notebook)!
    Other Ideas?

  • How to change the dynamic IP address to Static IP Address in Solaris 10X86

    Hi,
    I have installed Solaris 10X86 in a VM.While installing Solaris I have enabled DHCP.So its created with dynamic IP Address.Now I want to change the dynamic IP address to static IP address.Please anyone can help me to sort out this problem.

    Hi,
    I have installed Solaris 10X86 in a VM.While installing Solaris I have enabled DHCP.So its created with dynamic IP Address.Now I want to change the dynamic IP address to static IP address.Please anyone can help me to sort out this problem.

  • How to change language settings on the latest version of pages?

    How can I change languages in Pages?

    It should do it automatically but otherwise just select select the text:
    Menu > Edit > Spelling & Grammar > Show Spelling & Grammar > Automatic by language > change to your prefered language
    Peter

Maybe you are looking for