| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> |
| |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. 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=ISO-8859-1"> |
| <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"> </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.png" alt="Goto the Java compiler preference page"> |
| <span class="control">Java > Compiler > 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://java.sun.com/docs/books/tutorial/i18n/intro/index.html" target="_blank">http://java.sun.com/docs/books/tutorial/i18n/intro/index.html</a></li> |
| </ul> |
| |
| <p><img border="0" src="../images/ngrelt.png" alt="Related tasks" ></p> |
| <p> |
| <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></p> |
| |
| <p><img src="../images/ngrelr.png" alt="Related reference" border="0" ></p> |
| <p> |
| <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/ref-preferences-compiler.htm">Java Compiler preferences</a></p> |
| |
| |
| </body> |
| </html> |
| |