Bug 140078 - CRenameLocalProcessor.error.nameErrorWhat #131
Summary: CRenameLocalProcessor.error.nameErrorWhat #131
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.0 M7   Edit
Assignee: Vivian Kong CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-05-03 16:46 EDT by Samuel Wu CLA
Modified: 2008-06-20 11:26 EDT (History)
4 users (show)

See Also:


Attachments
Proposed patch by Ravi Sankar (8.08 KB, patch)
2007-03-28 00:47 EDT, Ravi Sankar CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Wu CLA 2006-05-03 16:46:50 EDT
This is a problem reported by the national language translators.
The following message is in the file org.eclipse.cdt.refactoring.messages.properties
CRenameLocalProcessor.error.nameErrorWhat=''{0}'' {1} {2}.
It seems that {0} is a name, {1} is a verb and {2} noun. This doesn't work in the national language. Need to provide translatable messages.
Comment 1 Chris Recoskie CLA 2006-06-12 15:29:08 EDT
This message is used when conflicting bindings are encountered during a refactoring.

{0} is the name of the binding that conflicts (i.e. variable name, etc.)  Example:  SomeVariable
{1} is an error message (which is already translated since the message comes from a properties file).  Example:  "will redeclare"
{2} is the type of the binding that conflicts. Example: "a local variable"

Put them together and you get "SomeVariable will redeclare a global variable."

I gather that this sentence structure does not work for all languages.  I don't think we can fix this without more input from the translation team as we are not experts in the sentence structure of all the required languages.  There are too many combinations of error message and type to have them all be distinct property strings that can be independently translated.  Unless they can propose a simple fix, I don't think this is likely to be fixed for CDT 3.1.
Comment 2 Chris Recoskie CLA 2007-02-09 10:24:26 EST
I'm going to attempt to rework the error message display for M7 so that it works better in other languages.  So far my thought is to display the info in non-sentance form.

E.g.,

========================

A conflict was encountered during refactoring.

Type of Problem:  redeclaration

New Element:  <name>

Conflicting Element Type:  local variable
	
========================


I'd rework the strings a bit so that they'd flow better in this context.  E.g. "a local variable" would become "local variable", "will redeclare" would become "redeclaration", etc.

Does this solution sound acceptable to everyone?
Comment 3 Vivian Kong CLA 2007-03-23 15:03:02 EDT
Ravi, can you please look at this too?  Thanks.
Comment 4 Ravi Sankar CLA 2007-03-26 08:10:26 EDT
(In reply to comment #3)
> Ravi, can you please look at this too?  Thanks.

Sure Vivian.
Comment 5 Ravi Sankar CLA 2007-03-28 00:47:03 EDT
Created attachment 62176 [details]
Proposed patch by Ravi Sankar

Please review the patch and write the comments

Ravi
Comment 6 Vivian Kong CLA 2007-04-04 11:27:20 EDT
I've updated the copyright information and applied your patch to HEAD.  Thanks Ravi!
Comment 7 Markus Schorn CLA 2007-04-04 12:26:22 EDT
Vivian,
the patch causes 25 failures in the regression tests (org.eclipse.cdt.refactoring.tests.RenameRegressionTests). Please update them, such that they are passing again.
Comment 8 Vivian Kong CLA 2007-04-04 13:06:25 EDT
Thanks for pointing that out Markus.  Sorry about that.  I'll fix them now.
Comment 9 Vivian Kong CLA 2007-04-04 16:43:45 EDT
I've updated the refactoring test cases in HEAD.
Comment 10 Chris Recoskie CLA 2007-04-05 10:59:43 EDT
Should this be marked as FIXED now?
Comment 11 Vivian Kong CLA 2007-04-05 11:03:29 EDT
Marking it fixed