resourcebundle

Correct java.util.ResourceBundle Organization

让人想犯罪 __ 提交于 2019-12-31 07:10:34
问题 I have an internationalized project with many modules. Each module has its own set of bundles: - database-module + com_naugler_project_database.properties + com_naugler_project_database_fr.properties - mapping-module + com_naugler_project_mapping.properties + com_naugler_project_mapping_fr.properties However, many of the internationalized terms are redundant (such as 'OK' or 'Cancel') and I would like have these terms in one place for easier maintenance and development. I found this helpful

javax.el.PropertyNotWritableException: /index.xhtml @29,118 value=“”: Illegal Syntax for Set Operation

我的未来我决定 提交于 2019-12-30 10:19:57
问题 I want to create a login screen with localization option to translate the name and when i change from the default English to Arabic it crash here is the faces.config.xml <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0"> <application> <locale-config> <default-locale>en<

cannot resolve spring message code using messageSource

强颜欢笑 提交于 2019-12-30 07:13:36
问题 I am trying to hook up a messageSource in spring to use for my application. Its not working, gives this error: org.springframework.context.NoSuchMessageException: No message found under code 'validation_required' for locale 'en'. my applicationContext.xml contains this def for messageSource: <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>classpath:messages</value> </list> </property> </bean>

java.util.MissingResourceException

99封情书 提交于 2019-12-30 06:33:55
问题 I am getting below exception while running an application. This application read abc.properties file, Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name abc, locale en_US at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:853) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:822) at java.util.ResourceBundle.getBundle(ResourceBundle.java:566) at com.ibm.dst.DailyExtract.getResourceBundle(DailyExtract.java:104)

In Java how do I find out what languages I have available my Resource Bundle

て烟熏妆下的殇ゞ 提交于 2019-12-30 03:44:05
问题 I have some resource bundles packaged in my main jar widget_en.properties widget_de.properties I retrieve a resource bundle based on my default locale as folows ResourceBundle.getBundle("widget", Locale.getDefault()); But I want to present the user with a list of available languages supported so that can select a language that may be different to their computers default But I can't find a method in ResourceBundle that would list available locales, I don't want to hardcode a list as I may

How to use ResourceBundle

早过忘川 提交于 2019-12-29 07:35:10
问题 I'm trying to grasp internalization of java applications as shown here. I can't though. I have created a class that extends ListResourceBundle like stated and tried to retrieve the keys. I keep getting an exception though. If you check out the tutorial, it says to use .class files. This can't be right, can it? [PROJECT TREE] [Source code] Here are the two classes I'm using, just one of the MainWindow_xx_XX.java files since they're basically the same. First the ListResourceBundle: public class

JSF converter resource bundle messages

会有一股神秘感。 提交于 2019-12-28 13:35:15
问题 Does anyone know where I can get a list of the converters used by JSF so I can set a custom message for them in the resource bundle? 回答1: You can find them all in chapter 2.5.2.4 of the JSF specification. Here's an extract of relevance: javax.faces.component.UIInput.CONVERSION -- {0}: Conversion error occurred javax.faces.converter.BigDecimalConverter.DECIMAL={2}: ''{0}'' must be a signed decimal number. javax.faces.converter.BigDecimalConverter.DECIMAL_detail={2}: ''{0}'' must be a signed

How to remove the surrounding ??? when message is not found in bundle

梦想与她 提交于 2019-12-28 06:24:46
问题 In JSF 2.0, if a message is not found in the message bundle, then by default, the key is surrounded with ??? . This is a very usable hint during development. However, in my particular case, I really would like that those ??? were not present. I prefer that only the key would be rendered. E.g. when I do #{msg.hello} and the key 'hello' doesn't exist, then the page displays ???hello??? but I would like to show the bare key hello The message bundle is loaded in a JSF page as follows: <f

How to remove the surrounding ??? when message is not found in bundle

淺唱寂寞╮ 提交于 2019-12-28 06:24:04
问题 In JSF 2.0, if a message is not found in the message bundle, then by default, the key is surrounded with ??? . This is a very usable hint during development. However, in my particular case, I really would like that those ??? were not present. I prefer that only the key would be rendered. E.g. when I do #{msg.hello} and the key 'hello' doesn't exist, then the page displays ???hello??? but I would like to show the bare key hello The message bundle is loaded in a JSF page as follows: <f

How do I specify values in a properties file so they can be retrieved using ResourceBundle#getStringArray?

我们两清 提交于 2019-12-28 04:00:49
问题 I am trying to use ResourceBundle#getStringArray to retrieve a String[] from a properties file. The description of this method in the documentation reads: Gets a string array for the given key from this resource bundle or one of its parents. However, I have attempted to store the values in the properties file as multiple individual key/value pairs: key=value1 key=value2 key=value3 and as a comma-delimited list: key=value1,value2,value3 but neither of these is retrievable using ResourceBundle