Skip to content

vicary/knockout-i18n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

knockout-i18n

A simple internationalization module for KnockoutJs, check out the live demo for simple workings.

API

ko.i18n.locale

The current locale string, or array of strings as locale chain fall back. This module read this observable to resolve a bundle for translations.

ko.i18n.setBundle(locale, bundle)

Assigns a bundle object of key-value translation under target locale.

  • locale {string|array} Target locale string(s)
  • bundle {Object} An object for direct key-value translation.

ko.i18n.setBundles(bundles)

Assigns multiple bundles to multiple locale, act as a multiple version of ko.i18n.setBundle(locale, bundle).

  • bundles {Object} An object with keys as locale, and values be designated bundle.

Bindings

i18n: key

  • key {string} Resolves a translation using current ko.i18n.locale.

i18n-options: substitudes

  • substitudes {array} Array of values to be subtitudes using mustache syntax inside the bundle translation, see example.html for example usage.

About

Simple i18n translation for KnockoutJs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published