l10n-helper
v0.0.7
Published
simple small javascript library that will help you to translate your static web content.
Downloads
2
Maintainers
Readme
l10n-helper
simple small lightweight javascript library that will help you to translate your static web content.
Install
npm install --save l10n-helper
or
bower install l10n-helper --save
Getting Started
.
.
.
<script type="text/javascript" src="l10n-helper.js"></script>
.
.
.
<body>
<p id="demo"></p>
<p id="hello"></p>
<p id="things"></p>
<script type="text/javascript">
l10n_register('es-ES', {
'Hello': 'Hola',
});
l10n_register('es', {
'Things': 'cosas'
});
l10n_register('ES', {
'I love you': 'Te amo'
});
document.getElementById("demo").innerHTML = l10n('I love you');
document.getElementById("hello").innerHTML = l10n('Hello');
document.getElementById("things").innerHTML = l10n('Things');
</script>
</body>
Supported Browsers
- Firefox 2+
- Opera 9+
- Google Chrome 1+
- Safari 4+
LICENSE
Copyright (C) 2016 Leonardo Esparis [email protected].
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contributor.
Leonardo Javier Esparis Meza
Version 0.0.7
- different browser language format fixed
Version 0.0.6
- adding the compressed version of l10n-helper.
Version 0.0.5
- Optimizing the search for translations.
Version 0.0.4
- developers can register multiple language formats.
- if words to translate does not exists at cache, those words will be returned.
Version 0.0.3
- firefox bug fixed, language format es-ES, different from chrome and opera.
Version 0.0.2
- Github location error fixed on package.json.
Version 0.0.1
- First commit.