Difference between revisions of "Internationalization"

From WebOS-Ports
Jump to navigation Jump to search
(rewrote as internationalization page)
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== Lexicons ==
 
These lexicons exist so English terminology is translated consistently.  
 
These lexicons exist so English terminology is translated consistently.  
Lexicons should focus on common noun phrases and verb phrased used throughout LuneOS.
+
Lexicons should focus on common noun phrases and verb phrases used throughout LuneOS.
Specific phrases belong in localization files (which should also be linked to here).
 
  
 
Update lexicons with new terms as needed.
 
Update lexicons with new terms as needed.
  
== Lexicons ==
 
 
[[German_Lexicon|German Lexicon]]
 
[[German_Lexicon|German Lexicon]]
  
 
[[Spanish_Lexicon|Spanish Lexicon]]
 
[[Spanish_Lexicon|Spanish Lexicon]]
  
== Localization files ==
+
== Localization ==
 +
Specific phrases belong in the localization files, which are part of the repositories on GitHub.
 +
Link to them from this section.
 +
 
 +
=== JavaScript Localization ===
 +
 
 +
The recommended I18N library for Enyo apps is enyo-ilib: https://github.com/enyojs/enyo-ilib
 +
Documentation for iLib itself is at http://sourceforge.net/p/i18nlib/wiki/iLib%20-%20an%20internationalization%20library%20written%20in%20Javascript/
 +
 
 +
As you work on apps, wrap every UI string in $L(). 
 +
Enyo defines it as a no-op, so it's safe to use, even before enyo-ilib is added to the app.
 +
enyo-ilib aliases it to the localization function.
 +
 
 +
Do *not* concatenate strings with parameters. Use [http://enyojs.com/docs/latest/index.html#/utilities:enyo.macroize enyo.macroize]
 +
Example:
 +
 
 +
enyo.macroize($L('Found {$num} items.'), {num: 42});
 +
 
 +
=== C/C++ Localization ===

Latest revision as of 16:25, 26 February 2015

Lexicons

These lexicons exist so English terminology is translated consistently. Lexicons should focus on common noun phrases and verb phrases used throughout LuneOS.

Update lexicons with new terms as needed.

German Lexicon

Spanish Lexicon

Localization

Specific phrases belong in the localization files, which are part of the repositories on GitHub. Link to them from this section.

JavaScript Localization

The recommended I18N library for Enyo apps is enyo-ilib: https://github.com/enyojs/enyo-ilib Documentation for iLib itself is at http://sourceforge.net/p/i18nlib/wiki/iLib%20-%20an%20internationalization%20library%20written%20in%20Javascript/

As you work on apps, wrap every UI string in $L(). Enyo defines it as a no-op, so it's safe to use, even before enyo-ilib is added to the app. enyo-ilib aliases it to the localization function.

Do *not* concatenate strings with parameters. Use enyo.macroize Example:

enyo.macroize($L('Found {$num} items.'), {num: 42});

C/C++ Localization