Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356897

Summary: TVT/DVT3.7:TCT100: FRA - Apostrophes not displayed in "Code analysis" panel of project preferences
Product: [Tools] CDT Reporter: CDE Administration <cdeadmin>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: CLOSED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: critical    
Priority: P3 CC: camle, cdtdoug, elaskavaia.cdt, ericchen, hwfu, keithc, kitlo, kqli, vivkong
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
06.000.040_1_FR.gif
none
06.000.040_2_FR.gif
none
06.000.040_3_FR.gif none

Description CDE Administration CLA 2011-09-07 04:43:14 EDT
<response_by> Gaelle Lacoste at 2011.09.07.02.42.10 </response_by>
NLS Build Level: 20110528
Language: French

Steps to reproduce problem:
1. Select Window > Preferences from the main toolbar.
2. Select C/C++ > Code Analysis.
3. Verify each problems tooltip by holding the mouse above each problem name.

In the Sample message section of the hovers, apostrophes are not displayed when there is no variable in the string. If a variable is present, then apostrophes are OK (see 06.000.040_1_FR.gif).

The file in which I found the strings is:
eclipse\plugins\org.eclipse.cdt.codan.checkers\OSGI-INF\l10n\bundle.properties
It contains the  NLS_MESSAGEFORMAT_VAR statement at the beginning. Maybe  NLS_MESSAGEFORMAT_ALL shall be used.

But please note that the problem occurs only for the Sample messages, not for the description. So only strings of type "problem.messagePattern.XXXX" are not OK. Strings of type "problem.description.XXXX" are OK (please see 06.000.040_2_FR.gif).

Thanks in advance for your help,
Gaelle

<response_by> William Fu at 2011.09.07.03.29.37 </response_by>
This article was reassigned from Category:''TVT/Testing,WSW37(IES),Inbox''.
Comment 1 CDE Administration CLA 2011-09-07 04:43:18 EDT
Created attachment 202864 [details]
06.000.040_1_FR.gif
Comment 2 CDE Administration CLA 2011-09-07 04:43:20 EDT
Created attachment 202865 [details]
06.000.040_2_FR.gif
Comment 3 CDE Administration CLA 2011-09-07 04:43:21 EDT
Created attachment 202866 [details]
06.000.040_3_FR.gif
Comment 4 CDE Administration CLA 2011-09-07 04:43:23 EDT
<cde:tctdetail>
Testcase: 06.000.040 - CDT - CODE ANALYSIS TOOLTIPS
Project: 
Component: Xfer - CDT/cdt-build
Priority: 1
Subject: FRA - Apostrophes not displayed in "Code analysis" panel of project preferences
Article ID: 100
Originator: pichon@fr.ibm.com
Stop Ship: T
</cde:tctdetail>
Comment 5 CDE Administration CLA 2011-09-07 07:50:33 EDT
<cde:tctdetail>
Testcase: 06.000.040 - CDT - CODE ANALYSIS TOOLTIPS
Project: WSW37B
Component: Xfer - CDT/cdt-build
Priority: 1
Subject: FRA - Apostrophes not displayed in "Code analysis" panel of project preferences
Article ID: 100
Originator: pichon@fr.ibm.com
Stop Ship: T
</cde:tctdetail>
Comment 6 Vivian Kong CLA 2011-09-07 11:02:50 EDT
Kit, please change the NLS_MESSAGEFORMAT_VAR tag to NLS_MESSAGEFORMAT_ALL when you send the files for translation.

This is not an Eclipse issue.  Closing.  Please reopen if you see other issues.
Comment 7 Vivian Kong CLA 2011-09-07 16:19:28 EDT
Looks like all the problem.messagePattern.* strings (whether there are variable substitution or not) get passed through Java message format util and problem.description.* strings do not.  Therefore if we change to NLS_MESSAGEFORMAT_ALL it will be incorrect for all problem.description.* strings

Alena, can you please take a look?  I think we should only process problem.messagePattern.* strings with Java message format util (NLS.bind(), etc) when there is variable substitution.
Comment 8 Kathy CLA 2011-09-07 16:50:48 EDT
Hi Alena, is it possible to provide this fix by this Friday? so we can have TVT
regression build ready on time. Thanks in advance!
Comment 9 Elena Laskavaia CLA 2011-09-13 21:14:53 EDT
Sample messages are java pattern strings, so apostrophies have to be escaped,
i.e. instead of Can't you should write Can''t as problem message pattern.
Or I don't understand your problem statement.
Comment 10 Kit Lo CLA 2011-09-14 11:15:52 EDT
Alena, from what we can tell, all the "problem.messagePattern.*" strings in "eclipse\plugins\org.eclipse.cdt.codan.checkers\OSGI-INF\l10n\bundle.properties" (whether there are variable substitution or not) get passed through Java message format util and "problem.description.*" strings do not.

If a string would be processed with the Java message format util, we have to double the single quotes in the string.

If a string would NOT be processed with the Java message format util, we should just use the single quotes the normal way and do not double them.

The inconsistent usage of the Java message format util was the root problem. Translators do not know when to double the single quotes and when not to.

It'd be nice to have a consistent usage of the Java message format util in the file. We recommend processing the strings in this file with the Java message format util ONLY IF there are variable substitution, just like most other Java programs do. Thanks!
Comment 11 CDE Administration CLA 2011-09-19 01:43:56 EDT
<response_by> William Fu at 2011.09.19.00.35.17 </response_by>
I have checked it is fixed.
Gaelle, please close this once confirmed :-)
Thanks
Comment 12 CDE Administration CLA 2011-09-19 01:44:00 EDT
<cde:tctdetail>
Testcase: 06.000.040 - CDT - CODE ANALYSIS TOOLTIPS
Project: 
Component: Xfer - CDT/cdt-build
Priority: 1
Subject: FRA - Apostrophes not displayed in "Code analysis" panel of project preferences
Article ID: 100
Originator: pichon@fr.ibm.com
Stop Ship: T
</cde:tctdetail>
Comment 13 CDE Administration CLA 2011-09-20 05:22:22 EDT
<response_by> Gaelle Lacoste at 2011.09.20.04.10.39 </response_by>
Hello,
I confirm that the problem is fixed in French build 20110917.
Thanks a lot for your help,
Gaelle
Comment 14 CDE Administration CLA 2011-09-20 05:22:25 EDT
[Added by CDE: Completed by the CDE Bridge]
Comment 15 CDE Administration CLA 2011-09-20 05:22:28 EDT
<cde:tctdetail>
Testcase: 06.000.040 - CDT - CODE ANALYSIS TOOLTIPS
Project: WSW37B
Component: Xfer - CDT/cdt-build
Priority: 1
Subject: FRA - Apostrophes not displayed in "Code analysis" panel of project preferences
Article ID: 100
Originator: pichon@fr.ibm.com
Stop Ship: N
</cde:tctdetail>
Comment 16 Kathy CLA 2011-09-21 12:57:14 EDT
Hi Alena,

We have provided temp solution to fix the FR apostrophes just for this TVT. But this is just a temp solution which means each time when we receive FR translation, we have to remember to manually fix this problem in FR file. 

Would you please refer to Kit's Comment10 and make the proper fix in the English source code?

For this reason, this defect should be reopened.

Thank you
-- Kathy