Changes between Version 1 and Version 2 of Documentation/Internationalisation


Ignore:
Timestamp:
01/12/07 14:12:13 (11 years ago)
Author:
ray
Comment:

changed reference to HTMLArea and htmlarea.js and added mime types for syntax highlighting of the examples

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Internationalisation

    v1 v2  
    88Xinha has different contexts for i18n: 
    99 
    10  * "HTMLArea": the core of Xinha uses this context. 
     10 * "Xinha": the core of Xinha uses this context. 
    1111 * eg. "InsertAnchor": every plugin has its own context (the name of the plugin) 
    1212 
    1313== the _lc-function == 
    1414{{{ 
    15 HTMLArea._lc('english string'); 
     15#!text/x-javascript 
     16Xinha._lc('english string'); 
    1617}}} 
    17 This is the simplest usage, HTMLArea (core) will be used as context. The function will return the localised string. 
     18This is the simplest usage, Xinha (core) will be used as context. The function will return the localised string. 
    1819---- 
    1920{{{ 
    20 HTMLArea._lc('english string', 'PluginName'); 
     21#!text/x-javascript 
     22Xinha._lc('english string', 'PluginName'); 
    2123}}} 
    2224Usage within an plugin. Most plugins do have its own _lc function defined, you don't need to pass the context everytime then. 
    2325{{{ 
     26#!text/x-javascript 
    2427CharCounter.prototype._lc = function(string) { 
    25     return HTMLArea._lc(string, "CharCounter"); 
     28    return Xinha._lc(string, "CharCounter"); 
    2629}; 
    2730}}} 
    2831---- 
    2932{{{ 
     33#!text/x-javascript 
    3034var complexity = 'very'; 
    31 HTMLArea._lc({string: 'this is a $complexity complex sentence', replace:{'complexity': complexity}}); 
     35Xinha._lc({string: 'this is a $complexity complex sentence', replace:{'complexity': complexity}}); 
    3236}}} 
    3337This provides a way to have complex sentences where some parts are variable - and this variable part might be at another position in other languages. 
    3438---- 
    3539{{{ 
    36 HTMLArea._lc({key: 'button_bold', string: ["ed_buttons_main.gif",3,2]}); 
     40#!text/x-javascript 
     41Xinha._lc({key: 'button_bold', string: ["ed_buttons_main.gif",3,2]}); 
    3742}}} 
    3843It is also possible to translate objects, this is used to internationalize the bold, italic... toolbar-buttons.