This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When using localized strings the design view of the editor shows no text! This is a regression, in all previous versions 5.5.1, 6.0, 6.0.1 this feature works with the resource bundle. For me this is a P1 bug because an important tool for building a localized webapplication isn't available. Please don't argue that the JSP view is enough and therefore such a high priority isn't appropriate - in this case using Netbeans isn't appropriate and you can use faster IDEs or Editors with fewer bugs than Netbeans 6.x! Product Version: NetBeans IDE Dev (Build 200803020002) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)
Created attachment 57617 [details] The editor doesn't show localized texts.
Created attachment 57618 [details] Webproject - Testcase
Perhaps I should mention that I'm using Woodstock 4.2 Build 3 (02/25/2008).
This issue will be fixed after the Beta
can you clarify about localized strings ? Are these labels of a component that has been placed onto design view for a visualweb project ? (or rather a web project with visualweb frameworks ?) I did not see in the attached image in the properties section of where the localized text was - can you clarify about it ? Also, when you say you are using certain woodstock components, are these the ones that are in netbeans 6.1 build or did you install some other ones. Finally, what project encoding property is of your project and what OS locale are you running netbeans in. ken.frank@sun.com
> can you clarify about localized strings ? Are these labels of a component that has > been placed onto design view for a visualweb project ? (or rather a web project > with visualweb frameworks ?) The first one - they are labels of components that has been placed onto design view of a visual web project. You can try out this project, it is my second attachment for this thread. Following syntax: ... <webuijsf:html id="html1"> <f:loadBundle basename="webapplication6.Bundle" var="messages1"/> ... <webuijsf:staticText id="staticText1" style="position: absolute; left: 288px; top: 216px" text="#{messages1.Hello}"/> ... > I did not see in the attached image in the properties section of where the localized > text was - can you clarify about it ? The picture shows a static text component at top (with four rectangles at the corners) and a property sheet below. The last one should have a section headline. The text is marked with the chain symbol (the missing text is one of the not worth mentioning Netbeans bugs). I've attached another picture from another example which shows text. > Also, when you say you are using certain woodstock components, are these the ones > that are in netbeans 6.1 build or did you install some other ones. Both cases: Tonight the ones that are in Netbeans 6.1, at work the nbms which can be downloaded at the woodstock site - at both version the localized strings/labels - whatever - aren't shown. > Finally, what project encoding property is of your project and what OS locale > are you running netbeans in. Project encoding is UTF-8, Page encoding is UTF-8, OS locale is: Cp1252; de_DE Tonight the Netbeans version is the following one - at work: see my first posting Product Version: NetBeans IDE Dev (Build 200803021202) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows 2000 version 5.0 running on x86; Cp1252; de_DE (nb)
Created attachment 57701 [details] Another screenshot
thanks for explanations; some followup questions: 1. what about at runtime; does the message come from the bundle_de.properties if run in de locale ? And do you modify the faces-config.xml to add the locales of interest ? (see nb6.0.1 release notes for more on this; it might not be needed for this situation however). We'll look at this further. ken.frank@sun.com
> 1. what about at runtime; does the message come from the bundle_de.properties > if run in de locale ? Interesting question - I've seen some strange things yesterday evening. Perhaps the whole I18/L10N mechanism is broken for woodstock components. I'll try to investigate this before lunch. > And do you modify the faces-config.xml to add the locales of interest ? > (see nb6.0.1 release notes for more on this; it might not be needed for this situation > however). Yes - you can see it in my sample test-case: <?xml version='1.0' encoding='UTF-8'?> <!-- =========== FULL CONFIGURATION FILE ================================== --> <faces-config version="1.2" 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_1_2.xsd"> <application> <locale-config> <default-locale>de</default-locale> <supported-locale>en</supported-locale> </locale-config> </application> <managed-bean> ...
In my eyes the whole internationalization/localization mechanism for Woodstock components seems to be broken! Application - locale config is ignored. In my case the browser view shows only the texts for the german locale, even if the browser language settings are accepting english content only (perhaps because the server machine locale is de?). The same applies to the loadBundle mechanism. I've tested it with a vanilla Netbeans 6.1 (Server is Glassfish V2ur1): Product Version: NetBeans IDE Dev (Build 200803021202) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)
Created attachment 57712 [details] My current test case.
I'm not able to download your attachments (projects). I get "invalid archive" error. Did you set the mime-type to zip while uploading the attachment. Any way could you check the following for me. - For the components to display the localized messages, the localized jar need to be in the classpath. When the project is created, the localized jars are added to the Library. Could you expand the Library nodes under the project node and see if the localized jars are added. Make sure to look at the library node in 5.5.1, 6.0, 6.0.1 and see if they exists there - Go to <ide-install>/visualweb2\modules\ext\locale and see if the localized jar exists there. There could be two problems. - When the project is created the localized jar is not added (system default localized jar) from <ide-install>/visualweb2\modules\ext\locale - The system locale jar may not exists at <ide-install>/visualweb2\modules\ext\locale. While you update to 4.2, the localized jars might not have updated.
Created attachment 57827 [details] Same application as tgz, compressed with Gnu tar -czf ...
Product Version: NetBeans IDE 6.1 Beta (Build 200803041230) Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05 System: Windows XP version 5.1 running on x86; MS932; ja_JP I'm working in Japanese locale and I was able to get things working with your project. I did the following: 0. Open Design view of the Page1.jsp 1. In the Navigator expand for example Page1->page1->html->body1->form1->propertySheet1->section1->property1 2. Right click selected node (property1) then enter new binding expression #{messages1.HelloWorld} 3. Press Apply button 4. Close Dialog 5. Changed to the default locale (ja in my case) in faces-config.xml: <default-locale>ja</default-locale> 6* In my case I added ja_JP locale to the Bundle.properties with a new value for HelloWorld key using ja chars 7. Run the App The Label was shown in Japanese. Try to use my steps and fix your bindings.
@kaa: I think I've done what you've described - perhaps you might have taken a look into my project and into my code snipplets in this thread... O.K. There are three problems which we must differentiate: 1. Problem: Localized text isn't shown in the design view of Build 200803021202 2. Problem: If you are using resource bundles (<f:loadBundle>), the default locale must be the one of the server machine, the supported locale can be another one - only and exactly in this configuration the decision by browser seems to work for loadBundle. At least in Build 200803021202 When you are using the english locale as default on a server wich has the german locale set, the loadBundle mechanism doesn't work. 3. Problem: The localized parts of Woodstock components are using the server (or default - whatever) locale, they ignore the browser settings, at least in Build 200803021202. Is this perhaps a caching problem? It shouldn't because my browser should delete its cache when it is terminated. I've seen the following path in the Libraries for webui-jsf.jar: jar:nbinst:///modules/ext/... Is this correct, shouldn't it be jar:nbinst:///visualweb2/modules... ? I'll test these problems with the current build tonight.
@wjprakash: I've attached another sample project as a tgz and several screenshots showing the libraries and resource bundle. Problem 1: persists in Build 200803051205 Problem 2: Seems to become worser - if browser locale != default locale nothing is shown in the browser. Perhaps I've destroyed something. It is too late ... I've changed "de" to "de_DE" and "en" to "en_US". Problem 3: See problem 2 Product Version: NetBeans IDE Dev (Build 200803051205) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows 2000 version 5.0 running on x86; Cp1252; de_DE (nb)
Created attachment 57836 [details] Libraries and components view
Created attachment 57837 [details] Resource bundle and loadBundle
Created attachment 57838 [details] Current application
Problem 2: No, not worser - it is exactly the same behaviour as in Build 200803021202.
A hint from Netbeans 6.0.1 for problem 1: When you open such a localized page in 6.0.1, the texts aren't displayed at first - you have to make a "refresh" (click the ringlike arrows in the Design view of the editor toolbar). After this action the localized texts are displayed. In 6.1 this doesn't work. Is this ability perhaps killed by one of your optimizations? Product Version: NetBeans IDE 6.0.1 (Build 200801291616) Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)
Tested in 6.0 newVar="hello" in bundle.properties bound to a static text component renders "hello" text in the designer; but in NetBeans IDE Dev (Build 200803111205) it does not.
Thanks Krys. That could be the problem what Jiai is seeing. Let me take a look at and see if the "DesignimeBundleResolver" is misbehaving, though nothing has been changed in this area.
Fixed now. Turned out, tt was a stupid mistake of mine. I turned off the Designtime Variable resolving during performance analysis time and forgot to turn it back on. Committing 1 file to repository for JSF Components Design-Time Base: /Users/winstonp/netbeans/main/visualweb.jsfsupport.designtime/conf/faces-config.xml
Marking it as fixed for verification.
Verified that bound bundle properties show in designer. NetBeans IDE Dev (Build 20080314171418) jiai, could you please verify with any hudson build 1073 or after, that this fixes all of your issues?
Problem 1: solved Problem 2: solved Problem 3: unsolved. The Woodstock 4.2 components (as delivered and configured with Netbeans 6.1) are ignoring locale config settings. For me it looks like they are using the server locale, not the browser settings. I've tested it with the Woodstock 4.1.1 components too - they behave as expected, showing the localized text for the browser locale. I've added 3 attachments: 1) A browser screenshot - <f:loadBundle> works as expected, localization of Woodstock components is broken. 2) The project from which the screenshot was taken as a tgz archive. 3) A working 4.1.1 project showing a Woodstock component with localized texts.
Product Version: NetBeans IDE Dev (Build 200803151203) Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19 System: Windows 2000 version 5.0 running on x86; Cp1252; de_DE (nb)
Created attachment 58437 [details] The browser window.
Since #3 certainly seems to be on Woodstock side, it is better to file a bug in Woodstock Issueszilla. I'll do that on Monday.
Created attachment 58440 [details] The Woodstock 4.2 / Netbeans 6.1 project
Created attachment 58441 [details] The Woodstock 4.1.1 / Netbeans 6.0.1 project (Woodstock nbms)
One should never test saturday night, do it better on sunday morning... Problem 2: persists, but it is a more general problem and affects the loadBundle mechanism of 4.1 and 4.2, because it is a JSF implementation issue! The problem is engrained into the default-locale mechanism of JSF, perhaps in the JSF implementation of glassfish itself. The default application locale depends on the locale of the server machine. This is an erroneous behaviour and is not specified in this way. I assume the observed difference between Woodstock 4.1 and 4.2 depends on different implementations of this mechanism for the components. The following configuration works with <f:loadBundle>: * Server locale is de_DE * Application default locale is de_DE * Application supported locale is en_US => Browser locale (en, en_US) is supported The following configuration doesn't work with <f:loadBundle>: * Server locale is de_DE * Application default locale is en_US * Application supported locale is de_DE => Browser locale (en, en_US) is not supported, text in the server default locale is displayed This is a serious deployment problem because most developers on Windows (at least in Germany) are using their appropriate locale, while production servers are using the en_US locale or the servers are Unix/Linux machines with en_US settings. I think this is a relict of times when localized security updates are deployed later than en_US updates. Newertheless: A web application localization/internationalization mechanim must not depend on the server locale! Do you remember: "Write once, run anywhere"? OK, that's a joke, I know...
Often you feel with Netbeans like Asterix in "The 12 Tasks of Asterix", trying to find find permit A-38 in "The Place That Sends You Mad": After updating to Woodstock 4.2.4, WebApplication10 works with en, resp. en_US settings in a browser. But if you are using de resp. de_DE settings in a browser (which is the application default locale) the components texts are in english further on. I assume this is the default language for the components. Do you know what Asterix has done to get permit A-38? ;-)
I'm going to file this bug with woodstock guys, hopefully they would give you the "Permit A-38". The real problem is you forgot to ask for the "imaginary permit" as Asterix did. BTW, I love "Asterix Comics", you can never grow old for them.
Before I file the bug with woodstock, I have a quick question. What do you mean by the "Application Locale". Since the Web Application lives in Appserver, isn't it's locale will be derived from the Server's Locale. In JSF you specify the default locale and supported locale as <application> <locale-config> <default-locale>it</default-locale> <supported-locale>en</supported-locale> <supported-locale>de</supported-locale> <supported-locale>fr</supported-locale> </locale-config> </application> In the above case, if the browser's locale is any of supported locale "en, de, fr", then the response will be in that locale. If not it will be the default locale "it". However, if the any of the above is not specified (or the corresponding jar is not in the WEB-INF/lib), then it would defaults to the server's locale. Is the above not true in your case?
Is the default locale of an application the same as the default locale of a server? In my sense not. The server locale should be the last fallback, that's true. But in my sense, a default application locale must not necessarly be the server locale. An application should be as server agnostic as possible. Or is it common sense that server locale and application default locale are the same? Is in your sample the application locale "it" the same as the server locale? It becomes a problem when you develop and test on an "it" locale and deploy on an "en" locale. The war-deployment-mechanism is lapsed in that case. If you have time, you might take a look at the I18N problems of Woodstock, there seems to be a lot of them. Perhaps they are due to different opinions of that problem? I'm waiting for a "stable" nightly build of NB 6.1 DEV to test the inbuild 4.2.4 Woodstock components, today there seems to be problems with Netbeans builds. By the way, do you know about circular letter B-65 and permit A-39? ;-)
I have filed a Woodstock issue for further tracking. https://woodstock.dev.java.net/issues/show_bug.cgi?id=1129 Closing this bug as fixed (part 1 at least) > By the way, do you know about circular letter B-65 and permit A-39? ;-) No, what is it?
checked with trunk build 0603, WinXP, ja locale. My faces-config.xml has the following settings: <application> <locale-config> <default-locale>en</default-locale> <supported-locale>ja</supported-locale> </locale-config> </application> Since problems 1, 2, and 3 are listed in the Woodstock issue1129. I'm verifying fixed/working part: Problem #1 looks fixed - localized messages are shown ok on the design tab with loadBundle component. Problem #2 looks ok when the server has ja locale and my browser was started using another hw in en locale.