【问题标题】:Internationalization jsp page?国际化jsp页面?
【发布时间】:2013-08-29 14:56:56
【问题描述】:

我有下面的jsp代码。

<section class="loginform cf">  
    <form name="login" action="index_submit" method="get" accept-charset="utf-8">  
        <ul>  
            <li><label for="usermail">Email</label>  
            <input type="email" name="usermail" placeholder="yourname@email.com" required></li>  
            <li><label for="password">Password</label>  
            <input type="password" name="password" placeholder="password" required></li>  
            <li>  
            <input type="submit" value="Login"></li>  
        </ul>  
    </form>  
</section>  

在这里我想将所有标签名称外部化,标签名称将根据区域设置显示。 基本上我需要 i18n 作为 jsp 标签。我该怎么做?

谢谢!

【问题讨论】:

标签: java html jsp internationalization


【解决方案1】:

最简单的方法是为您希望在其中添加标签的每个 country_locale 创建属性文件,并根据用户的区域设置从正确的文件中提取值(例如,使用 label_properties_ 格式)。每个文件中的属性名称可以保持不变,但该文件的值应该是正确的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-14
    • 1970-01-01
    • 2018-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多