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.
Created attachment 96824 [details] screenshot : menus are back to English I'm trying build 201004060201 on Mac and Windows XP and seeing this strange behavior. Localized menus and labels of IDE will revert back to English when I run "Build Installers". 1. Install daily build 2. Unzip localized jar files into the installation directory http://netbeans.org/projects/nblocalization/downloads/download/6.9%252Fpseudol10n-201004050201.zip These jar files are pseudo localized. All menu and labels are displayed as "[File]". Full-width "[" and "]" are displayed. (there is no official ml-build yet) 3. Start NetBeans in Japanese locale (or use --locale ja option) You can see all labels and menus are localized with "[" and "]". 4. Create a "NetBeans Platform Application" project 5. Try to display the context menu of the project All menus are localized. 6. Run "Build Installers" 7. Try to display the context menu again Most of menus are now English. Other UIs are also back to English. 8. Exit NetBeans and start again 9. Try to display the menu again Now all menus are Japanese.
Three NBI classes call Locale.setDefault, for reasons unclear to me: nbi/engine/src/org/netbeans/installer/utils/cli/options/LocaleOption.java nbi/infra/lib/registries-management/src/org/netbeans/installer/infra/lib/registries/impl/RegistriesManagerImpl.java nbi/infra/server/modules/ejb/src/java/org/netbeans/installer/infra/server/ejb/ManagerBean.java Never do this, except where it is necessary to call third-party code which calls Locale.getDefault() and cannot be told to use a particular Locale object. In such a case, use the following idiom: Locale old = Locale.getDefault(); Locale.setDefault(whatever); // no intervening statements here! try { ... } finally { Locale.setDefault(old); } This is essentially like Scheme fluid-let on a global variable; the same idiom is occasionally used to call buggy libraries relying on Thread.contextClassLoader. (BTW, reporter: in general using -J-Dorg.openide.util.NbBundle.DEBUG=true is a far easier way to simulate localization and its discontents. Happens to not work to reproduce this particular bug, since bundle debug mode does not need to switch locale, and this bug is about the very rare case of a locale switch.)
Usage Locale.setDefault() in LocaleOption.java is done for the same purpose as in core.startup/src/org/netbeans/core/startup/CLIoptions.java. As for RegistriesManagerImpl.java and ManagerBean.java then it is likely unnecessary and I'll fix in core-main#90ae179e37e9. Thanks for bringing this up and explanation in details.
Integrated into 'main-golden', will be available in build *201004090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/90ae179e37e9 User: Dmitry Lipin <dlipin@netbeans.org> Log: Issue #183611 I18N : Localized labels and menus revert to English after running "Build Installers"
Verified the fix on build 201004090201. Thank you Jesse and Dmitry! Great! ;-)