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 143636 - Shortcut on Linux/Solaris should be created with localized names map
Summary: Shortcut on Linux/Solaris should be created with localized names map
Status: RESOLVED FIXED
Alias: None
Product: installer
Classification: Unclassified
Component: NBI (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: dlipin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-12 17:10 UTC by dlipin
Modified: 2009-06-03 18:43 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dlipin 2008-08-12 17:10:58 UTC
Currenly, desktop/apps menu shortcut is created with the single name (UnixNativeUtils.getDesktopEntry()):
....
list.add("Name= "+ shortcut.getName());

Shortcut set/get name implementation:
public void setName(final String name) {
        setName(name, Locale.getDefault());
}

Shortcut.setName(final String name, final Locale locale) {
if (name != null) { names.put(locale, name);} 
else { names.remove(locale); }
}

Likely the better behaviour is to have the following impl:
public void setName(final String name) {
        setName(name, new Locale(""));
}
and
public String getName() {
        return getName(name, new Locale());
}

Then in the UnixNativeUtils.getDesktopEntry() we can use something like:
Map <Locale,String> names = shortcut.getNames());
list.add("Name= "+ names.remove(new Locale(""));
for(Locale l: names.keySet()) {
            list.add("Name["+ l + "]=" + names.get(l);
}

We should also keep in mind, that current shortcut Windows/Mac OS X implementation is supporting only single locale.
PS. Not to forget to fix the creation of FileShortcuts in nb-base in that case, since it is created using localized 
value only. So as the result, if installer is running in ja locale, then default name (Name=...) would be in the 
Japanese language but there would be no "Name[ja]=..." string in the .desktop file at all.
Comment 1 dlipin 2009-06-02 15:39:39 UTC
Fixed.
http://hg.netbeans.org/main/rev/46b720d0cf7c
Comment 2 Quality Engineering 2009-06-03 18:43:49 UTC
Integrated into 'main-golden', will be available in build *200906031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/46b720d0cf7c
User: Dmitry Lipin <dlipin@netbeans.org>
Log: Issue #143636 Shortcut on Linux/Solaris should be created with localized names map