In Eclipse source code, I've found some '$NON-NLS-1$' in comments used like that :
private String toolTip = ""; //$NON-NLS-1$
What does that mean ?
In Eclipse source code, I've found some '$NON-NLS-1$' in comments used like that :
private String toolTip = ""; //$NON-NLS-1$
What does that mean ?
The string is not translatable. It tells the Eclipse editor to not flag the string as unresourced. This is important for multilingual applications.
It tells the compiler not to complain about a non externalized string, and that it don't require localization.
It's used by Eclipse to indicate that a string doesn't need to be translated, probably because it's not going to be seen by the application's users.
They silence a warning that Eclipse emits when it encounters string literals (and has been configured to complain).
The idea is that UI messages should not be embedded as string literals, but rather sourced from a resource file (so that they can be translated, proofed, etc). Consequently, Eclipse can be configured to detect string literals, so that you don't accidentally have leave unexternalized UI strings in the code; however, there are strings which should not be externalized (such as regexps) and so, //$NON-NLS-1$ gives you a way to communicate that fact to the compiler.
Well, does anybody know what the last -N means, like in //$NON-NLS-1$ and //$NON-NLS-3$ ??