
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
intl-csv2json
Advanced tools
A command-line tool for converting CSV format multilingual files to JSON format.
中文文档 | English
npm install -g intl-csv2json
intl-csv2json --input <CSV_FILE_PATH> --template <TEMPLATE_JSON_PATH>
Or use the shorthand form:
intl-csv2json -i <CSV_FILE_PATH> -t <TEMPLATE_JSON_PATH>
You can also use the interactive command to run the tool:
# This will start an interactive interface to guide you through the required parameters
intl-csv2json
--input
, -i
: CSV file path (required)--template
, -t
: Template JSON file path (required)--output
, -o
: Output directory (optional, default is current directory)--lang-codes
, -l
: Language code list, comma separated, according to the order of the language columns in the CSV file (optional, default is 'zh,en')--group
, -g
: JSON group to process (optional, default is empty)--trim
: Whether to trim values (optional, default is false)--lang
: Display language (optional, 'zh' or 'en', default is auto-detect)--use-template-default
, -d
: Use template value as default when translation is missing (optional, default is false)intl-csv2json -i "./translations.csv" -t "./zh.json" -o "./" -l "zh,en,ar"
# Use template values as default for missing translations
intl-csv2json -i "./translations.csv" -t "./zh.json" -d
The first line of the CSV file should contain language names, and translation content should start from the second line. The first column contains the source language values corresponding to the JSON template, and subsequent columns contain translations in other languages.
Example:
Chinese | English | Arabic |
---|---|---|
{{num}}金币 | {{num}} Coins | {{num}} عملات |
奖励 | Reward | مكافأة |
{{num}}倍收益,{{goldNum}}金币 | {{num}}x earnings, {{goldNum}} coins | {{num}}× {{goldNum}} عملات |
{{num}}人 | {{num}} People | {{num}} شخصًا |
获胜排行 | Winning Rank | ترتيب الفائزين |
{
"price": "{{num}}金币",
"reward": "奖励",
"earnings": "{{num}}倍收益,{{goldNum}}金币",
"winningRank": "获胜排行",
"common": {
"people": "{{num}}人"
}
}
The tool will generate JSON files for corresponding languages in the specified output directory, such as en.json
, tr.json
, etc.
en.json
{
"price": "{{num}} Coins",
"reward": "Reward",
"earnings": "{{num}}x earnings, {{goldNum}} coins",
"winningRank": "Winning Rank",
"common": {
"people": "{{num}} People"
}
}
ar.json
{
"price": "{{num}} عملات",
"reward": "مكافأة",
"earnings": "{{num}}× {{goldNum}} عملات",
"winningRank": "ترتيب الفائزين",
"common": {
"people": "{{num}} شخصًا"
}
}
MIT
FAQs
A tool for converting CSV format translation files to JSON format
The npm package intl-csv2json receives a total of 3 weekly downloads. As such, intl-csv2json popularity was classified as not popular.
We found that intl-csv2json demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.