linguify v1.4.1
linguify
Linguify translation files manager
Getting started
Installation
Via npm
npm install linguify --save-devVia pnpm
pnpm add -D linguifyVia yarn
yarn add -D linguifyUsage
- Initiate Linguify with the
initcommand
linguify init- This will create
linguify.config.jsonfile at the root of your project.
Modify the following values inside
linguify.config.json:
localesPath: Path to application locales folder.locales: Supported locales by your applications.Note: It is better to use ISO-639 language codes.
defaultLocale: default locale to your application.useSingleFile: determines to use one translation file for each locale or not.
- Start linguify.
linguifyor
linguify start- Linguify server port can be changed using
-por--portoption following the desired port
linguify -p 3000- Note: Updating
linguify.config.jsonwhile Linguify runs requires restarting it before affecting it.
Import & Export translations
Linguify can import from or export to Excel translations file (xlsx).
Import translations
linguify import- Note: the file's first row must contain
localesnames, and the first column must be namedkey. It is advised to first useexportto get a translations xlsx file.
Export translations
linguify exportBoth commands have an option to pass the exact path of the translations file --path <PATH>, if path not passed it will try to import from or export to translations.xlsx from localesPath
How it works?
Linguify first validated the user config, then scans the localesPath for namespaces, read this article from i18next documentation if not sure how it works.
It uses defaultLocale as the base of translations and namespaces, and copies missing translations from defaultLocale namespaces to others. then you can modify them from the ui.
the sync operation happenes everytime Linguify starts, to sync translations manually you can use sync command.
linguify syncPlease open an issue if any bugs arise. and any working pull request is welcome.
Happy Internationalization!