Community
Participate
Working Groups
Description: From the main Workbench panel, open or switch to the Resource perspective. In the Navigator view, expand a project and select plugin.xml. Double click the plugin.xml resource to open the manifest editor. On the lower tabs, click on Extensions, then click on the Add... button. Select Extension Templates in the left pane and New File Wizard in the right pane. Then click on Next. 'New Wizard Options' page opens. Delete an item from any field, then error message is displayed on top. This error message picks up an item name as a variable, but it is also used for the field label, which has mnemonic characters for DBCS languages. Please refer the image attached.
Created attachment 1430 [details] Mnemonic in error message
This bug was opened in response to TPRS ID=105
PDE reuses the option label for inclusion in the error messages by stripping the mnemonic character as follows: public String getMessageLabel() { String label = getLabel(); StringBuffer buf = new StringBuffer(); for (int i = 0; i < label.length(); i++) { char c = label.charAt(i); if (c != '&' && c != ':') buf.append(c); } return buf.toString(); } Richard, do you know why this does not work for DBCS languages?
Dejan, I don't see anything in that code that should be incompatible with DBCS characters. I thought there could have been a problem with the charAt function, but it appears that it should work for DBCS languages.
I've verified it on the 730 integration build on a japanese machine. Do you think getMessageLabel is even being called? I see a japanese string followed by (&N) over here...
please disregard my last comment... i was relying on my expert knowledge of japanese to guide me through replicating the bug again. :-) problem is, i wound up finding an unrelated (although similar looking) problem...
The problem is caused by the way mnemonics are specified on DBCS locales. On SBCS locales, mnemonics are specified by simply placing '&' in front of the mnemonic character in the label: Some &Label: The code above works well with this (result is "Some Label"). On DBCS locales, labels use DBCS characters that are not suitable for mnemonics. For that reason, translated labels follow the following convention: Some Label in DBCS (&L): The result when applying the code above is "Some Label in DBCS (L)" The fix that works well is to also look for DBCS mnemonic sequence "(&" and truncate the label at that point. Using that extra check, the result is "Some Label in DBCS ". Tested and verified on Japanese locale.
The fix is in HEAD.