From 8161a2eee51afed09035218d44c4ce749033b42c Mon Sep 17 00:00:00 2001 From: Rawand <62562422+rawand-faraidun@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:57:41 +0300 Subject: [PATCH] use single file --- .changeset/early-eagles-float.md | 7 +++++++ README.md | 18 ++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 .changeset/early-eagles-float.md diff --git a/.changeset/early-eagles-float.md b/.changeset/early-eagles-float.md new file mode 100644 index 0000000..5317198 --- /dev/null +++ b/.changeset/early-eagles-float.md @@ -0,0 +1,7 @@ +--- +'linguify': minor +--- + +Use single translation file: + * allow to have one translation file for each locale instead of a file for each namespace + * `useSingleFile` config option \ No newline at end of file diff --git a/README.md b/README.md index eb67f1e..ee26645 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,17 @@ Linguify translation files manager Via npm ```bash -$ npm install linguify --save-dev +npm install linguify --save-dev ``` Via pnpm ```bash -$ pnpm add -D linguify +pnpm add -D linguify ``` Via yarn ```bash -$ yarn add -D linguify +yarn add -D linguify ``` ### Usage @@ -26,7 +26,7 @@ $ yarn add -D linguify 1. Initiate Linguify with the `init` command ```bash -$ linguify init +linguify init ``` * This will create `linguify.config.json` file at the root of your project. @@ -43,24 +43,26 @@ $ linguify init * `defaultLocale`: default locale to your application. + * `useSingleFile`: determines to use one translation file for each locale or not. +
3. Start linguify. ```bash -$ linguify +linguify ``` or ```bash -$ linguify start +linguify start ``` * Linguify server port can be changed using `-p` or `--port` option following the desired port ```bash -$ linguify -p 3000 +linguify -p 3000 ``` * Note: Updating `linguify.config.json` while Linguify runs requires restarting it before affecting it. @@ -74,7 +76,7 @@ It uses `defaultLocale` as the base of translations and namespaces, and copies m the `sync` operation happenes everytime Linguify starts, to sync translations manually you can use `sync` command. ```bash -$ linguify sync +linguify sync ```