22.07.2013 Views

Sausalito Developer's Guide - Parent Directory

Sausalito Developer's Guide - Parent Directory

Sausalito Developer's Guide - Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4—10 Chapter 4: Using i18n and l10n in <strong>Sausalito</strong><br />

Beta Draft 11. Copyright ' 2001.Cobalt Networks, Inc. All Rights Reserved.<br />

The i18n PHP Interface<br />

Description: Constructor<br />

Parameters<br />

Syntax: $i18n = new i18n (domain, languages)<br />

domain: sets the default domain to use for interpolation when domain is not explicitly<br />

specified.<br />

langs: a comma-delimited list of supported locales specified in order of preference, for<br />

example, jp, sh, or en.<br />

Returns: a new i18n object.<br />

Object Methods<br />

function i18N($domain = "", $langs = "")<br />

Description: constructor<br />

Parameters<br />

domain: a string that describes the domain<br />

langs: an optional string that contains a comma separated list of preferred locale. Most<br />

important locales appears first, that is, en_US, en_AU, zh, de_DE.<br />

function get($tag, $domain = "", $vars = array())<br />

Description: get a localized string<br />

Parameters<br />

tag: the tag of the string. Identical to the msgid string in the .po file<br />

domain: the domain of the string in string. Identical to the .po or .mo file name without the<br />

extension. Optional. If not supplied, the one supplied to the i18n constructor is used

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!