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.
It's possible to edit branding l10n files, it compiles and creates jars in the target-locale folder, but it doesn't work. The created bundle file are named like: Bundle_de_de_brandingToken.properties Bundle_de_brandingToken.properties But the Netbeans documentation describes another way: http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html Bundle_f4jce_ja_JP.properties Bundle_f4jce_ja.properties (first the brandingToken, then the language id - case sensitive) I don't know, if this is the problem. But the application shows only the English text. --- Product Version: NetBeans IDE Dev (Build 201308222300) Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b45 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b103 System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
mkozeny: you are working on this?
*** Bug 234313 has been marked as a duplicate of this bug. ***
Created attachment 139309 [details] Patch for codehaus mojo maven branding plugin
Created attachment 139311 [details] Updated patch for codehaus mojo maven branding plugin
Hi! Ok, I've pached a local copy of the nbm-maven-plugin (my local version is 3.10.1-patched. The Bundles are now named like the documentation. But the filenames of the jars are know creepy: --- nbm-maven-plugin:3.10.1-patched:branding (default-branding) @ BrDemo-branding --- Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\core\locale\core_brdemo.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\core\locale\core_brdemo_de_de.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\core\locale\core_brdemo_brdemo_de.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-core-execution_brdemo_de_de.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-core-windows_brdemo.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-core_brdemo.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-core_brdemo_de_de.jar org\netbeans\core\actions\Bundle_brdemo_de_de.properties already added, skipping org\netbeans\core\ui\Bundle_brdemo_de_de.properties already added, skipping Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-core_brdemo_brdemo_de.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-modules-autoupdate-ui_brdemo_de_de.jar org\netbeans\modules\autoupdate\ui\actions\Bundle_brdemo_de_de.properties already added, skipping org\netbeans\modules\autoupdate\ui\Bundle_brdemo_de_de.properties already added, skipping Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-netbeans-modules-print_brdemo_de_de.jar Building jar: C:\Entw\Work\projects\BrandingDemo\BrDemo\branding\target\nbm\netbeans\brdemo\modules\locale\org-openide-actions_brdemo_brdemo_de.jar You can see, the branding token 'brdemo' is sometimes doubled, sometimes not. Anyway, the \nbm\netbeans\brdemo\modules\locale\org-netbeans-core_brdemo_de_de.jar contains a translation for the exit menu: Bundle_brdemo_de_de.properties Exit=Beenden But the application shows only the English label "Exit". I don't know, what is going wrong. I'll add my small demo maven project.
Created attachment 139352 [details] Maven project as tastcase This is a very small standard Netbeans platform maven project with some few translations (e.g. the Exit action in the file menu). Please run this project with a patched nbm maven plugin to see the duplicated branding tokens in jar names. However the translation doesn't work.
Created attachment 139353 [details] Patched maven plugin This is the patched maven plugin (source only) with the second patch (139311) from this issue.
Created attachment 139360 [details] Repaired patch for codehaus mojo maven branding plugin Thanks a lot, you're right. I've already attached repaired patch, so you can try it. If you run the app, I think that it will take first as a locale the one passed as param (--locale swich should work for this option) -> if not found - your default OS locale and if it is also not found, classic branding is used.
Created attachment 139362 [details] reworked branding patch Well, unfortunately our work clashed here. I've reworked the patch to eliminate the use of regexp pattern and sort out the locales in target/ directory on the initial copy. That way we don't have to compute the includes and always just take what's present in the given directory.
I've created an issue for the nbm-maven-plugin - https://jira.codehaus.org/browse/MNBMODULE-222 applied my patch there and will attempt a 3.11 release soon. (to have archetypes updated for 7.4)
Yes, the last patch works much better. The JAR naming is correct and the branding names are also right. But (and I don't know, if it's a bug, a feature, my fault or nitpicking), IMHO the order of picking the right branding file is wrong. I've three created branding-jars (see my testcase): \modules\locale\org-netbeans-core_brdemo.jar \modules\locale\org-netbeans-core_brdemo_de.jar \modules\locale\org-netbeans-core_brdemo_de_de.jar The org-netbeans-core_brdemo.jar is without any specific l10n for the Exit action. org-netbeans-core_brdemo_de and org-netbeans-core_brdemo_de_de are with different l10n for Exit: org-netbeans-core_brdemo_de!org/netbeans/core/actions/Bundle_brdemo_de.properties Exit=Beenden! org-netbeans-core_brdemo_de_de!org/netbeans/core/actions/Bundle_brdemo_de_de.properties Exit=Beenden My system comes with the locale de_DE (System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)) But the applications shows "Beenden!" *not* "Beenden". So netbeans catches the _de-Bundle, not the more specific _de_de Bundle. Is this a bug? And IMHO not in the Mojo, this is a Netbeans API problem? However, thank you for your great support :)
The order of picking the l10n is defined in this document: http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html#branding (same URL as above) "For example, in Japanese locale the search list for a bundle might look like this:" 1. /some/path/to/your/Bundle_f4jce_ja_JP.properties 2. /some/path/to/your/Bundle_f4jce_ja.properties 3. /some/path/to/your/Bundle_f4jce.properties 4. /some/path/to/your/Bundle_ja_JP.properties 5. /some/path/to/your/Bundle_ja.properties 6. /some/path/to/your/Bundle.properties "As with all localizations, searches automatically fall back to simpler resources if the specific locale plus branding was not found; when using bundle files (with NbBundle.getBundle and similar calls), there may be multiple matching bundles, in which case any given key will be searched in all available bundles in order (so that you can override only the keys you need)."
This changeset capitalize branding locale variant. Milos will probably make a release of updated nbm maven plugin tomorrow. https://hg.netbeans.org/core-main/rev/9a0966b022d4
Note: use pattern --locale en:US or switching branding locale -> http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html.
(In reply to Martin Kozeny from comment #13) > This changeset capitalize branding locale variant. Milos will probably make > a release of updated nbm maven plugin tomorrow. > https://hg.netbeans.org/core-main/rev/9a0966b022d4 Hey Martin, thank you. To test this, probably brings me to my limits;-) Of course I have a hg clone here with current pull/update and an successful ant-built. But the test case is indeed maven based project, with artifacts. I suppose I need to test it as ant-driven application platform, to see whether the order is correct? Or is there a way to build "artifacts" from the hg clone? br, josh.
Ok, after a long testcase, building my own complete local test center (with maven artifacts -> http://www.aljoscha-rittner.de/blog/archive/2013/08/29/mavenization-of-netbeans-platform-projects-7x-releases/ ) and manually correcting the branding extension (_de_de to _de_DE) in my old testcase, I can confirm the fix :D Now the application picks up the right branding file and the IDE creates correct capitalized branding locales. Both of you, thank you very much :-)
unfortunately the release 3.11 of nbm-maven-plugin is still not synced to central. probably something went wrong with codehaus setup. no estimate yet when it will be working and synced