3.0.5 • Published 6 months ago

translation-checker-mfi v3.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Translation Checker

A library for validating translation files. It can be used to easily synchronise translation files between languages.

Features

  • Load and save translation data from/to JSON files.
  • Merge translations from a base language to target languages.
  • Easily manage multilingual content in the projects.

Usage

  1. Install the package via npm:
npm install --save-dev translation-checker-mfi
  1. Create translation-runner.ts or translation-runner.js file in the project.

  2. Add following code there:

const { updateTranslations } = require('translation-checker-mfi');

const defaultLang = 'en';
const availableLanguages = ['en', 'fr', 'es']; // Add more languages as needed
const fileLocation = './src/locales/'; // Add the base location of translation files

updateTranslations(defaultLang, fileLocation, availableLanguages);

If an error occurs when using require(), run this command to install the required package:

npm i --save-dev @types/node
  1. In package.json add this script:
 "check-i18n": "ts-node ./src/translation-runner.ts"

or

 "check-i18n": "ts-node ./src/translation-runner.js"

This script takes the default language translation keys and compares them with other available languages. If translation keys are missing, the script automatically adds them.

Also this script checks if the values of translation keys are not empty. If they are empty, the script will display the message in the terminal.

3.0.5

6 months ago

3.0.4

6 months ago

3.0.3

6 months ago

3.0.2

6 months ago

3.0.1

6 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago

1.0.0

7 months ago