blob: ca10a415513dddccbbb60f605309f12d542bf35a [file] [log] [blame]
Title: Internationalization (i18n)
Notice: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
# Internationalization (i18n)
It exists a good guide on internationalization (and externalizing string) at [How to Internationalize your Eclipse Plug-In](http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html).
## Translating the current code
Translating Studio is not an simple task. There are many files to translate :
* messages.properties
* plugin.properties
* help files
* some other semi-random files ;)
## When writing code...
When doing the translation for a specific language please add in any case the messages_\{language\}.properties file of the language to the resource folder, even if it's empty (meaning all translations are taken from the messages.properties file). This will show to other developers, that you've thought about translation but no one was needed.
Notes:
* The message".properties files are located in the src/main/java/** folder (not following maven's philosophy) to be able to use Eclipse' 'Externalize Strings' wizard also later on. Following maven philosophy (*.properties in src/main/resources) the wizard doesn't finds the created properties files anymore.
* To replace placeholders we use Eclipse's NLS.bind function, e.g.
From messages.properties:
EditAliasesDialog.TheAliasBegin=The alias "{0}" is invalid.
Will look like in Java code:
NLS.bind( Messages.getString( "EditAliasesDialog.TheAliasBegin" ), new String[] { alias } ) );
Hints:
* Using Eclipse' Property-Editor in the 'Properties' view will prevent you from getting into troubles with uncomment characters like e.g. the German 'Umlauts'