vue-i18n-tools

    0.1.7 • Public • Published

    vue-i18n-tools

    npm npm vue2 license

    Installation

    npm install --save vue-i18n-tools

    Getting Started

    HTML

    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
     
    <div id="app">
      <p>{{ $t("Hello World!") }}</p>
    </div>

    JavaScript

    import VueI18nTools from 'vue-i18n-tools';
     
    Vue.use(VueI18nTools);
     
    const locales = {
        sk: {
            translations: {
                'Hello World!': 'Ahoj Svet!'
            }
        },
        de: {
            translations: {
                'Hello World!': 'Hallo Welt!'
            }
        }
    };
     
    const i18n = new VueI18nTools({
        locale: 'sk',
        locales
    });
     
    new Vue({
        i18n
    }).$mount('#app');

    Todo

    • custom resource load function to avoid polyfills for fetch
    • docs
    • server translate API

    License

    MIT

    Copyright (c) 2018 Andrej Adamcik

    Install

    npm i vue-i18n-tools

    DownloadsWeekly Downloads

    2

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    54.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • adamcikado