Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@talend/i18n-scripts
Advanced tools
The i18n process has multiple steps
1- Extract and upload
2- Translation within the cloud system
3- Download and versionning to github
4- Download translated files to the bundle
The @talend/i18n-scripts module targets steps 1 - 2 - 3.
yarn global install @talend/i18n-scripts
or
npm install -g @talend/i18n-scripts
Now the cli talend-i18n
is available.
There are 4 actions you can perform
talend-i18n extract
talend-i18n upload
talend-i18n download
talend-i18n deploy
The scripts are based on a talend-i18n.json
configuration file at project root.
This step will extract the i18n files from the project and create a zip.
All the files will be wrapped in a folder with your app extracted version. The version (major.minor) is taken from files at project root.
There are 4 methods of extraction
Npm/Yarn
{
"extract": {
"method": "npm",
"script": "extract-i18n",
"target": "./i18n",
"transform": "flatten"
}
}
Configuration | Description |
---|---|
method | npm or yarn |
script | The npm script name |
target | The folder where the npm script will gather the translation files. This is used to create the zip file. |
transform | Optional. Transformation to apply to file hierarchy. For now only flatten is accepted, putting all file directly under the target language folder. |
Files
{
"extract": {
"method": "files",
"files": ["./src/i18n/translation.json", "./src/app/other.json"],
"target": "./i18n"
}
}
Configuration | Description |
---|---|
method | npm or yarn |
files | The list of files to extract. |
target | The folder where the script will gather the translation files. This is used to create the zip file. Note that the files folder hierarchy is preserved. |
Expression
{
"extract": {
"method": "expression",
"rootPath": "./src",
"expression": "message*.json",
"target": "./i18n"
}
}
Configuration | Description |
---|---|
method | expression |
rootPath | The folder to start the search. |
expression | Expression describing the files name. You can use * as wildcard. message*.json means every files that start with message and end with .json (ex: message-errors.json, message.json, ...), whereas message.json matches only the message.json files. |
target | The folder where the script will gather the translation files. This is used to create the zip file. Note that the files folder hierarchy is preserved. |
You need to pass xtm information as environment variables
> XTM_API_URL=https://XXX \
XTM_CUSTOMER_ID=YYY \
XTM_TOKEN=ZZZ \
talend-i18n <upload|download>
Variable | Description |
---|---|
XTM_API_URL | The XTM api url |
XTM_CUSTOMER_ID | The XTM customer ID |
XTM_TOKEN | The XTM authentication token |
This step will upload previously created i18n zip to XTM.
{
"load": {
"project": "UI"
}
}
Configuration | Description |
---|---|
project | The XTM project name. |
This step will download, unzip and transform files from XTM.
{
"load": {
"project": "UI"
}
}
Configuration | Description |
---|---|
project | The XTM project name. |
It will download only the files corresponding to the current version of your project (version extracted). If no version is detected, all versions will be downloaded.
This step will push downloaded i18n files to github. Files will be generated to create a npm or maven module. For now, no module is deployed on npm/mvn repositories.
You need to pass github credentials as environment variables.
> GITHUB_LOGIN=XXX \
GITHUB_TOKEN=YYY \
talend-i18n deploy
Variable | Description |
---|---|
GITHUB_LOGIN | Github username that will be used to push to the locales repo |
GITHUB_TOKEN | Github token |
talend-i18n.json
configuration
{
"github": {
"url": "https://github.com/Talend/locales.git"
},
"module": {
"type": "mvn",
"private": true,
"repository": {
"id": "private-releases",
"url": "https://mydomain.com/nexus/content/repositories/MyPrivateSourceRelease"
}
}
}
Configuration | Type | Description |
---|---|---|
github.url | string | The https git url. |
module.type | string | The module type to deploy (npm |
module.private | boolean | If the module should be private. |
module.repository | object | This will be set in pom.xml for mvn modules. It should reflect the repository this module should be released. |
module.repository.id | string | The repository id. |
module.repository.url | string | The repository url. |
The i18n files will be pushed to a branch {XTM_project}/{version}
.
With this branch structure, the locales for your project can be downloaded from a defined url.
https://github.com/{github_org}/{repo_name}/archive/{XTM_project}/{version}.zip
In the example :
https://github.com/Talend/locales/archive/UI/1.10.zip
FAQs
Set of scripts to ease i18n workflow
The npm package @talend/i18n-scripts receives a total of 58 weekly downloads. As such, @talend/i18n-scripts popularity was classified as not popular.
We found that @talend/i18n-scripts 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.