Bug 500809 - Support for NON-NLS block
Summary: Support for NON-NLS block
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-03 17:12 EDT by Roel van Nuland CLA
Modified: 2017-01-22 22:42 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roel van Nuland CLA 2016-09-03 17:12:10 EDT
When you have large blocks of Strings which you do not want to externalize, you currently have to mark each and every String separately.
Like this:
private String STRING_A = "string a"; //$NON-NLS-1$
private String STRING_B = "string b"; //$NON-NLS-1$
private String STRING_C = "string c"; //$NON-NLS-1$

Would it be possible to add support for a $NON-NLS-START$ and $NON-NLS-END$ tag (or something similar) so whole blocks can be marked, like this:
// $NON-NLS-START$
private String STRING_A = "string a";
private String STRING_B = "string b";
private String STRING_C = "string c";
// $NON-NLS-END$
Comment 1 Stephan Herrmann CLA 2016-09-04 03:17:22 EDT
@Vikas, are you sure support for $NON-NLS is provided by JDT/UI? I know we have code in JDT/Core that implements this :)
Comment 2 Vikas Chandra CLA 2016-09-04 05:10:18 EDT
Oops, I thought I triaged this to JDT UI, then saw it back in JDT Core. I thought I had made a mistake and triaged it back to JDT UI :-)

Now moving back by JDT Core.
Comment 3 Stephan Herrmann CLA 2016-09-04 05:18:00 EDT
(In reply to Vikas Chandra from comment #2)
> Oops, I thought I triaged this to JDT UI, then saw it back in JDT Core. I
> thought I had made a mistake and triaged it back to JDT UI :-)
> 
> Now moving back by JDT Core.

:)

You should have received a bugzilla email revealing that I did the change, didn't you? For cases of doubt, I'm sure you also know about the History link in the bugzilla header, right?
Comment 4 Roel van Nuland CLA 2017-01-22 18:10:26 EST
Sorry to bump this ticket, but it had no substantive reply in 4 months.
Comment 5 Stephan Herrmann CLA 2017-01-22 18:19:41 EST
(In reply to Roel van Nuland from comment #4)
> Sorry to bump this ticket, but it had no substantive reply in 4 months.

Frankly, we have no plans for this atm.

@SuppressWarnings("nls") could be used on the enclosing scope. Is that too broad?
Comment 6 Roel van Nuland CLA 2017-01-22 19:20:49 EST
For my current setup, that would be too broad.

I could move all strings i do not want to externalize into a different class so i can use @SuppressWarnings("nls") and still be able to use the "externalize strings"-wizard on the original class.

But having to change my class structure just to be this flexible seems a bit weird too me.

Not sure what to do with this ticket now. I would like to keep it open so i can get notified when plans for such a feature are introduced if that is ok.