blob: e7dd19828b3a51d76b5ebd56e3f21ad9d453980a [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="copyright" content=
"Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css" />
<title>
String Externalization
</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type=
"text/javascript">
</script>
</head>
<body>
<h1>
String Externalization
</h1>
<p>
The Java tools help you to develop applications that can be run on international platforms.
An important facet of designing a program for use in different countries is the localization,
or externalization, of text that is displayed by the program. By externalizing strings, the
text can be translated for different countries and languages without rebuilding the Java
program.
</p>
<p>
The JDT provides the following support for internationalization and string externalization:
</p>
<ul>
<li>A compiler option lets you mark non-externalized strings as compile-time warnings or
errors.
<ul>
<li>See the <b>Non-externalized strings</b> option in the <b>Code style</b> section of
the <a class="command-link" href=
'javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.ProblemSeveritiesPreferencePage)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.svg" alt=
"Goto the Java compiler preference page" /> <span class="control">Java &gt; Compiler
&gt; Errors/Warnings</span></a> preference page.
</li>
</ul>
</li>
<li>Tools that allow you to find strings that have not been externalized.
</li>
<li>A wizard that will guide you through externalizing the strings.
</li>
<li>Tools that help you to find unused and incorrectly used keys for strings located in
property files.
</li>
</ul>
<p>
Comments can be used to denote strings that should not be externalized and should not result
in compile-time warnings or errors. These comments are of form <code>//$NON-NLS-n$</code>
where n is the 1-based index of the string in a line of code.
</p>
<p>
Additional information about internationalized applications can be found in the following
documents:
</p>
<ul>
<li>
<a href=
"http://eclipse.org/articles/Article-Internationalization/how2I18n.html">http://eclipse.org/articles/Article-Internationalization/how2I18n.html</a>
</li>
<li>
<a href="http://download.oracle.com/javase/tutorial/i18n/" target=
"_blank">http://download.oracle.com/javase/tutorial/i18n/</a>
</li>
</ul>
<h3 class="related">Related tasks</h3>
<a href="../tasks/tasks-188.htm">Finding strings to externalize</a><br />
<a href="../tasks/tasks-202.htm">Finding unused and incorrectly used keys in property
files</a>
<h3 class="related">Related references</h3>
<a href="../reference/ref-menu-source.htm">Source menu</a><br />
<a href="../reference/ref-wizard-externalize-strings.htm">Externalize strings
wizard</a><br />
<a href="../reference/preferences/java/ref-preferences-compiler.htm">Java compiler
preferences</a>
</body>
</html>