具有值"en_FR"的SetLocale; [英] SetLocale with value "en_FR"

查看:56
本文介绍了具有值"en_FR"的SetLocale;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JSP的新手,对不起,如果我的问题不重要.我没有运气就试图研究答案.

Hi I am new to JSP so sorry if my question is trivial. I tried to to research the answer with no luck.

任何人都可以解释以下原因为何

Can anyone explain why the following wouldn't work

<fmt:setLocale value="en_FR" />  
<fmt:formatDate value="${dt}" type="both" var="now" />${now}

当前日期/时间将在en_US语言环境中显示.

the current date/time will be shown in en_US locale.

谢谢

推荐答案

en_FR的意思是:是英语的,具有法国法语的特殊性.由于英语在法国不是官方语言,因此JVM在法国的英语语言环境没有任何特定设置,因此回溯到en:英语.

en_FR means: in English, with the particularities of the English language from France. Since English isn't an official language in France, the JVM doesn't have any specific settings for the English locale in France, so it falls back to en: English.

由于enen_US之间的日期没有什么不同,因此格式是相同的.

And since there isn't anything different regarding dates between en and en_US, the format is the same.

这是一些测试及其显示的内容:

Here's some test, and what it displays:

<fmt:setLocale value="en_FR" />
In English (FR): <fmt:formatDate value="${dt}" type="both" var="now" />${now}<br/>
<fmt:setLocale value="en_US" />
In English (US): <fmt:formatDate value="${dt}" type="both" var="now" />${now}<br/>
<fmt:setLocale value="en_UK" />
In English (UK): <fmt:formatDate value="${dt}" type="both" var="now" />${now}<br/>
<fmt:setLocale value="en" />
In English: <fmt:formatDate value="${dt}" type="both" var="now" />${now}<br/>
<fmt:setLocale value="fr" />
In French: <fmt:formatDate value="${dt}" type="both" var="now" />${now}<br/>

显示:

In English (FR): Jan 23, 2012 2:40:24 PM
In English (US): Jan 23, 2012 2:40:24 PM
In English (UK): Jan 23, 2012 2:40:24 PM
In English: Jan 23, 2012 2:40:24 PM
In French: 23 janv. 2012 14:40:24

这篇关于具有值"en_FR"的SetLocale;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆