Linguify translation files manager
Via npm
npm install linguify --save-dev
Via pnpm
pnpm add -D linguify
Via yarn
yarn add -D linguify
- Initiate Linguify with the
init
command
linguify init
- This will create
linguify.config.json
file 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.
linguify
or
linguify start
- Linguify server port can be changed using
-p
or--port
option following the desired port
linguify -p 3000
- Note: Updating
linguify.config.json
while Linguify runs requires restarting it before affecting it.
Linguify can import from or export to Excel translations file (xlsx).
linguify import
- Note: the file's first row must contain
locales
names, and the first column must be namedkey
. It is advised to first useexport
to get a translations xlsx file.
linguify export
Both 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
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 sync
Please open an issue if any bugs arise. and any working pull request is welcome.
Happy Internationalization!