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

Bug 380818

Summary: NLS plugin inserts NON-NLS-0 rather than NON-NLS-1
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, Michael_Rennie
Version: 0.5   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 429429    
Bug Blocks:    

Description John Arthorne CLA 2012-05-28 11:04:53 EDT
In Eclipse, the index of NON-NLS comments starts at 1 rather than 0. I.e., the first string on a line has NON-NLS-1, the second is NON-NLS-2, etc.

The Orion tool seems to be zero-based, so the first comment is NON-NLS-0. I think we should switch to starting at 1 to be consistent with the Eclipse tool.
Comment 1 Michael Rennie CLA 2015-04-14 10:27:36 EDT
With the NLS support now an eslint rule (bug 428429), I'm moving this to JS tools, is the new linting rule copies the plugin's problem of starting from zero.
Comment 2 Curtis Windatt CLA 2015-04-14 15:29:30 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8e30f2a25872ea332d925f3b4ea7c7b0dd882227

I fixed the logic to start at 1 rather than 0.  However, this is going to result in a lot of existing non-nls comments to be incorrect.  We should consider allowing non-nls-0 or non-nls-1 (the quickfix will always use the correct value).  We could also warn about unnecessary non-nls comments.
Comment 3 Curtis Windatt CLA 2015-04-15 14:11:07 EDT
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e09c8026f8511a9f466d926cddcd7642179aaa74

This commit contains the entirety of this fix (both previous commit and new changes). This was necessary due to Git History shenanigans: Bug 464709

For now we will treat NON-NLS-0 comments the same as NON-NLS-1.  This means there won't be so many errors/warnings for existing externalized files. The quickfix will always do the right thing.  Lines with multiple literals will still complain about the last id.

I will create a new bug to track marking unused nls comments.