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 27030

Summary: I18N - welcome window not fully localizable
Product: ide Reporter: Ken Frank <kfrank>
Component: UIAssignee: issues@ide <issues>
Status: VERIFIED FIXED    
Severity: blocker CC: jf4jbug, jglick, mihmax, rgregor
Priority: P2 Keywords: I18N
Version: 3.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:
Attachments: shows welcome window
proposed patch
proposed patch 3/3
change to nbresloc use already commited into trunk
unlocalizable images(Customizing,Help,Tips) replaced by new ControlLabel component with text from bundle - patch already in trunk

Description Ken Frank 2002-09-04 17:10:33 UTC
In welcome window, not all labels/text come
from html or bundle files within welcome.jar

Richard mentioned that the third column is from
gifs instead, but for ffj localization, this
information would need to be in bundle or html
files.

Also, some of the links under help do not show
fully when pseudo translated - that is, their
window does not resize to fit; user should not
need
to resize in other locale if the window shows
fully
in C locale.
(image will be attached - please note, not all
parts have multibyte since I just pseudo localzied
a few parts of welcome window for testing)
Comment 1 Ken Frank 2002-09-04 17:18:48 UTC
Created attachment 7315 [details]
shows welcome window
Comment 2 Patrick Keegan 2002-11-06 13:08:23 UTC
reassigning to the UI team
Comment 3 _ mihmax 2002-12-22 12:50:38 UTC
Created attachment 8387 [details]
proposed patch
Comment 4 _ mihmax 2002-12-22 12:55:28 UTC
I also found out that "Next" button (in Tips section) is not localized
at all.

The proposed patch fixes these two issues for me - for 3.4.1 RC +
Russian L10N:
- GIF files for Customizing, Help, Tips are searched with locale in mind.
- Next button under tips takes its label from the Bundle.

Please, verify.
Comment 5 _ mihmax 2002-12-22 13:04:51 UTC
Adding 3.4.1_CANDIDATE keyword,
I'd like this be included in Merak RC2 (approx 3rd January)

Please verify the proposed patch soon ;-)
Comment 6 _ mihmax 2002-12-22 15:34:15 UTC
Created attachment 8388 [details]
proposed patch 3/3
Comment 7 _ mihmax 2002-12-22 15:36:31 UTC
proposed patch 3/3 additionally resises Help section, so now the
solved issues are:
- Unresizable Help section
- Unlocalizable "Customizing", "Help" and "Tips" images
- Unlocalizable "Next" button.

Please, verify/review.
Comment 8 Ken Frank 2002-12-22 18:05:21 UTC
Had a few questions about solutions to this issue --

- I'd heard that welcome window will be completely redesigned --
is this solution that redesign ?

- Will any gifs have any text as part of it, that would need to
be localized ? If so, this is not a good solution for our s1s
localization as we are not now localizing gifs

- Does this solution not require changes to the welcome.jar html
files to point to names of localized gifs, ie xx_ja.gif -- other
parts of netbeans or s1s do not require this and find gifs from
locale without special changes.

- Is this change to be for the netbeans that nevada or dublin
s1s is based on ? 


ken.frank@sun.com
Comment 9 _ mihmax 2002-12-22 21:57:40 UTC
Ken, quick answer is _no_:
- this is _not_ a redesign, this is a quick bugfix of this specific
issue, which states that Welcome window is not localizable at all.
- no, those gif-s with text on them were not removed, I just gave a
solution (tested with Russian l10n) to localize these .gifs
- no, this solution still requires renaming all used .gifs to _locale.gif
- I'm not aware what Dublin or Nevada mean ;-), I may say that my
intent to include this bugfix into Merak (nb3.4.1), solely for the
purpose of Russian l10n.

I'm pro complete redesign, but it must be done by UI people, not by me
myself, I just want to be sure that Russian l10n works, and this fix
gives such an opportunity. I'm heading Netbeans _volunteer_
translation team:

http://translatedfiles.netbeans.org
Comment 10 Jesse Glick 2002-12-23 16:24:42 UTC
I am not sure that the patch here is actually addressing the filed
issue. Perhaps it should be filed separately. There are too many
things mentioned in this issue:

1. Unlocalized labels and text (apparently fixed by patch)

2. GIFs used rather than text, harder to localize (not fixed by patch)

3. Links do not resize properly (fixed by patch?)

Ken next time please file one issue per problem to avoid confusion.

Ken writes: "Will any gifs have any text as part of it, that would
need to be localized ? If so, this is not a good solution for our s1s
localization as we are not now localizing gifs" - this seems
unwarranted. Maxym's patch is just making it *possible* to localize
them. If you don't want to localize them, don't localize them. BTW you
filed a P2 DEFECT for me to make all action icons localizable by
default, which I implemented...

Maxym writes: "no, this solution still requires renaming all used
.gifs to _locale.gif" - maybe a misunderstanding; the patch just does
a localized lookup, so if there are no localized variants, there is no
need to change existing filenames, so don't worry.

Re. the patch, some minor requests:

1. In ControlPanel, as far as the icons go, a little nicer to patch
both .java and .form; and rather than overriding the non-I18N icon
after calling initComponents, do it directly (custom code option for
icon property) in the form editor. Will make things cleaner for the
next person working on the form using the form editor.

2. In TipPanel, please use NbBundle.getBundle (or .getMessage) rather
than ResourceBundle.getBundle; makes things brandable.

3. A couple uses of ResourceBundle.getBundle in
ControlPanel.{java,form} ought to be fixed, too; when using the form
editor, just set the replacement string option to be the kind using
NbBundle (this is a predefined setting for convenience of NB module
developers).

Otherwise looks fine.

Maxym it is probably best to make the fix in the trunk so it can be
sanity-checked in some dev build. You checked that the fix is
sufficient for Russian localization, I am guessing.
Comment 11 _ mihmax 2002-12-23 21:22:31 UTC
2Jesse:
------- 1 --------------
When .html file contains images, e.g. welcome.html contains new.gif,
then when I localize welcome.html, for some unknown reason the image
is not displayed (see attached screenshop),

so I have to rename new.gif -> new_ru.gif and change the <IMG> tag to
use new_ru.fig instead of new.gif in my welcome_ru.gif.

I dunno why this happens, maybe because images should belong to the
same .jar as .html ?
---------- 2 ---------------
What's "custom code option" for icon editor? I didn't find it.
Comment 12 _ mihmax 2002-12-23 21:31:08 UTC
> 3. A couple uses of ResourceBundle.getBundle in
> ControlPanel.{java,form} ought to be fixed, too; 

Jesse, File separate issue, please ;-)

> when using the form editor, just set the replacement
> string option to be the kind using NbBundle (this 
> is a predefined setting for convenience of NB 
> module developers).

Ahm, predefined where :-? (for dummies, please) Tools->Options->...
Comment 13 Jesse Glick 2002-12-23 23:09:38 UTC
"When .html file contains images, e.g. welcome.html contains new.gif,
then when I localize welcome.html, for some unknown reason the image
is not displayed" - ah yes, now that I look at the code for
ContentPanel, it needs some rewriting. The constructor takes some
resource path and then tries to append a language string, then fall
back on something else, etc... much too complicated and not really
correct. All it needs to do is make a URL of the form
"nbresloc:/org/netbeans/modules/welcome/pages/welcome.html" (or
welcome_1_3.html or welcome_1_3_lin.html as appropriate) and set that
as the URL for the editor pane. This will:

1. Be simpler and easier to read.

2. Work correctly for country & region variants of languages.

3. Work correctly with branding.

4. Not require images to be copied when doing a localized version of a
page.

So please fix it that way. Same for HelpPanel.

"What's "custom code option" for icon editor?" - in the form editor,
when setting the 'icon' property for a label, press "..." and select
the Advanced button (or something like this) and type in your custom
code to use NbBundle.getLocalizedFile. More easily, I think the
standard icon editor in the form editor lets you type in a URL; just
use a URL of the form "nbresloc:/org/..../welcome/whatever.gif" and it
will automatically be localizable.

"set the replacement string option to be the kind using NbBundle" -
"Internationalization" settings in Options, "I18n String Format"
should be:

org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}");

Since you're not the original developer of this code, I would
recommend waiting for someone more familiar with it to check over your
proposed diff before applying it to 3.4.1...depends on how comfortable
you are patching it yourself. Note that most Sun employees working on
NB have been on vacation for at least a week and will be on vacation
until early January, so if you want any help on RC2, this is not a
good time.
Comment 14 Richard Gregor 2003-01-02 13:18:25 UTC
Created attachment 8417 [details]
change to nbresloc use already commited into trunk
Comment 15 Richard Gregor 2003-01-02 14:03:58 UTC
Created attachment 8418 [details]
unlocalizable images(Customizing,Help,Tips) replaced by new ControlLabel component with text from bundle - patch already in trunk
Comment 16 _ mihmax 2003-01-02 16:23:34 UTC
Richard, thanks a lot, have you commited it into 4.0dev ?
I'll look through and integrate it into release341 branch tomorrow.
(curr. working on issue 29585).
Comment 17 Ken Frank 2003-01-02 17:43:05 UTC
I'd like to comply with Jesse's suggestion below that separate
issues be filed since the original description spoke of more than
one situation.

Richard and Maxym, based on fixing already done that will be or
already are in trunk, are there any other parts of this issue
that could need to be filed as separate issues ?
(I think UI group doing redesign of welcome window but don't
know if an issue has been filed on that task)

And a separate question on todays fix using ControlLabel component
with text from bundle -- does this fix take care of all welcome
window related images, or just those 3 mentioned ?
(so that changing names of image files in html file and creation
of xx_ja.gif still would be needed for now ?)

Thanks - Ken
Comment 18 Richard Gregor 2003-01-03 07:48:21 UTC
Maxym, my patches are in trunk. 
Ken, it is true that core(performance) and HIE think about welcome
redesign and I agree that it is necessary. So far, we don't know final
decision. ControlLabel component fixes problem with 3 mentioned
labels. Using nbresloc fixes problem with the rest of images. So, we
don't need to create xx_ja.gifs. It hink here is not more issues to
solve so I'm signing this issue as fixed.
Comment 19 _ mihmax 2003-01-03 08:35:28 UTC
I think these are the only CVS logs about Richard's commits:
http://ui.netbeans.org/servlets/ReadMsg?msgId=438250&listName=cvs
http://ui.netbeans.org/servlets/ReadMsg?msgId=438297&listName=cvs

I'll commit the changes to release341 branch too
Comment 20 _ mihmax 2003-01-03 10:22:55 UTC
Patch to TipPanel.java is not applicable to release341 branch of TipPanel.

http://ui.netbeans.org/source/browse/ui/welcome/src/org/netbeans/modules/welcome/TipPanel.java.diff?r1=1.16&r2=1.17&f=c

So I wander, should I merge the trunk version changes to release341
branch? There're some minor bugfixes there...
Comment 21 Richard Gregor 2003-01-03 12:46:44 UTC
From my point of view you can do it.R.
Comment 23 _ mihmax 2003-01-03 15:27:18 UTC
oops, forgot to commit in the new Bundle.properties.
Thanks to continious build & Richard Gregor for discovering that!

Commit log:
Checking in org/netbeans/modules/welcome/Bundle.properties;
new revision: 1.8.4.1.4.1; previous revision: 1.8.4.1
Comment 24 Ken Frank 2003-07-22 19:08:51 UTC
will verify though I think welcome window has had
redesign since this time anyway.

ken.frank@sun.com