Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Scout/Concepts/Texts"

m (update link)
(Replaced content with "The Scout documentation has been moved to https://eclipsescout.github.io/.")
 
Line 1: Line 1:
{{ScoutPage|cat=Shared}}
+
The Scout documentation has been moved to https://eclipsescout.github.io/.
 
+
{{ScoutJavadoc|TEXTS|C}} is a convenience class to access the default {{ScoutLink|Concepts|Text Provider Service}} used for the localization of the texts in the user interface.
+
 
+
== Description ==
+
{{note|TODO|Add a description}}
+
 
+
<source lang="java">
+
TEXTS.get("persons");
+
</source>
+
 
+
It is possible to use some Parameters:
+
<source lang="java">
+
String name = "Bob";
+
int age = 13;
+
 
+
TEXTS.get("NameWithAge", name, age);
+
</source>
+
 
+
In this case, some placeholders for the parameters are needed in the translated text:
+
  NameWithAge={0} is {1} years old;
+
 
+
=== properties files ===
+
Scout uses the java.util.ResourceBundle mechanism for native language support. So whatever language files you have in your <code><project-prefix>.shared/resources/texts/*.properties</code> are taken as translation base.
+
 
+
Example setup:
+
* <code><project-prefix>.shared/resources/texts/Texts.properties</code>
+
* <code><project-prefix>.shared/resources/texts/Texts_fr.properties</code>
+
 
+
If your application starts with the -vmargs -Duser.language=fr or eclipse.exe -nl=fr the translations in <code>Texts_fr.properties</code> are considered. In case of any other user language the translations in <code>Texts.properties</code> are considered.
+
 
+
It is possible to edit these files in the Eclipse Scout SDK with the {{ScoutLink|SDK|NLS Editor}}.
+
 
+
== See Also ==
+
* {{ScoutLink|Concepts|Text Provider Service}}
+
* {{ScoutLink|Concepts|Shared Plug-In|Shared Plug-In}}
+
* {{ScoutLink|SDK|NLS Editor}}
+

Latest revision as of 05:10, 14 March 2024

The Scout documentation has been moved to https://eclipsescout.github.io/.

Back to the top