Changes between Initial Version and Version 1 of Documentation/DevelopingForXinha/Internationalisation


Ignore:
Timestamp:
08/05/05 09:53:02 (15 years ago)
Author:
niko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopingForXinha/Internationalisation

    v1 v1  
     1= Internationalisation (i18n) = 
     2 
     3If you look for information on localisation (l10n, how you translate Xinha) take a look at wiki:Documentation/Localisation. 
     4 
     5This page is for xinha-developers and on how the _lc-function works. 
     6 
     7== Context == 
     8Xinha has different contexts for i18n: 
     9 
     10 * "HTMLArea": the core of Xinha uses this context. 
     11 * eg. "InsertAnchor": every plugin has its own context (the name of the plugin) 
     12 
     13== the _lc-function == 
     14{{{ 
     15HTMLArea._lc('english string'); 
     16}}} 
     17This is the simplest usage, HTMLArea (core) will be used as context. The function will return the localised string. 
     18---- 
     19{{{ 
     20HTMLArea._lc('english string', 'PluginName'); 
     21}}} 
     22Usage within an plugin. Most plugins do have its own _lc function defined, you don't need to pass the context everytime then. 
     23{{{ 
     24CharCounter.prototype._lc = function(string) { 
     25    return HTMLArea._lc(string, "CharCounter"); 
     26}; 
     27}}} 
     28---- 
     29{{{ 
     30var complexity = 'very'; 
     31HTMLArea._lc({string: 'this is a $complexity complex sentence', replace:{'complexity': complexity}}); 
     32}}} 
     33This provides a way to have complex sentences where some parts are variable - and this variable part might be at another position in other languages. 
     34---- 
     35{{{ 
     36HTMLArea._lc({key: 'button_bold', string: ["ed_buttons_main.gif",3,2]}); 
     37}}} 
     38It is also possible to translate objects, this is used to internationalize the bold, italic... toolbar-buttons. 
     39 
     40The key is used to lookup the string (which is actually an object) in the l10n-file. 
     41