blob: a26f8f14596e894ac23b5671728fa370602d09b9 [file] [log] [blame]
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.5">
<title>NLS Editor</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<link rel="stylesheet" href="css/eclipse.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="css/coderay-eclipse.css">
</head>
<body class="article">
<table border="0" class="navigation" style="width: 100%;" summary="navigation">
<tr>
<td align="left" colspan="1" rowspan="1" style="width: 30%"><a href="sdk_editor_java.html" shape="rect" title="Additions to the Java Editor"><img alt="Previous" border="0" src="images/prev.gif"></a></td>
<td align="center" colspan="1" rowspan="1" style="width: 40%"></td>
<td align="right" colspan="1" rowspan="1" style="width: 30%"><a href="sdk_wizard.html" shape="rect" title="Scout Wizards"><img alt="Next" border="0" src="images/next.gif"></a></td>
</tr>
<tr>
<td align="left" colspan="1" rowspan="1" style="width: 30%">Additions to the Java Editor</td>
<td align="center" colspan="1" rowspan="1" style="width: 40%"></td>
<td align="right" colspan="1" rowspan="1" style="width: 30%">Scout Wizards</td>
</tr>
</table>
<div id="header">
</div>
<div id="content">
<div class="sect2">
<h3 id="nls-editor"><a class="anchor" href="#nls-editor"></a>NLS Editor</h3>
<div class="paragraph">
<p>The NLS Editor allows to edit the different properties files containing the translated text entries. It is an efficient way to edit all the property files for multilingual texts in one go.</p>
</div>
<div class="sect3">
<h4 id="accessing-the-nls-editor"><a class="anchor" href="#accessing-the-nls-editor"></a>Accessing the NLS Editor</h4>
<div class="paragraph">
<p>Search for the <code>*.nls</code> files in the <code>shared</code> projects. Select <span class="menuseq"><span class="menu">Open With</span>&nbsp;&#x25b8; <span class="menuitem">NLS Editor</span></span> in the context menu</p>
</div>
</div>
<div class="sect3">
<h4 id="the-nls-editor"><a class="anchor" href="#the-nls-editor"></a>The NLS Editor</h4>
<div class="paragraph">
<p>The screenshot below shows the opened NLS editor. In the first column the <code>key</code> values are shown that are used in accessing translations through <code>TEXTS.get("key")</code>. The second columns holds the default translations followed by columns holding the translations for other translated languages.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="images/sdk_editor_nls.png" alt="sdk editor nls">
</div>
</div>
</div>
<div class="sect3">
<h4 id="action-buttons"><a class="anchor" href="#action-buttons"></a>Action Buttons</h4>
<div class="paragraph">
<p>Actions on the top right corner:</p>
</div>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 10%;">
<col style="width: 45%;">
<col style="width: 45%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_refresh.gif" alt="icon refresh"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Refresh NLS Project</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Reload the content of the editor.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_find_obj.gif" alt="icon find obj"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Show NLS entry usage</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">For each row, search in the Java code where the NLS Key is used. Results are displayed in the first column.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_text_add.png" alt="icon text add"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">New entry&#x2026;&#x200b;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Opens the <a href="sdk_wizard_nls-entry.html">New Text Entry Wizard</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_fileadd_pending.gif" alt="icon fileadd pending"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">New language&#x2026;&#x200b;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Opens the <a href="sdk_wizard_language.html">Add a Language Wizard</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_import.gif" alt="icon import"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Import&#x2026;&#x200b;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Import the NLS entries of an external file</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_export.gif" alt="icon export"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Export&#x2026;&#x200b;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Export the NLS entries to an external file</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Import and Export requires additional components.</p>
</div>
<div class="paragraph">
<p>Hide inherited rows checkbox</p>
</div>
<div class="paragraph">
<p>On the top of each column, the text fields allow you to filter the entries in the table. With the <b class="button">Reset</b> button on the right you will empty those filters.</p>
</div>
<div class="paragraph">
<p>The entries in the table can be directly edited by pressing F2 or double-clicking into a text cell.</p>
</div>
<div class="paragraph">
<p>On each row it is possible to call following context menu:</p>
</div>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 10%;">
<col style="width: 45%;">
<col style="width: 45%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_text.png" alt="icon text"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Modify Entry</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Opens the <a href="sdk_wizard_nls-entry.html">New Text Entry Wizard</a></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_find_obj.gif" alt="icon find obj"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Find references to 'Xxx'</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Search in the Java code where the NLS Key is used.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="image"><img src="images/icon_text_remove.png" alt="icon text remove"></span></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Remove Xxx</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Delete the NLS Entry from the files</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect3">
<h4 id="default-mapping-to-properties-files"><a class="anchor" href="#default-mapping-to-properties-files"></a>Default Mapping to Properties Files</h4>
<div class="paragraph">
<p>The mapping between the properties files is registered in the "Text Provider Service" class. Per default the files follow this pattern: <code>&lt;your application&gt;.shared/src/main/resources/&lt;identifier of the project&gt;/texts/Texts&lt;language&gt;.properties</code></p>
</div>
<div class="paragraph">
<p>where:</p>
</div>
<div class="ulist">
<ul>
<li> <p><code>&lt;identifier of the project&gt;</code> is a chain of folders following the same convention as the Java source files with the package name. For example the <code>org.eclipse.contacts.shared</code> project uses <code>org/eclipse/scout/contacts/shared</code> as path.</p> </li>
<li> <p><code>&lt;language&gt;</code> is an identifier of the language and the country. Some possible file names:</p>
<div class="ulist">
<ul>
<li> <p><code>Texts.properties</code> is the default language</p> </li>
<li> <p><code>Texts_de.properties</code> is for german</p> </li>
<li> <p><code>Texts_fr_BE</code> will be for french in Belgium</p> </li>
</ul>
</div> </li>
</ul>
</div>
<hr>
<div class="paragraph">
<p>Go back to the <a href="sdk.html">Scout Tooling</a>.</p>
</div>
<div class="paragraph">
<p>Do you want to improve this document? Have a look at the <a href="https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/10.0/docs/build/eclipse_help/src/docs/sdk_editor_nls.adoc" target="_blank">sources</a> on GitHub.</p>
</div>
</div>
</div>
</div>
<table border="0" class="navigation" style="width: 100%;" summary="navigation">
<tr>
<td align="left" colspan="1" rowspan="1" style="width: 30%"><a href="sdk_editor_java.html" shape="rect" title="Additions to the Java Editor"><img alt="Previous" border="0" src="images/prev.gif"></a></td>
<td align="center" colspan="1" rowspan="1" style="width: 40%"><a href="scout_user_guide.html" shape="rect" title="Eclipse Scout User Guide"><img alt="Eclipse Scout User Guide" border="0" src="images/home.gif"></a></td>
<td align="right" colspan="1" rowspan="1" style="width: 30%"><a href="sdk_wizard.html" shape="rect" title="Scout Wizards"><img alt="Next" border="0" src="images/next.gif"></a></td>
</tr>
<tr>
<td align="left" colspan="1" rowspan="1" style="width: 30%">Additions to the Java Editor</td>
<td align="center" colspan="1" rowspan="1" style="width: 40%"></td>
<td align="right" colspan="1" rowspan="1" style="width: 30%">Scout Wizards</td>
</tr>
</table>
<div id="footer">
<div id="footer-text">
Version 10.0
<br> Last updated 2018-04-03 14:49:24 CEST
</div>
</div>
</body>
</html>