Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular-translate-csv-to-json
Advanced tools
A CLI build tool to generate JSON files required by Angular Translate from a single CSV file
A CLI build tool to generate JSON files required by Angular Translate from a single CSV file
This is a lightweight, dependency-free command line build tool that converts CSV/TSV files to JSON files Angular Translate can consume during runtime. This enables you to have a single table of translations containing all supported languages. This tool also supports namespacing, so keys like users.create.labelFirstName
will produce a nested JSON structure.
id | en | fr |
---|---|---|
users.create.labelFirstName | First Name | Prénom |
users.create.labelLastName | Last Name | Nom |
users.toastValidationEmailSentToUserEmail | Validation email sent to {{userEmail}} | E-mail de validation envoyé à {{userEmail}} |
{
"users": {
"create": {
"labelFirstName": "First Name",
"labelLastName": "Last Name"
},
"toastValidationEmailSentToUserEmail": "Validation email sent to {{userEmail}}"
}
}
{
"users": {
"create": {
"labelFirstName": "Prénom",
"labelLastName": "Nom"
},
"toastValidationEmailSentToUserEmail": "E-mail de validation envoyé à {{userEmail}}"
}
}
Note: Output JSON will not be pretty-printed as above, but compact.
npm install angular-translate-csv-to-json --save-dev
node node_modules/angular-translate-csv-to-json config/angular-translate-csv-to-json.config.json
The first (and only) parameter is the path to a config file, which is required.
This is an example configuration you can adapt to your needs:
{
"csvFileIn": "src/angular/i18n/translations.tsv",
"jsonDirOut": "src/angular/i18n",
"jsonFileName": "translations",
"jsonExt": "json",
"csvFieldSeparator": "\t"
}
csvFileIn
Type: String
The path to the input CSV file to be processed.
jsonDirOut
Type: String
Output directory to store the generated JSON files in.
jsonFileName
Type: String
The first part of the JSON file name. The file name is constructed as the following: {jsonFileName}.{languageCode}.{jsonFileExt}
(e.g. translations.en.json
, translations.fr.json
, etc.)
jsonFileExt
Type: String
The extension of the generated JSON file.
csvFieldSeparator
Type: String
Field separator of input CSV file.
FAQs
A CLI build tool to generate JSON files required by Angular Translate from a single CSV file
The npm package angular-translate-csv-to-json receives a total of 106 weekly downloads. As such, angular-translate-csv-to-json popularity was classified as not popular.
We found that angular-translate-csv-to-json demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.