Setting Locale
I am having trouble setting the locale for my web application.
I set the locale using UIViewRoot.setLocale() in a ValueChangeListener method on a managed bean. I more or less just copied this code from the cardemo application (CarStore.chooseLocaleFromLink()).
After choosing the locale, I fill out a separate form on the same page , hit submit and navigate to another jsp (configured by a navigation rule in faces-config).
At this point , things work great: the page is in the locale previously set. From this page, I click on a hyperlink which takes me to another page, and the locale previously set goes away. The locale for the page is the "default", or rather the locale requested by the browser.
What am I doing wrong?
Is there something different about navigating and linking to a page? Why does the locale not "stick" in the ViewRoot? What is resetting the locale?
Thanks,
Silmendil
Ok, I know it's lame to respond to one's own post but...(I wonder if they give me Duke points?)...
I think I got it working. This seems like a really hacked up solution that seems way too complicated but, so far, it works.
1. Create a session scope managed bean which holds current locale, we'll call it LocaleBean
2. In the event method which is responsible for changing the locale, get a reference to LocaleBean and set its locale to the new value. Call the FacesContext.renderResponse() method. For example,
public void changeLocale(ValueChangeEvent event)
String targetLocale = (String)event.getNewValue();
Locale locale = new Locale(targetLocale);
getLocaleBean().setLocale(locale);
FacesContext context = FacesContext.getCurrentInstance();
context.renderResponse();
}3. Override ViewHandler.
4. In the new ExtendedViewHandler class create a field of type Locale.
5. In the calculateLocale() method, return this Locale field.
6. Override the renderView() method: get a reference to the LocaleBean, get its Locale value and set it to the ExtendedValueHandler's Locale field, get the UIViewRoot from the context and call its setLocale() method, call the super class renderView method. For example:
public void renderView(FacesContext context, UIViewRoot viewRoot)
throws IOException, FacesException
_locale = getLocaleBean().getLocale();
UIViewRoot root = context.getViewRoot();
root.setLocale(_locale);
baseViewHandler.renderView(context, viewRoot);
}7. Override all the other required methods in ExtendedViewHandler call the super class method.
8. Configure the view-handler property in faces-config to take the ExtendedViewHandler class.
Similar Messages
-
Is it possible to set Local Currency - INR in SAP B1 8.81
Hi,
In SAP B1 Version 8.81 , i have taken Type -Chart of Accounts - as Global
and Localization - United Kingdom And just tell me is it possible to set
Local Currency - INR in SAP B1 8.81Hi,
You can set any currency till the time there is no transactions in the database.
Please do remember that the on selection of the Localization UK, the legal aspects and the tax law pertaining to the UK will be applicable and also you have to check for the exchange rate calculation based on settings (direct/indirect).
Also, taking INR as LC will lead to INR being the main currency and hence the reports generation and reconciliation of all the Multi-Currency will be performed in the Lead Currency.
All the Best.
Kind Regards,
Jitin
SAP Business One Forum Team -
How "not to set locale " in user's profile?
In the "Oracle Universal Content Management 11gR1 Differences between 11gR1 and 10gR3" document
http://www.oracle.com/technology/products/content-management/ucm/diffsbetween10gand11g.pdf
says:
"If locale is not set in a user’s profile, Content Server can pick that up from a HTTP header variable."
However, how do I "not to set locale " in user's profile? it appears as a dropdown list and there is no option to enter null.
ThanksHi there,
What you're changing is per-user but those options are set in the Utilities->System Properties applet
Here's how you change it:
Go to the System Properties applet:
UNIX: Start the System Properties utility by running the System_Properties script, which is located in the bin subdirectory of the Stellent Content Server installation directory.
Windows: From the Windows Start menu, select Programs -> Content Server Content Server -> [Instance Name] -> Utilities -> System Properties.
Then once the System Properties applet is started:
# Open the Localization tab.
# In the list of locales, you can Disable the locales you have here or maybe a new option with 11g will show up.
# When you are done, click OK to apply the setting and exit System Properties.
# Restart each instance of the content server.
Cheers,
malky -
Dear All,
please help me how to set locale in java and how it works.
please send me the link or code.
thanks in advance
Anjul Tyagi
Message was edited by:
Anjul
Message was edited by:
AnjulGraphicsEnvironment.getAllFonts
an array of available Fonts
Add a new Font with new Font() contructor.
Font f = new Font("Lucida Sans", font.PLAIN, 12)
Method Font.createFont(int, InputStream) provides
the ability to add fonts at runtime. -
How to set local path for load library
Hi,
How do i set local path for native dll as i dont want to set the path in the environment variable.
can i do like this
System.loadLibrary("c:\abc");
ThanksI believe that System.load() does exactly the same thing, but accepts fully qualified filenames. So give that a try.
Failing that.... maybe you can add -Djava.library.path=
to your command line to explicitely override the path set ?
regards,
Owen -
ABAP SET LOCAL LANGUAGE doesn't work
Hello Community,
actually i try to work in a ABAP report with the SET LOCAL LANGUAGE
statement to change the text environment on the fly to an other
language. In the debugger i can see that the SY-LANGU is changed to the
correct country but the messages are in the wrong language...
i also set the profile parameter install/collate/active = 1
I created a small testprogramm:
REPORT Z_STEFAN_TEST_002 MESSAGE-ID sabapdocu.
SET COUNTRY 'US'.
SET LANGUAGE 'EN'.
SET LOCALE LANGUAGE 'E'.
MESSAGE i014.
When i logon with language DE and start the programm, the messages are
also in DE and not in EN.
So can you help me to find a solution?
best regards,
StefanHi Stefan,
with set locale/language you can set only language environment for text-elements, headers etc...
I don't know about similar simple solution for messages, but you can load message directly from database table ...
DATA: l_text TYPE natxt.
SELECT SINGLE text FROM t100
INTO l_text
WHERE sprsl = 'E' AND
arbgb = 'SABAPDOCU' AND
msgnr = '014'.
MESSAGE l_text TYPE 'I'.
Regards
Matus -
EIS error - "Unable to set locale for GlobalC"
Hello all!
I'm working with Oracle Performance Scorecard and Oracle Integration Services to generate an Essbase cube. I'm not able no generate my cube from HPS even it doesn't showing any error in the screen but in the HPS log it shows the error message "Unable to set locale for GlobalC". So, i've noticed that the problem isn't with HPS, but EIS. I decided start the EIS shell (olapicmd.exe) and the same error message was showed in the cmd prompt. Could anyone help with this issue?
Regards,
RafaelHello!
I've opened a SR on Oracle support. They said that EIS doesn't work on 64 bits machine
At.
Rafael -
Doubt on set locale and translate
Hi,
If we use Set Locale then if the file is having multi Lingual data then what will happen when Translate is used ????
Thank youhi check this...
DATA text_tab TYPE HASHED TABLE OF string
WITH UNIQUE KEY table_line.
INSERT: `polo` INTO TABLE text_tab,
`pollo` INTO TABLE text_tab,
`chunky` INTO TABLE text_tab,
`crunchy` INTO TABLE text_tab.
SET LOCALE LANGUAGE 'E'.
SORT text_tab AS TEXT.
PERFORM write_text_tab.
SET LOCALE LANGUAGE 'S'.
SORT text_tab AS TEXT.
PERFORM write_text_tab.
SET LOCALE LANGUAGE ' '.
FORM write_text_tab.
FIELD-SYMBOLS <line> TYPE string.
LOOP AT text_tab ASSIGNING <line>.
WRITE / <line>.
ENDLOOP.
SKIP.
ENDFORM.
regards,
venkat. -
How to set local help as default in ID CS5?
Just received a replacement laptop w/CS5 installed & cannot figure out how to disable/turn off community help...I want it to default to local help whether connected to the net or not.
Thanks
Update Info:
Or, if setting local help as default is not possible, what about turning off or disabling internet sensing by the program? This will be used in the field and sometimes slow connections are the only thing available. Testing it on a dial-up connection, it just set there trying to access community help without allowing access to the local help until the dial-up connection was closed.Thanks Peter...I'd already found that, but when I first found it, the last section was not in that screen and in playing around, I found that Air was not installed proprly, uninstalled & re-installed that & that last section with the 2 ticks showed up & selected local help.
Next, I get a message that there is no PDF reader installed...but a working copy of AR7 is & it works...I'm thinking that CS5 should be uninstalled & re-installed, however, that will have to wait until I can get the laptop back to the company we're working for.
The community help window indicated the local help file to be 40Meg, but a search found no PDF that large on this machine.
Is this PDF available for direct download & I'll just access it outside of the help screen if necessary.
Laptop/program owner is in Canada, I'm visiting in Georgia & have an overseas flight on Wednesday... -
"couldn't set locale correctly" after jumpstart
Hi Guru,
I've encountered the message of
"couldn't set locale correctly" after jumpstart install of solaris 8 in Netra Sun machine.
I found the Java version is 1.2.2,
may I know how can I upgrade to Java 1.4.2?
Kindly advice.
Thank you very much.
Regard,
Goon FuiHi,
Looks like the locale is not set correctly.
You may set your environment.
From bash shell
bash# export LC_ALL=C
bash# export LANG=C
for c -shell.
setenv LC_ALL C
setenv LANG C
Hope this helps.
Regards
Pravat
Anytime I restart a server or perform any other
functions in my DSCC console I get errors saying
"couldn't set locale correctly". Everything works
fine but I still get the errors.
When I do a "locale" at the prompt I get the
following:
LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
Can anyone tell me what I need to do to fix this
problem?
Thanks,
MattIn your m/c fonts may not have set properly -
Hello,
I'm installing locale nam (en_US.UTF-8) from solaris 10 DVD as follows in a non-global zone:
localeadm -a nam -d /cdrom/sol_10_807_sparc/s0/Solaris_10/Product
It does install some packages and then prompts :
No solaris3 image has been found in
/cdrom/sol_10_807_sparc/s0/Solaris_10/Product
Please enter the path to this image/disk, or enter 'q' to quit:
(if this image is on CD-ROM, please mount the disk and give the path to the CD-ROM drive e.g. /cdrom/cdrom0)
But i dont know which DVD to insert because i have only one.
I select quit and then type locale -a:
# locale -a
C
POSIX
en_AU.ISO8859-1
en_AU.UTF-8
en_CA
en_CA.ISO8859-1
en_CA.UTF-8
en_NZ.ISO8859-1
en_NZ.UTF-8
en_US
en_US.ISO8859-1
en_US.ISO8859-15
en_US.ISO8859-15@euro
en_US.UTF-8
es
es_MX
es_MX.ISO8859-1
fr
fr_CA
fr_CA.ISO8859-1
iso_8859_1
Then i set LANG and LC_ALL variables for a user to en_US.UTF-8 and i get the error:
couldn't set locale correctly
Please advise how to correct this. Is it due to the additional DVD required...thanks Pascal,
I tried the command but still same problem:
Checking for a solaris3 in config file
|.|
No solaris3 image has been found in
/cdrom/sol_10_807_sparc/s0/Solaris_10/Product
Please enter the path to this image/disk, or enter 'q' to quit:
(if this image is on CD-ROM, please mount the disk and give the path to the CD-ROM drive e.g. /cdrom/cdrom0)
any other suggestions? -
How to set local currency in AR/Invoice through DI API SAP B1?
Dear Expert,
I am using DI API to add AR/Invoice document, but I can't find how to set local currency for BP with foreign currency.
This my code snip :
oSO = oCompany.GetBusinessObject(BoObjectTypes.oInvoices)
oSO.DocDate = dtpPostDate.Value
oSO.DocDueDate = dtpDueDate.Value
oSO.TaxDate = dtpDocDate.Value
oSO.Series = cSeries
oSO.DocNum = txtNumber.Text
oSO.DocCurrency = doccur
oSO.CardCode = txtBP.Text
oSO.CardName = txtName.Text
oSO.ContactPersonCode = cntctCode
oSO.JournalMemo = txtRemarks.Text
For i = 0 To dgv.RowCount - 2
oSO.Lines.SetCurrentLine(i)
oSO.Lines.ItemCode = dgv.Item(0, i).Value
oSO.Lines.ItemDescription = dgv.Item(2, i).Value
oSO.Lines.Quantity = dgv.Item(4, i).Value
oSO.Lines.Price = dgv.Item(5, i).Value
oSO.Lines.DiscountPercent = dgv.Item(6, i).Value
oSO.Lines.TaxCode = dgv.Item(7, i).Value
oSO.Lines.LineTotal = dgv.Item(9, i).Value
oSO.Lines.Currency = doccur
oSO.Lines.Add()
Next
lRetCode = oSO.Add()
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(sErrMsg, 16, "Attention")
Else
MsgBox("Operation completed successfully.", 64, "Information")
End If
When trying to Add, system show error message " Enter valid currency code [OINV.DocCur][Line:1], '$' "
I am not lucky after trying for a day , wish enlightenment from the experts here, Thank you.
My machine : SAP B1 9 PL 4
Best Regards,
Muh.UlfahHi
In the other thread I suggested that you can add document using interface first because there is a possibility that B1 doesn't accept this currency code not because you set it improperly in your code but because of some other reason, for example this currency is not valid for this particular business partner. Despite the fact that this way you can eliminate other possible problems you can also use DI to save an existing document as XML and check what is the actual currency code that B1 itself placed in the document lines object.
Afterwards you can again try to add document using DI.
btw
check this thread:
How to set local currency in sales order for BP with foreign currency through DI?
Kind regards,
Radek -
Setting Local Currency as default display in all accounting document displa
Hi,
I have a Requirement where I am looking to set Local Currency as default display in all accounting document display screen.
Can you please help me here.Hi,
I already followed this but this is not working. I still getting the FB03 figures by default in the Document Currency only and I have to Click the Display Currency Button to see the Figures in the Local Currency.
Is there is any way by which the Document display in Local Currency only and I don't have to press Display Currency Button to see them in the Local Currency. -
Set Locale ID extension for Dreamweaver 8
Is anyone aware of an alternative for the Set Locale ID server extension by Jason Parker as it returns an "Invalid Extension" when attempting to download it.
Using ASP pages with Access database which has suddenly started to reformat the date from an input form to the US format of mm/dd/yyyy instead of the programmed dd/mm/yyyy format. The error does not occur when the database is run locally, only when via the web server which makes me think that although the locale on the web server shows the UK locale of 2057 I need to add a server script to my ASP pages to ensure the dates are indeed in UK format.While hopefully one of our Add-ons community members may know the answer you will probably have better luck posting your question on the Dreamweaver forum as Add-ons is focussed on CS6 and up.
I hope you are able to find a solution.
Best,
Jonathan -
Machine fails to boot after setting locale
Hi,
I am trying to set the locale during the jumpstart. In my profile I set
locale en_US.UTF-8and in sysidcfg I set
system_locale=en_US.UTF-8The locale is correctly installed and /etc/default/init looks like
TZ=Europe/Stockholm
CMASK=022
LANG=en_US.UTF-8However when I type locale, I get
# locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=Using some info from
http://docs.sun.com/app/docs/doc/817-2521/6mi67tj5d?a=view
I changed the /etc/default/init to look like
TZ=Europe/Stockholm
CMASK=022
LANG=en_US.UTF-8
LC_ALL=""
LC_CTYPE=""
LC_NUMERIC=""
LC_TIME=""
LC_COLLATE=""
LC_MONETARY=""
LC_MESSAGES=""However when I reboot my machine, I get the following error from SVC:
Boot device: /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/disk@0,0:a File and args:
SunOS Release 5.10 Version Generic_118833-18 64-bit
Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
libscf.c:2060: scf_pg_get_property() failed with unexpected error 1007. Aborting.
Sep 1 16:26:50 svc.startd[11]: restarting after interruption
libscf.c:2060: scf_pg_get_property() failed with unexpected error 1007. Aborting.
Sep 1 16:26:51 svc.startd[14]: restarting after interruption
libscf.c:2060: scf_pg_get_property() failed with unexpected error 1007. Aborting.
Requesting maintenance mode
(See /lib/svc/share/README for additional information.)
Root password for system maintenance (control-d to bypass):Any ideas?I booted up the system in failsafe, than he asked me do i want to mount rw the / fs? tap y
then chmod 755 /a/etc/default/init
vi /a/etc/default/init
erase the LC_ALL line, and save, chmod 555 /a/etc/default/init
then reboot
it worked me fine -
Set Locale problem (Solaris)
Hello all,
I'm having problems to use the "pt_BR" locale at solaris. every time i try to start my weblogic with the locale set to pt_BR (LANG=pt_BR) i get an error message saying "could not set locale correctly".
Anyone here can help me ??? (PLZ!!)
Thank youevery time i try to start my weblogic with
the locale set to pt_BR (LANG=pt_BR) i get an error
message saying "could not set locale correctly".Check if the variables listed by "locale" are set to a value listed by "locale -a" otherwise you might get the error message you mentioned.
HTH Jochim
Maybe you are looking for
-
Does the Target Audiences setting work for Content Search Web Part Snippets?
I am attempting to create a page layout in SharePoint 2013 that contains a Content Search Web Part snippet. I only want the CS Web Part to appear for certain users in a defined SP Group. I set the Target Audience property during the generation of t
-
How do I turn turn off the right pane in Adobe Reader XI?
I have been using Adobe Reader since 2007, and recently I have been unable to turn off the right pane while reading. If anyone knows how I can deal with this problem, I would really appreciate it. Thanks Don Randall
-
To connect SAP B1 DI server using Webservice through PHP
Hi Experts, I want PHP to connect to SAP Business One using the DI server. using B1WS My configuration is: - SAP Business One on SQL Server - Apache 2 - PHP 5 Help will be Highly Appreciated...! Thanks Mritunjay Kumar
-
When I sync, where do my contacts and photos go?
Where do my contacts and phots go when I sync my phone? Need help retrieving them Please! The only thing that ever shows up is music downloads.
-
I wish to remove songs from the ipod, but can't seem to find a way. Any ideas on how to do this? thanks, Jessse