Code Monkey home page Code Monkey logo

dynamic-i18n's Introduction

Dynamic I18n v2.0.0

npm npm (scoped with tag)

Dynamic i18n is a tool to import your i18n and inject it in your vue-i18n instance

This module automatically import your translate file from a specific provider.

RoadMap

Supported providers

  • Google sheets, see example of file here

Setup

  • Add @nuxtjs/dynamic-i18n dependency using yarn or npm to your project
  • Add @nuxtjs/dynamic-i18n to modules section of nuxt.config.js
  modules: [
    '@nuxtjs/dynamic-i18n'
  ],
  dynamicI18n: {
    languages: ['en', 'fr'],
    providerKey: '1dBsD-EsKb1mHvq4P2Zm4DcOPK2szuxqkkvnTsmbkYhc',
    credentials: {...},
    ...Options
  }

Options

key Required Default Description
languages Required [] Contain all the locales we want to import.
provider-key Required '' The identifier for the source of the data stored.
credentials Required {} Configuration for the provider.
id Optional None id of the active document. Use gid for google sheet url to get active tab id
maxAge Optional 1000 * 60 * 60 Max age of translate files (60 minutes), use 0 to disable it
fallbackLocale Optional 'en' Default language if not founded from the store
localeNamespaceStore Optional 'i18n' Default namespace of i18n locale store. see example of store here
outputFilePrefix Optional 'locale' Prefix of the output file like : {{outputFilePrefix}}-{{language}}.json.
staticFolder Optional static Specify folder in static

Migration from v1 to v2

Dynamic i18n has been updated to work with the new version of https://theoephraim.github.io/node-google-spreadsheet/#/ and the title option to locate the tab has been replaced by id which is the gid identifier that you can get from the google sheet url query params gid.

๐Ÿ“‘ License

MIT License - Nuxt Community

dynamic-i18n's People

Contributors

gaetansenn avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamic-i18n's Issues

works without having to rebuild the project?

I'm trying to make it work in my application.
Its work fine expect I always have to restart the server and make a new nuxt build in order to get the new JSON files. Can I have dynamic translations without having to do that?

there is an example of use?

This question is available on Nuxt community (#c1)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • google-spreadsheet ^3.0.10
  • lodash ^4.17.5
  • vue-i18n ^7.6.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.