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 195184 - NbBundle.getMessage does not respect locale
Summary: NbBundle.getMessage does not respect locale
Status: RESOLVED DUPLICATE of bug 194562
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2011-02-08 17:18 UTC by johan_walter
Modified: 2011-02-15 12:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example code (18.35 KB, application/x-zip-compressed)
2011-02-09 10:02 UTC, johan_walter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johan_walter 2011-02-08 17:18:48 UTC
I have added the two files Bundle.properties and Bundle_sv_SE.properties in:
branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/actions

I would expect the Bundle_sv_SE.properties to be used since I'm using sv-SE as default.

No matter which locale I use, it's always values from Bundle.properties that are used. If I change the values in Bundle.properties, the new values are shown in the UI, so I know for a fact that Bundle.properties are used.

A call to NbBundle.getLocalizingSuffixes() results in the following items:
"_pegasus_runtime_sv_SE"
"_pegasus_runtime_sv"
"_pegasus_runtime"
"_pegasus_sv_SE"
"_pegasus_sv"
"_pegasus"
"_sv_SE"
"_sv"
""
Comment 1 johan_walter 2011-02-09 10:02:17 UTC
Created attachment 105781 [details]
Example code

The zip-file contains a suite and one module. When run using locale=sv-SE the text "Swedish text" is correctly shown in the editor. So the correct bundle is choosen from the directory src/com/test

Howerver, when right clicking on the window tab, the text "Close Window in english" is shown, not "Close Window in swedish" as is expected.
So the wrong bundle is choosen from the directory branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/actions
Comment 2 Jesse Glick 2011-02-15 12:52:14 UTC
The branding/ subdir as defined by the standard Ant-based harness may only be used to create branded variants of resources, not localized variants, so your Bundle_sv_SE.properties is actually ending up in the wrong place in the build. See discussion in duplicated issue.

*** This bug has been marked as a duplicate of bug 194562 ***