| Issue 315: | Locale specific display | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. use setTitleKey(String x) instead of setKey(x) 2. put in keys in my resource bundle (backed by properties file) 3. run the project What is the expected output? What do you see instead? -empty display on the title of the column What version of the product are you using? On what operating system? -latest- Please provide any additional information below. -i might be missing a step on configuring the resource bundle? -i find no place that mention on injecting resourcebundle to a tablemodel Thanks everyone! Please notify me should this is not the place for discussion. I am new. Thanks!
May 12, 2011
Project Member
#1
jeff.johnston.mn@gmail.com
May 12, 2011
Yeah, I did followed this guide, and i pointed it to the properties file What I did, as follows: <context-param> <param-name>jmesaMessagesLocation</param-name> <param-value>MyResourceBundle</param-value> </context-param> and my directory -WEB-INF/ |-classes/ |-MyResourceBundle.properties |-MyResourceBundle_en.properties |-MyResourceBundle_ms.properties So the properties file MyResourceBundle.properties and its alliances is at WEB-INF/Classes/ However, in the MyResourceBundle.properties, I only defined key-value pair for my project-specific wordings. The ones from jmesa is not included. Is this another concern? Is this the correct configuration? Thanks in advance!
May 13, 2011
That is the correct configuration...do you get any errors? The only thing that I see that I did not expect was having a MyResourceBundle.properties file. But it should still work. If you have logging turned on you should see an error message saying that it cannot find the resource bundle. Also, make sure that your IDE is not removing these files. Typically you would put these files in your source directory and when you compile they get placed in with your classes. Are you using the tag library or API? What version of JMesa are you on? Once I know that I can show you how to debug this. We will get this!
May 13, 2011
Nope, I did not get any errors. I am using log4j, and I had included the required libraries for it, as according to https://code.google.com/p/jmesa/wiki/SLF4J I had also double checked the properties file in the server, and am sure that it has not been removed by the IDE. I am using jmesa 3.0.3 though... I am planning to switch to the use of taglib in future, but for now, it will be API due to shortage of time :| I am sure that this should work, an I am just missing somewhere.. Thanks for the advice in advance! :) BR/Nic :)
May 15, 2011
At this point the easiest way to debug this would be to just copy the ResourceBundleMessages.java into your project, fix up the package declaration, and then run it locally. You can inject it into your TableModel with the tableModel.setMessages() method. https://code.google.com/p/jmesa/source/browse/trunk/jmesa/src/org/jmesa/core/message/ResourceBundleMessages.java I will be curious to see what you find...the messages has been working really well overall.
May 18, 2011
Sorry for the late reply. Had been on leave few days ago. Alright, I will try that in my next step, and let you know the result! :) Thanks!! BR/Nic :)
Jul 11, 2012
I have the same issue, I have copied the ResourceBundleMessages.java in my project, and I have instanciated a WebContext with the request: HttpServletRequestWebContext WebContext = new HttpServletRequestWebContext(request); after the webContext is used in: ResourceBundleMessages kk = new ResourceBundleMessages("", WebContext); and the last thing is: System.out.println(kk.getMessage("html.statusbar.resultsFound")); The courious thing is that the request is in English Locale and the message appear in spanish, debugging I can see that the propertyResourceBundle is caching: CacheKey[org/jmesa/core/message/resource/jmesaResourceBundle, lc=es_ES, ldr=WebappClassLoader and it not take my new locale |