0.6.0 • Published 3 months ago

i18n-magic v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

i18n Magic

Your CLI toolkit to help you with managing your translations in your project.

This currently only works for JSON based translation systems, like: Next-Translate

To use:

  1. Create a OPENAI_API_KEY in your .env file
  2. Create a config file, called i18n-magic.js in your project root.

The content of the file should look something like this:

module.exports = {
  globPatterns: ['./components/**/*.tsx', './pages/**/*.tsx', './lib/**/*.ts'],
  loadPath: 'locales/{{lng}}/{{ns}}.json',
  savePath: 'locales/{{lng}}/{{ns}}.json',
  locales: ['en', 'de'],
  defaultLocale: 'de',
  defaultNamespace: 'common',
  namespaces: ['common', 'forms'],
  context:
    'This is a context which increases the quality of the translations by giving context to the LLM',
};

then just run:

npx i18n-magic [command]

scan

Scan for missing translations, get prompted for each, translate it to the other locales and save it to the JSON file.

replace

Replace a translation based on the key, and translate it to the other locales and save it to the JSON file.

check-missing

Checks if there are any missing translations. Useful for CI/CD or for a husky hook

0.6.0

3 months ago

0.5.0

4 months ago

0.4.1

4 months ago

0.4.2

4 months ago

0.4.0

6 months ago

0.3.0

8 months ago

0.2.0

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago