Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 223230 - NLS34 - Found 2 consecutive single quotes in text not handled by Java MessageFormat class
Summary: NLS34 - Found 2 consecutive single quotes in text not handled by Java Message...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 218779
  Show dependency tree
 
Reported: 2008-03-19 13:57 EDT by John Ryding CLA
Modified: 2016-05-05 10:28 EDT (History)
3 users (show)

See Also:


Attachments
Patch (3.02 KB, patch)
2008-04-03 06:25 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Ryding CLA 2008-03-19 13:57:15 EDT
Build ID: I20080314

In the following file:

ECLIPSE\PLUGINS\ORG.ECLIPSE.TPTP.TEST.RECORDERS.URL\URLRECORDER.UI_JAR\ORG\ECLIPSE\TPTP\TEST\RECORDERS\URL\UI\INTERNAL\RESOURCES\                                   
  MESSAGES.PROPERTIES  JAVA2-PRB   

I have found 2 consecutive single quotes in text not handled by Java
MessageFormat class. Please remove 1 quote.  

Line: 51 


More information:
Comment 1 Paul Slauenwhite CLA 2008-04-01 10:38:28 EDT
This is caused by the comment that determines the type of single quote handling (see http://www.eclipse.org/tptp/home/documents/process/development/plugin_translatability_faq.html#920).

Since all properties (except plugin.properties) are processed by org.eclipse.osgi.util.NLS, confirming is we should be using the NLS_MESSAGEFORMAT_NONE designation.
Comment 2 Kit Lo CLA 2008-04-01 12:05:22 EDT
According to the JavaDoc for the NLS class, the NLS#bind methods perform string substitution and should be considered a convenience for MessageFormat#format method calls. The same single quote handling based on the criteria should still be used.

Do you pass strings which do NOT contain replacement variables to the NLS#bind methods also?
Comment 3 Paul Slauenwhite CLA 2008-04-02 20:53:22 EDT
Another translatability issue was also also found in the org.eclipse.tptp.test.tools.manual
plug-in (see
http://www.eclipse.org/tptp/home/downloads/CHKPII.php?version=4.5.0&buildID=TPTP-4.5.0-200804020832),
as noted under defect 218779.
Comment 4 Paul Slauenwhite CLA 2008-04-02 21:02:59 EDT
(In reply to comment #2)
> According to the JavaDoc for the NLS class, the NLS#bind methods perform string
> substitution and should be considered a convenience for MessageFormat#format
> method calls. The same single quote handling based on the criteria should still
> be used.
> 
> Do you pass strings which do NOT contain replacement variables to the NLS#bind
> methods also?
> 

Thanks Kit.  I was mistaken and I should have read my own comment at the top of the message.properties file:

# NOTE:  When using substitution parameters, all single quote characters (e.g. ') must be escaped with a preceding single quote character (e.g. ''text in single quotes'').

This string does not have any substitution parameters, so it should contain single  quotes.
Comment 5 Paul Slauenwhite CLA 2008-04-03 06:23:12 EDT
Hours worked for the patch.
Comment 6 Paul Slauenwhite CLA 2008-04-03 06:25:10 EDT
Created attachment 94689 [details]
Patch
Comment 7 Paul Slauenwhite CLA 2008-04-09 16:00:36 EDT
Patch checked in to CVS (HEAD).
Comment 8 Paul Slauenwhite CLA 2009-02-25 11:59:07 EST
Closing by default since not closed by the originator in the 7+ months since
being resolved.  

Please reopen if the issue is still present in the latest TPTP release or the
resolution is not correct.