Installation
Two Mi18n is a client-side oriented library. It is designed to be included via a script tag. It is also available as a npm package.
Installation via script tag
The
defer
attribute in the script tag. It is important to use it to make sure the script is loaded before the page is rendered.
Note the latest
tag in the URL. You can also use a specific version number. Here is the list of available versions.
See unpkg for more details.
Installation via npm as a module
You can also install Two Mi18n as an npm module.
Note that you will only be able to use the function
translate()
with this method. The functiontranslateHTML()
is only available when using the script tag.
Now you can use it in your code.
See
TwoMi18n
class,translation object
, andtranslate()
.