class
SAPO.Utility.I18n
Utility function for internationalization
Defined in
Utility/I18n/1.1/lib.js
Function Summary
Function
alias()
returns function where arguments get applied
check SAPO.Utility.I18n.text
append
(Object
baseLangObject)
adds keys to i18n dictionary
init
(Object
baseLangObject)
resets keys on i18n dictionary
returns either singular or plural words
updates I18n dictionary in usage so it fetches all its keys from the given langCode
Function Details
function alias
Function
alias()
returns function where arguments get applied
check SAPO.Utility.I18n.text
function append
append(Object
baseLangObject)
adds keys to i18n dictionary
Parameters:
baseLangObject
function getLang
String
getLang()
returns base lang
function init
init(Object
baseLangObject)
resets keys on i18n dictionary
Parameters:
baseLangObject
function ntext
returns either singular or plural words
Parameters:
Syntax 1
strSin
- word to use when count is 1
strPlur
- word to use otherwise
count
- number which defines which word to use Syntax 2
words
- words to use
count
- number which defines which word to use function setLang
setLang(String
langCode)
updates I18n dictionary in usage so it fetches all its keys from the given langCode
Parameters:
langCode
[description] function text
replaces
Parameters:
str
key to look for in i18n dictionary (returns key if unknown)
[arg1]
replacement #1 (replaces first {%s} and all {%s:1})
[arg2...]
replacement #2 (replaces second {%s} and all {%s:2})