[
http://issues.apache.org/jira/browse/MYFACES-641?page=comments#action_12332481
]
Lee Smith commented on MYFACES-641:
-----------------------------------
Further comment, I've found a resolution to this problem and found its actually
expected behaviour from reading the JSF specs.
In JSF you configure it to specify which locales you support using the
<locale-config> element on the <application> element in the faces-config.xml.
JSF then uses this information and pulls out the correct locale from this list
based upon the one supplied by the user (or more acurately their browser). If
the locale the browser want's isn't available, JSF uses a default locale.
If the <locale-config> element is not specified, the spec's don't define how
JSF should determine the available locales. I guess this is where the
difference between the RI and MyFaces must occurr - the RI must just pull the
locale of the underlying JVM (which is probly en_US in your case), whereas
MyFaces may return what it deems to be the default locale (probly just en).
To fix this, i added the following to my faces-config.xml:
<application>
<locale-config>
<default-locale>en_GB</default-locale>
<supported-locale>en_US</supported-locale>
<supported-locale>en_GB</supported-locale>
</locale-config>
</application>
This should use USD if the browser is in US, GBP if the browser is in GB, and
GBP otherwise. Doing the above ensures that even if the browser just supplied
'en' as the locale, I would still display a GBP symbol.
As you want USD, you would want to change the <default-locale> element to en_US.
Cheers, Lee
> <f:convertNumber type="currency"/> not working properly.
> --------------------------------------------------------
>
> Key: MYFACES-641
> URL: http://issues.apache.org/jira/browse/MYFACES-641
> Project: MyFaces
> Type: Bug
> Components: General
> Versions: 1.1.0
> Environment: Win XP Professional SP2
> Reporter: Tim Mashinter
> Priority: Minor
>
> <h:outputText value=#{object.dollarAmount}">
> <f:convertNumber type="currency"/>
> </h:outputText>
> When using the sun implementation of JSF it outputs the following: $1,200.55
> When using the MyFaces implemenation if output the following: ยค1,200.55
> The pattern being used is correct. But the currency symbol isn't
> automatically determined based on my locale the same way the SUN
> implementation is done.
> Having this automatically determined based on the systems locale makes this
> better for applications aiming to support multiple languages (I18N).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira