1.1.3 • Published 3 years ago

js-translator-lodash-requirejs-bridge v1.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

translator-lodash-requirejs-bridge

Install

npm install js-translator-lodash-requirejs-bridge --save

How To

This bridge register a new plugin into requirejs with the prefix "tpl" to load templates for lodash and implements a auto parsing of translation keys in template file after generating the template string. The templates will be loaded by requirejs. You can define the file suffix. If no suffix is defined, the suffix ".html" will be appended. The given template is the lodash template function, returned by lodash.template(template):

define(['tpl!my/fancy/template', 'tpl!my/fancy/other/template.html'], function(fancyTemplate, fancyOtherTemplate) {
    console.log(
});

Translations keys will be written into braces.

<a href="www.heise.de">{heise}</a>
<a href="www.heise.de">{heise}</a>

It needs the default translator from npm "js-translator".

This plugins improves the requirejs plugin "text".

Configure the Translator

import translator from 'js-translator'
// configure the default translator with
translator.setTranslations({});
1.1.3

3 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.4

7 years ago