[JSF 1.2 and 2.0/Internationalization] How to propagate the Locale to the entire application
Hi,
do you know how to internationalize an application in a dynamic way in JSF 1.2 ?
I created 2 files msg_fr.properties ( language by default, french) and msg_en.properties ( english)
Then I wrote a methode changeLanguage() in a Managed Bean . This method allows me to switcher the language in the first page of the application.
This method is called in a tag <h:commandLink>
public void changeLanguage() {
FacesContext context = FacesContext.getCurrentInstance();
// I test a parameter (currentLanguage) and I switch in consequence
context.getViewRoot().setLocale(Locale.ENGLISH);
//or context.getViewRoot().setLocale(Locale.FRENCH);
context.getApplication().setDefaultLocale(context.getViewRoot().getLocale()); I have of course modified the file faces-config.xml.
This WORKS but for the current page only. The Locale is not propagated to the next pages of the application.
The Locale by default of my browser is English and so the next pages are always in English, even if i switch the first page to French.
Do you know how to propagate this Locale to all the pages of the application in JSF 1.2 ?
Also, has internationalization been improved in JSF 2.0 ?
thanks
The f:view has a 'locale' attribute. You should make use of it. Feed it with a property of a session scoped bean which you could control/change using for example some language dropdown menu or a request parameter or pathinfo. There is no need to traverse the FacesContext and UIViewRoot yourself.
For more about i18n in JSF, please consult the Sun JSF specification and the Sun Java EE tutorial.
Similar Messages
-
Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?
I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
Thanks again for "anyone" that can help me!!! -
I had download helper n my old computer, This computer broke. I have a new computer and wanted to know how I could get this on the new computer?
maybe you are talking about this?
* https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/
if yes simply go and click on '''Add To Firefox''' button >Restart your Firefox> and Enjoy :) -
I have installed the latest version of iOS in my ipad but forgot to backup the content, what should i do!!! I don't want my media and other data erased, how can i find back all the data in my ipad? I haven't restore ipad yet, so any others way can be use? Now my ipad is in recovery mode.
Once you are in Recovery Mode, it's too late to do any backup. I am afraid you are going to lose your data.
-
I DO NOT want to send anonymous reports to Mozilla about my computer usage and so on. How do I get rid of the question that comes up every time I open Fiorfox up?
See:
* https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel
* go to Firefox/Tools-Option-Advance and uncheck submit performance data -
I have just set up my email accounts, calendars etc on my new iphone5s, but seem to be stuck in 'Mail, contacts and calendar' section. How do I get back to the general settings page?
Solved! Turn it off and on again!
-
I do not have I Cloud on my Mac..I have checked system pref and its not there. how do I add I cloud to my applications?
Upgrade the computer to at least Mac OS X 10.7.2.
(78079) -
firefox 25.0 disabled kaspersky virtual keyboard and safe money ect how do i change back to the previous version as fire fox tells you to late in the update to back track
Hello Bretus,
Thank you for contacting Mozilla Support and I'm sorry this update isn't compatible with the extensions you're using.
The Kaspersky support forums mention that those extensions will be updated soon, so that they are compatible with FF25. In the meantime, we do not recommend that you downgrade your version of Firefox, but you can find instructions and download locations for previous versions here:
[[Install an older version of Firefox|Install an older version of Firefox]]
Please let us know if this solves your issue.
Cheers, Patrick -
Hi my name is Catherine I have downloaded digital editions and a book to my PC but wish to read this on an iPad. I have downloaded Digital Editions on the iPad and don't know how to authorize it. Will the book automatically download onto the iPad once tihis is done and I open my account on the iPad?
YOu can also use Bluefire Reader for reading books that need an Adobe ID. There are several ways to transfer a book to your iPad. One way is to email the acsm file, open the email on the iPad, and "Open in ... ". Another way is to use an app like Dropbox. The third way is to connect your iPad to your computer, open iTunes, select the iPad, and under Settings select Apps. Scroll down to the File Sharing apps, select the app you want the book on, on the right select Add, navigate to where the book is on your computer, and select it. Open the app on your iPad and it should load.
-
How to real the locale of the Server
Hi,
I need to read the locale of the server in java program. how to read the locale of the server.
Kindly help me.If your code is running on the server, then:
Locale default = Locale.getDefault();If it isn't, then you'll have to tell us about the protocol you have put in place whereby clients can request that information from the server.
You didn't do that? Then your clients can't get the default locale from the server.
Or you could tell us why you need to do that. Generally the client doesn't care about the server's locale. If you think it does, maybe that's a proposed solution to some other problem. -
I have an iphone and i turn it on and i can't seem to get passed the emergency calls bit i want to set it up how do i do this.
i get this when i try to download
This Connection is Untrusted
You have asked Firefox to connect
securely to swdlp.apple.com, but we can't confirm that your connection is secure.
Normally, when you try to connect securely,
sites will present trusted identification to prove that you are
going to the right place. However, this site's identity can't be verified.
What Should I Do?
If you usually connect to
this site without problems, this error could mean that someone is
trying to impersonate the site, and you shouldn't continue.
Technical Details
I Understand the Risks -
I am using Logic Pro X. I do not know how to fade the volume at the end of a song or raise / lower the volume in an area of the track. I also have a loud instand volume blip in a portion of a track that I would like to lower or eliminate.
Hi
rmarlia wrote:
I am using Logic Pro X. I do not know how to fade the volume at the end of a song or raise / lower the volume in an area of the track. I also have a loud instand volume blip in a portion of a track that I would like to lower or eliminate.
Armadillosound wrote:
To create a fade out press T to open the tool menu and select the fade tool.
Completely inappropriate, and they all also not help with volume adjustments. Fades will only apply to Audio Regions in the Tracks area: they will not fade out the complete mix unless you first Bounce it, add that to the Tracks area, apply the Fades with the Fade tool, then Bounce in Place (Again).
Much much better to make use of Track automation to take care of Volume adjustments, and to Fade out the end of the song by applying Track Automation to the Output Channel
https://help.apple.com/logicpro/mac/10/#lgcpb1a1ea03
CCT -
After using shift command 4 to send a photo to the desktop, how can I add iphoto to the list of"open with" menu ?
All that's doing is forcing iPhoto to import the image. Dragging it to the iPhoto icon will do the same, or create an automator action and save it as a Contextual menu item.
Regards
TD -
How can I cancel the remote erase the content and setting of my iPod touch by ( find my iPhone apps)? The iPod touch is offline and pending to erase! Please help!! Urgent
You can't cancel an erase command.
-
I downloaded the beta ichat and I hate it, how do I go back to the original one
I downloaded the beta ichat, guess its message now and I hate it, how can I get the original back
HI,
Go to the Messages Menu.
Click on the line that says Uninstall
This will delete Messages beta and reinstall iChat 6
Of course Messages will be released in Mountain Lion.
How close it will be to the Beta is not known (Or if it is, people cannot say due to NDAs (Non Disclosure Agreements)
7:39 PM Thursday; July 19, 2012
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images." No, Seriously
Maybe you are looking for
-
MM Document Reversed/Cancelled to make Vendor Debit Balance ZERO
Hi, The document is MM-Credit memo. Vendor Dr To GRIR Clearing To Contract repairs Now i wanted to make vendor balances zero by off setting the same accounts.Kindly advice me how to do it. I tried this scenario - Created PO-GR-IR and Credit Memo,
-
How do I get rid of mystery account?
I'm running Leopard on a MacBook. We bought this computer new but someone else in my company who didn't know Macs was the first to use this computer for some testing and they setup the initial admin account with their account information. Their accou
-
Downloaded mavericks for one mac can i use the same download to install on another mac
I have downloaded for 12 hours initial installation on one mac for mavericks, and all installed successfully. Rather than download again for another mac, can I use the same download and copy on to the other mac..and if yes, where will I find it?
-
I am trying to sync my iphone 4s to my windowns Itunes account. When i try to do it, the sync wants to remove all of the content on my phone and replace it with what is on my laptop, which has nothing yet. I am trying to move all of my purchased an
-
Unable to connect to VPN after upgrade?
Hi: I had a working VPN running on 10.3.9 Server which I could connect to without a problem. Now, from 10.4.7, I cannot connect to it anymore. I can connect to another 10.4.5 Server though. I wonder if something has changed in the client side with an