0.9.6 • Published 5 months ago

i18n-magic v0.9.6

Weekly downloads
-
License
MIT
Repository
github
Last release
5 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.9.4

5 months ago

0.9.3

5 months ago

0.9.6

5 months ago

0.9.5

5 months ago

0.9.2

6 months ago

0.9.0

6 months ago

0.8.1

6 months ago

0.8.0

6 months ago

0.9.1

6 months ago

0.7.1

8 months ago

0.7.0

9 months ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.2

1 year ago

0.4.0

1 year ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago