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 140398 - I18n - Client Stubs: Some of the generated code is not I18n'ed
Summary: I18n - Client Stubs: Some of the generated code is not I18n'ed
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Ayub Khan
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2008-07-16 19:42 UTC by Ayub Khan
Modified: 2008-10-10 17:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
image (100.58 KB, image/jpeg)
2008-07-17 13:01 UTC, kaa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ayub Khan 2008-07-16 19:42:39 UTC
From a user

------------------------
I checked new things with RESTful WS and noticed the following:

Product Version: NetBeans IDE Dev (Build 0710)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)

RESTful WS Client Stubs wizard generates TestStubs.html. This is a mix of pure html and javascript. The last one has
several hardcoded string literals in the resulting html page. Probably non-english user will not be able to read these
messages. Also I couldn't find any template for it. See rest_test_stub.JPG

Does it expected behavior or an issue?

thanks, Andrey 
------------------------------------
Comment 1 kaa 2008-07-17 13:01:45 UTC
Created attachment 64835 [details]
image
Comment 2 Ayub Khan 2008-07-30 14:08:24 UTC
All html files (Test*.html, Readme.html) are now localized. The mechanism we use here is, 

- html file templates has tokens that get replaced with contents from Bundle.properties. So
a user generating the stubs will see the html files in their locale.
- There is no provision to create Readme files in multiple locales as you will see 
in Readme files of major software distributions.

Changes, see
http://hg.netbeans.org/main/rev/5542b06a54fc
Comment 3 Ken Frank 2008-07-30 16:39:37 UTC
question about solution

will the html file generated have charset tag that has correct encoding so that it can
be seen ok in user's browser or in ide ?  the bundle files themselves will have messages
in escapped ascii format ie \u3333\u4444 .....

user might be running under some locale, but the encoding of the project might
be a different encoding, but am not clear which encoding might need to be used
for this generated html files.

ken.frank@sun.com
Comment 4 Ayub Khan 2008-07-31 00:40:43 UTC
Fixed, see http://hg.netbeans.org/main/rev/5de929e20ec5

IMO Readme and the all Test html files should use the project encoding if available, else use default "UTF-8". The fix
reads the project encoding and replaces them on these Readme and Test templates during Client stub generation. However
this is not dyanamically picked next time user changes the project encoding, which is IMO ok.
Comment 5 kaa 2008-08-11 17:45:33 UTC
Product Version: NetBeans IDE Dev (Build 200808101401)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22, Japanese locale

TestStubs.html has localized messages only within html content. The file contains javascript code also. It forms some
output strings in English. Does it expected behavior? See also comments for the issue 140368.
Comment 6 kaa 2008-10-10 17:23:29 UTC
Both files use project encoding.
verified: build 1005