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.

Bug 128927 - I18N - Design view of the editor doesn't show localized strings
Summary: I18N - Design view of the editor doesn't show localized strings
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Winston Prakash
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2008-03-02 14:35 UTC by jiai
Modified: 2008-06-05 17:23 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The editor doesn't show localized texts. (86.61 KB, image/png)
2008-03-02 14:40 UTC, jiai
Details
Webproject - Testcase (22.22 KB, application/x-compressed)
2008-03-02 14:47 UTC, jiai
Details
Another screenshot (122.10 KB, image/gif)
2008-03-03 21:42 UTC, jiai
Details
My current test case. (22.77 KB, application/x-compressed)
2008-03-04 09:49 UTC, jiai
Details
Same application as tgz, compressed with Gnu tar -czf ... (16.41 KB, application/x-gzip)
2008-03-05 19:00 UTC, jiai
Details
Libraries and components view (193.86 KB, image/gif)
2008-03-05 23:18 UTC, jiai
Details
Resource bundle and loadBundle (187.36 KB, image/gif)
2008-03-05 23:20 UTC, jiai
Details
Current application (16.37 KB, application/x-gzip)
2008-03-05 23:25 UTC, jiai
Details
The browser window. (132.72 KB, image/gif)
2008-03-15 23:57 UTC, jiai
Details
The Woodstock 4.2 / Netbeans 6.1 project (3.03 MB, application/x-gzip)
2008-03-16 00:04 UTC, jiai
Details
The Woodstock 4.1.1 / Netbeans 6.0.1 project (Woodstock nbms) (16.66 KB, application/x-gzip)
2008-03-16 00:17 UTC, jiai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jiai 2008-03-02 14:35:34 UTC
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)
Comment 1 jiai 2008-03-02 14:40:33 UTC
Created attachment 57617 [details]
The editor doesn't show localized texts.
Comment 2 jiai 2008-03-02 14:47:53 UTC
Created attachment 57618 [details]
Webproject - Testcase
Comment 3 jiai 2008-03-02 14:51:00 UTC
Perhaps I should mention that I'm using Woodstock 4.2 Build 3 (02/25/2008).
Comment 4 Jan Horvath 2008-03-03 12:12:55 UTC
This issue will be fixed after the Beta
Comment 5 Ken Frank 2008-03-03 16:20:50 UTC
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
Comment 6 jiai 2008-03-03 21:39:46 UTC
> 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)
Comment 7 jiai 2008-03-03 21:42:45 UTC
Created attachment 57701 [details]
Another screenshot
Comment 8 Ken Frank 2008-03-04 02:03:51 UTC
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
Comment 9 jiai 2008-03-04 08:27:27 UTC
> 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>
    ...
Comment 10 jiai 2008-03-04 09:45:04 UTC
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) 
Comment 11 jiai 2008-03-04 09:49:51 UTC
Created attachment 57712 [details]
My current test case.
Comment 12 Winston Prakash 2008-03-05 14:58:57 UTC
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.
Comment 13 jiai 2008-03-05 19:00:00 UTC
Created attachment 57827 [details]
Same application as tgz, compressed with Gnu tar -czf ...
Comment 14 kaa 2008-03-05 19:36:28 UTC
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.

Comment 15 jiai 2008-03-05 22:20:52 UTC
@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.
Comment 16 jiai 2008-03-05 23:13:03 UTC
@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)
Comment 17 jiai 2008-03-05 23:18:39 UTC
Created attachment 57836 [details]
Libraries and components view
Comment 18 jiai 2008-03-05 23:20:22 UTC
Created attachment 57837 [details]
Resource bundle and loadBundle
Comment 19 jiai 2008-03-05 23:25:43 UTC
Created attachment 57838 [details]
Current application
Comment 20 jiai 2008-03-05 23:56:52 UTC
Problem 2: No, not worser - it is exactly the same behaviour as in Build 200803021202.
Comment 21 jiai 2008-03-08 19:23:36 UTC
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)
Comment 22 _ krystyna 2008-03-11 20:32:10 UTC
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.
Comment 23 Winston Prakash 2008-03-11 20:42:44 UTC
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.
Comment 24 Winston Prakash 2008-03-14 16:03:30 UTC
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
Comment 25 Winston Prakash 2008-03-14 20:04:09 UTC
Marking it as fixed for verification.
Comment 26 _ krystyna 2008-03-14 21:43:33 UTC
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?
Comment 27 jiai 2008-03-15 23:55:35 UTC
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.
Comment 28 jiai 2008-03-15 23:56:31 UTC
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)
Comment 29 jiai 2008-03-15 23:57:52 UTC
Created attachment 58437 [details]
The browser window.
Comment 30 Winston Prakash 2008-03-16 00:01:14 UTC
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.
Comment 31 jiai 2008-03-16 00:04:09 UTC
Created attachment 58440 [details]
The Woodstock 4.2 / Netbeans 6.1 project
Comment 32 jiai 2008-03-16 00:17:48 UTC
Created attachment 58441 [details]
The Woodstock 4.1.1 / Netbeans 6.0.1 project (Woodstock nbms)
Comment 33 jiai 2008-03-16 11:10:18 UTC
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...
Comment 34 jiai 2008-03-16 15:30:38 UTC
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? ;-)
Comment 35 Winston Prakash 2008-03-18 22:56:25 UTC
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.
Comment 36 Winston Prakash 2008-03-19 00:04:04 UTC
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?
Comment 37 Winston Prakash 2008-03-19 00:04:49 UTC
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?
Comment 38 jiai 2008-03-19 01:27:03 UTC
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? ;-)
Comment 39 Winston Prakash 2008-03-19 02:56:39 UTC
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?
Comment 40 kaa 2008-06-05 17:23:17 UTC
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.