Changes between Initial Version and Version 1 of Implementation_of_Internationalization_and_Localization


Ignore:
Timestamp:
Apr 13, 2014, 11:17:04 AM (10 years ago)
Author:
Adrián Chaves
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Implementation_of_Internationalization_and_Localization

    v1 v1  
     1= Files =
     2== binaries/data/mods/public/ ==
     3=== globalscripts/ ===
     4==== l10n.js ====
     5Implements the following global internationalization functions:
     6
     7{{{
     8translate(message);
     9translatePlural(singularMessage, pluralMessage, number);
     10translateWithContext(context, message);
     11translatePluralWithContext(context, singularMessage, pluralMessage, number);
     12translateObjectKeys(object, keys);
     13
     14}}}
     15The first four functions are simply wrappers for the engine internationalization functions (such as `Engine.translate`). These global functions use caching to reduce the number of calls to the engine functions, because calls to engine functions require string conversions that are far from cheap.
     16
     17`translateObjectKeys` is a helper function that can translate specific properties (`keys` array) of a !JavaScript object.
     18
     19==== sprintf.js ====
     20TODO