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

Summary: NbBundle.getMessage does not respect locale
Product: platform Reporter: johan_walter
Component: -- Other --Assignee: Jesse Glick <jglick>
Status: RESOLVED DUPLICATE    
Severity: normal CC: anebuzelsky
Priority: P3 Keywords: I18N
Version: 6.x   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: Example code

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 ***