Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
locize-cli
Advanced tools
npm install -g locize-cli
curl -fsSL https://raw.githubusercontent.com/locize/locize-cli/master/install.sh | sh
iwr https://raw.githubusercontent.com/locize/locize-cli/master/install.ps1 -useb | iex
Add your api-key and your project-id and let's go...
locize add --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --language en namespace1 myNewKey "My new value"
Add your api-key and your project-id and let's go...
locize remove --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --language en namespace1 myNewKey
or
locize remove common title
Add your project-id and let's go...
locize get --project-id my-project-id-93e1-442a-ab35-24331fa294ba --language en namespace1 myNewKey
or
locize get common title
Add your project-id and let's go...
locize download --project-id my-project-id-93e1-442a-ab35-24331fa294ba --ver latest --language en --namespace namespace1 --path ./backup
or
locize download
or add a format like (json, flat, xliff2, xliff12, xlf2, xlf12, android, yaml, yaml-rails, yaml-nested, csv, xlsx, po, strings, resx, fluent, tmx, laravel, properties)
locize download --project-id my-project-id-93e1-442a-ab35-24331fa294ba --ver latest --language en --namespace namespace1 --path ./backup --format android
There's also a GitHub Action that handles the download in your CI/CD workflow.
By using the sync command, you can keep your existing code setup and synchronize the translations with locize. An example on how this could look like can be seen in this tutorial.
⚠️ Since the remote source are the published translations, make sure the desired version is set to auto publish mode. Alternatively use the --unpublished true
argument (this will generate private downloads costs). ⚠️
cd my-awesome-project/locales
Make sure you have this type of tree structure: Each language should be a directory and each namespace should be a file
locales
├── en
│ ├── namespace1.extension
│ ├── namespace2.extension
│ ├── ...
├── de
│ ├── ...
the cli by will use the directory name as language and the filename (without extension as namespace name).
Add your api-key and your project-id and let's go...
locize sync --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba
or add a format like (json, flat, xliff2, xliff12, xlf2, xlf12, android, yaml, yaml-rails, yaml-nested, csv, xlsx, po, strings, resx, fluent, tmx, laravel, properties)
locize sync --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --format android
‼️ By default: The reference language in your local repository is the master ‼️
Navigate to your locize project and check the results => www.locize.app
This is useful, when i.e. using i18next-scanner, like described here. The save-missing command uses the missing API and the sync command uses the update API So, if you want to save new keys (that does not exist in locize), the save-missing command is the better choice. Doing so, you can then for example make use of the “created by missing API" filter in the locize UI.
But if you need to update existing keys, the sync command is the correct choice.
cd my-awesome-project/locales
Make sure you have this type of tree structure: Each language should be a directory and each namespace should be a file
locales
├── en
│ ├── namespace1.extension
│ ├── namespace2.extension
│ ├── ...
├── de
│ ├── ...
the cli by will use the directory name as language and the filename (without extension as namespace name).
Add your api-key and your project-id and let's go...
locize save-missing --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba
or add a format like (json, flat, xliff2, xliff12, xlf2, xlf12, android, yaml, yaml-rails, yaml-nested, csv, xlsx, po, strings, resx, fluent, tmx, laravel, properties)
locize save-missing --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --format android
Navigate to your locize project and check the results => www.locize.app
Add your api-key (of target version) and your project-id and let's go...
# this will copy version latest to production
locize copy-version latest --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --ver production
Add your api-key and your project-id and let's go...
locize publish-version --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --ver production
Add your api-key and your project-id and let's go...
locize delete-namespace common --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --ver latest
We suggest to use the sync command instead of the migrate command. The migrate command should be used only once and only works with json files.
At the moment only i18next translation files (json) are supported
cd my-awesome-project/locales
If you have a directory structure like this:
locales
├── en
│ ├── namespace1
│ ├── namespace2
│ ├── ...
├── de
│ ├── ...
the cli by default will try to use the directory name as language.
If you have a directory structure like this:
locales
├── namespace1
├── namespace2
├── ...
you can use the --language
option to define the language.
Add your api-key and your project-id and let's go...
locize migrate --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-project-id-93e1-442a-ab35-24331fa294ba --path ./en --language en
Passing the argument --replace will empty the optionally existing namespace before saving the new translations. (default: false)
Navigate to your locize project and check the results => www.locize.app
Add your api-key and your project-id and let's go...
locize format path/to/dictionary --format android
You can define a config file in your home directory (or wherever you want (by specifying it in the command)) that contains defaults for your commands. i.e.
cat /Users/user/.locize
apiKey = my-api-key-d9de-4f55-9855-a9ef0ed44672
projectId = my-project-id-93e1-442a-ab35-24331fa294ba
language = en
version = latest
like this you can just work like this:
locize sync
or
locize add common title "the title of my cool app"
they will also be considered with this priority:
In case you have a .env file in the current working directory, it will be used to load environment variables from that .env file into process.env.
7.14.6 - 2023-05-24
FAQs
locize cli to import locales
The npm package locize-cli receives a total of 37,513 weekly downloads. As such, locize-cli popularity was classified as popular.
We found that locize-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.