Facelets 图像的国际化 (i18n)。是否可以?
是否可以国际化facelets图像?如果是这样,怎么办? 我是否为它创建一个捆绑文件夹,就像消息捆绑一样? 如何在facelets-config.xml 文件中配置它(假设这是可能的)。我也愿意尝试icefaces、trinidad、rich faces,只要它们中的任何一个都可以提供此功能。尽管我非常不确定其中哪一个最好用。我 我正在使用 Maven 与 Nexus 和 JBoss 存储库,准备好找到任何需要的插件(我希望)。
Is it possible to internationalize facelets images? If so, how?
Do I make a bundle folder for it like for message bundles?
How does one configure it in the facelets-config.xml file (presuming it's possible). I am also open to trying icefaces, trinidad, rich faces provided that any of them make this functionality available. Although I am very unsure as to which of these is the best to use. I
am using Maven with both Nexus and JBoss repos ready find any needed plugins (I hope).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是在图像的路径或文件名中包含特定的区域设置,并确保每个受支持的区域设置都存在这些图像。这样您就可以按如下方式引用它们:
(需要例如
images/en/foo.png
、images/sp/foo.png
等)或
(需要例如
images/foo_en.png
、images/foo_sp.png
等)或者如果您不一定有每个区域都有一个单独的图像,因此需要能够要为没有单独图像的语言环境提供后备图像,那么最简单的方法是在本地化包文件本身中指定图像路径/文件名:
例如默认包:
以及具有以下内容的特定于语言环境的包图片:
并按如下方式引用它们
Easiest would be to include the specific locale in the image's path or filename and making sure that those images exist for every supported locale. This way you could reference them as follows:
(which expects e.g.
images/en/foo.png
,images/sp/foo.png
, etc)or
(which expects e.g.
images/foo_en.png
,images/foo_sp.png
, etc)Or if you don't necessarily have a separate image for every locale and thus need to be able to have a fallback image for a locale which doesn't have a separate image, then the easiest would be to specify the image path/filename in the localized bundle file itself:
E.g. the default bundle:
and the locale-specific bundle which has the image:
and reference them as follows