What does $NON-NLS-1$ mean?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
In the development of software, particularly when it involves internationalization (i18n) and localization (l10n), managing text strings effectively becomes crucial. The marker is an important part of this management, especially in programs written in Java and other languages that leverage Eclipse Internationalization frameworks or similar tools. This tag is used to denote that a string literal does not need to be localized, essentially that the marked string is not natural language text.
Understanding
The acronym NLS stands for "National Language Support", and it refers to the mechanism by which software can be adapted to different languages and regions without engineering changes. In codebases where internationalization is implemented, all text strings visible to the user in the final product should ideally be externalized into resource bundles or similar entities. These can then be translated into different languages without modifying the core application code.
However, not all string literals need to be translated. Examples include:
- Technical strings such as logging messages that are intended for developers or system administrators.
- Programming tokens or identifiers used internally within the application.
The tag explicitly informs developers and tools used in internationalization that the following string does not require translation. This helps in both automating the localization process and providing clarity to developers reviewing the code. In absence of such annotations, every string literal could be mistakenly considered as user-facing text that needs localization, potentially leading to unnecessary overhead and confusion.
Technical Examples
Here’s how might be used in Java code:
In this case, the comment tells the internationalization tool or other developers that the string "Debug: Entry value not found." is intended for debugging purposes and should not be externalized or translated.
In contrast, a user-facing string would look like this:
Impact of Not Using
Not using in a project with internationalization can lead to several issues:
- Unnecessary Localization Effort: Developers might waste time translating strings that should not be localized.
- Increased Complexity: Maintaining translations for strings that do not require it can complicate the build and maintenance processes.
- Confusion: Teams may become confused about which strings are meant for end users and which are for development purposes.
Guidelines for Using
Here are some general guidelines for using efficiently:
- Use it on debug logs, system logs, exceptions messages that are not exposed to end users.
- Use it on internal programmatic strings like tag names, certain keys, or identifiers that are not visible to the users.
- Regularly review strings marked with to ensure they are correctly categorized.
Conclusion
Properly managing string literals in software enables efficient localization efforts and clear communication within the development team. Markers like play a crucial role in this management by categorizing strings that need not be considered for internationalization processes, thus streamlining development and maintenance.
Summary Table
| Marker | Use Case | Purpose |
| Non-user facing strings | Indicates no need for localization | |
| Not marked | User-facing text | Requires evaluation for localization |
Overall, understanding and correctly using results in more efficient code management, better utilization of developer resources, and a clearer path to effective internationalization.

