Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
i18nexus-cli
Advanced tools
A command line interface for accessing and managing translations through the i18nexus API
i18nexus is a translation management web application designed for use with i18next. Learn more with this quick Next.js walkthrough or this React.js walkthrough.
npm install -g i18nexus-cli
The commands below have options that can be set with environment variables. Since the majority of our users are using this package in the context of their web or mobile application, this package will load the .env
file in the current working directory to check for i18nexus variables. If you would prefer not to load your .env
file, you can run export I18NEXUS_NO_DOT_ENV=true
.
i18nexus pull -k <PROJECT_API_KEY>
The above snippet will download all of your latest translations to your current directory in the following structure:
.
└── public
└── locales
├── en
| └── common.json
└── de
└── common.json
This structure is i18next convention, and will work by default with next-i18next.
If you wish to download your files to a different directory, you can use the --path
option to specify your download destination. See all options below:
Option | Default value |
---|---|
--api-key or -k | |
--path or -p | ./public/locales |
--ver or -v | latest |
--clean | false |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--path
The path to the destination folder in which translation files will be downloaded
--ver
The version of your project's translations to be downloaded (Can also be set using environment variable I18NEXUS_VERSION
)
--clean
Before download, clears your destination folder specified in --path. As a safety precaution, this only deletes folders with names that match a simple language code regex. You should still ensure you are not storing any files in your destination folder that you do not want deleted.
The following commands require a Personal Access Token (PAT) because they write data to your i18nexus project. PATs are created in your i18nexus account dashboard.
REMEMBER: Keep these tokens a secret and do NOT publish them to any public code repositories such as Github. They should never be client facing. Treat each token as if it is your i18nexus password.
i18nexus add-string
or i18nexus a
i18nexus a -K 'welcome_msg' -v 'Welcome to my app!' -ns 'common' -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN>
The above snippet will create a new string in your i18nexus project in your common
namespace.
Translations for the string will be automatically generated and machine translated for all of your project's languages, just as if you added the string manually in the i18nexus web application.
Option | Required? |
---|---|
--api-key or -k | ✔ |
--pat or -t | ✔ |
--namespace or -ns | ✔ |
--key or -K | ✔ |
--value or -v | ✔ |
--details or -d |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--pat
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable I18NEXUS_PERSONAL_ACCESS_TOKEN
)
--namespace
The namespace in which to create the string
--key
The key of the string to create
--value
The value of the string to create
--details
The details of the string to create (optional)
i18nexus update-string <namespace> <key>
or i18nexus u <namespace> <key>
i18nexus u common welcome_msg -v 'Welcome' -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN>
The above snippet will update a the value of the string with key welcome_msg
in your common
namespace to Welcome
.
The first 2 arguments are the namespace and the key of the string you wish to update.
You can then update the key, value, details, and/or namespace by using the command options:
Option | Required? |
---|---|
--api-key or -k | ✔ |
--pat or -t | ✔ |
--namespace or -ns | |
--key or -K | |
--value or -v | |
--details or -d | |
--reset-confirmed | |
--retain-confirmed |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--pat
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable I18NEXUS_PERSONAL_ACCESS_TOKEN
)
--namespace
The new namespace of the string
--key
The new key of the string
--value
The new value of the string
--details
The new details of the string
--reset-confirmed
Confirmed translations of this string will be reset with machine translations of the new value
--retain-confirmed
Confirmed translations of this string will be retained
i18nexus delete-string <namespace> <key>
or i18nexus d <namespace> <key>
i18nexus d common welcome_msg -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN>
The above snippet will delete the string welcome_msg
from your common
namespace, along with its associated translations.
Option | Required? |
---|---|
--api-key or -k | ✔ |
--pat or -t | ✔ |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--pat
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable I18NEXUS_PERSONAL_ACCESS_TOKEN
)
i18nexus import <filePath>
i18nexus import ./en.json -ns common -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN>
The above snippet will read the contents of ./en.json
and import them into the base language of your i18nexus project.
This is the equivalent of using the Import tool in the i18nexus web application. However, this CLI command only allows for uploading a JSON file for your base language.
Option | Required? |
---|---|
--api-key or -k | ✔ |
--pat or -t | ✔ |
--overwrite |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--pat
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable I18NEXUS_PERSONAL_ACCESS_TOKEN
)
--overwrite
If any keys already exist in the target namespace, overwrite the values with the imported values.
i18nexus add-namespace <namespaceTitle>
i18nexus add-namespace common -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN>
The above snippet will create a new namespace in your i18nexus project with the title common
.
Option | Required? |
---|---|
--api-key or -k | ✔ |
--pat or -t | ✔ |
--api-key
Your project API key (Can also be set using environment variable I18NEXUS_API_KEY
)
--pat
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable I18NEXUS_PERSONAL_ACCESS_TOKEN
)
FAQs
Command line interface (CLI) for accessing the i18nexus API
The npm package i18nexus-cli receives a total of 3,685 weekly downloads. As such, i18nexus-cli popularity was classified as popular.
We found that i18nexus-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.