Skip to content

Add commands and workflows to handle translations #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 5, 2021
38 changes: 38 additions & 0 deletions .github/workflows/check-i18n-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check Internationalization

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- '.github/workflows/check-i18n-task.ya?ml'
- '**/package.json'
- '**.ts'
- 'i18n/**'
pull_request:
paths:
- '.github/workflows/check-i18n-task.ya?ml'
- '**/package.json'
- '**.ts'
- 'i18n/**'
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn

- name: Check for errors
run: yarn i18n:check
30 changes: 30 additions & 0 deletions .github/workflows/i18n-nightly-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: i18n-nightly-push

on:
schedule:
# run every day at 1AM
- cron: '0 1 * * *'

jobs:
push-to-transifex:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn

- name: Run i18n:push script
run: yarn run i18n:push
env:
TRANSIFEX_ORGANIZATION: ${{ secrets.TRANSIFEX_ORGANIZATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
38 changes: 38 additions & 0 deletions .github/workflows/i18n-weekly-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: i18n-weekly-pull

on:
schedule:
# run every monday at 2AM
- cron: '0 2 * * 1'

jobs:
pull-from-transifex:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: '12.14.1'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn

- name: Run i18n:pull script
run: yarn run i18n:pull
env:
TRANSIFEX_ORGANIZATION: ${{ secrets.TRANSIFEX_ORGANIZATION }}
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
commit-message: Updated translation files
title: Update translation files
branch: i18n/translations-update
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
221 changes: 221 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"arduino": {
"common": {
"selectBoard": "Select Board",
"unknown": "Unknown",
"processing": "Processing",
"saveChangesToSketch": "Do you want to save changes to this sketch before closing?",
"loseChanges": "If you don't save, your changes will be lost.",
"noBoardSelected": "No board selected"
},
"preferences": {
"language.log": "True if the Arduino Language Server should generate log files into the sketch folder. Otherwise, false. It's false by default.",
"compile.verbose": "True for verbose compile output. False by default",
"compile.warnings": "Tells gcc which warning level to use. It's 'None' by default",
"upload.verbose": "True for verbose upload output. False by default.",
"window.autoScale": "True if the user interface automatically scales with the font size.",
"window.zoomLevel": "Adjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1) or below (e.g. -1) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.",
"ide.autoUpdate": "True to enable automatic update checks. The IDE will check for updates automatically and periodically.",
"board.certificates": "List of certificates that can be uploaded to boards",
"sketchbook.showAllFiles": "True to show all sketch files inside the sketch. It is false by default.",
"cloud.enabled": "True if the sketch sync functions are enabled. Defaults to true.",
"cloud.pull.warn": "True if users should be warned before pulling a cloud sketch. Defaults to true.",
"cloud.push.warn": "True if users should be warned before pushing a cloud sketch. Defaults to true.",
"cloud.pushpublic.warn": "True if users should be warned before pushing a public sketch to the cloud. Defaults to true.",
"cloud.sketchSyncEnpoint": "The endpoint used to push and pull sketches from a backend. By default it points to Arduino Cloud API.",
"auth.clientID": "The OAuth2 client ID.",
"auth.domain": "The OAuth2 domain.",
"auth.audience": "The OAuth2 audience.",
"auth.registerUri": "The URI used to register a new user."
},
"cloud": {
"signIn": "Sign in",
"signOut": "Sign Out",
"shareSketch": "Share Sketch",
"showHideRemoveSketchbook": "Show/Hide Remote Sketchbook",
"pullSketch": "Pull Sketch",
"openInCloudEditor": "Open in Cloud Editor",
"options": "Options...",
"share": "Share...",
"remote": "Remote",
"continue": "Continue",
"pushSketch": "Push Sketch",
"pushSketchMsg": "This is a Public Sketch. Before pushing, make sure any sensitive information is defined in arduino_secrets.h files. You can make a Sketch private from the Share panel.",
"pull": "Pull",
"pullSketchMsg": "Pulling this Sketch from the Cloud will overwrite its local version. Are you sure you want to continue?",
"donePulling": "Done pulling ‘{0}’.",
"notYetPulled": "Cannot push to Cloud. It is not yet pulled.",
"push": "Push",
"pullFirst": "You have to pull first to be able to push to the Cloud.",
"donePushing": "Done pushing ‘{0}’."
},
"board": {
"installManually": "Install Manually",
"installNow": "The \"{0} {1}\" core has to be installed for the currently selected \"{2}\" board. Do you want to install it now?",
"configDialogTitle": "Select Other Board & Port",
"configDialog1": "Select both a Board and a Port if you want to upload a sketch.",
"configDialog2": "If you only select a Board you will be able just to compile, but not to upload your sketch.",
"pleasePickBoard": "Please pick a board connected to the port you have selected.",
"programmer": "Programmer",
"succesfullyInstalledPlatform": "Successfully installed platform {0}:{1}",
"succesfullyUninstalledPlatform": "Successfully uninstalled platform {0}:{1}",
"couldNotFindPreviouslySelected": "Could not find previously selected board '{0}' in installed platform '{1}'. Please manually reselect the board you want to use. Do you want to reselect it now?",
"reselectLater": "Reselect later",
"noneSelected": "No boards selected.",
"noPortsSelected": "No ports selected for board: '{0}'.",
"noFQBN": "The FQBN is not available for the selected board \"{0}\". Do you have the corresponding core installed?",
"selectBoardForInfo": "Please select a board to obtain board info.",
"platformMissing": "The platform for the selected '{0}' board is not installed.",
"selectPortForInfo": "Please select a port to obtain board info.",
"boardInfo": "Board Info",
"board": "Board{0}",
"port": "Port{0}",
"getBoardInfo": "Get Board Info",
"inSketchbook": " (in Sketchbook)"
},
"boardsManager": "Boards Manager",
"about": {
"label": "About {0}",
"detail": "Version: {0}\nDate: {1}{2}\nCLI Version: {3}{4} [{5}]\n\n{6}"
},
"contributions": {
"addFile": "Add File",
"replaceTitle": "Replace",
"fileAdded": "One file added to the sketch."
},
"replaceMsg": "Replace the existing version of {0}?",
"library": {
"addZip": "Add .ZIP Library...",
"zipLibrary": "Library",
"overwriteExistingLibrary": "Do you want to overwrite the existing library?",
"successfullyInstalledZipLibrary": "Successfully installed library from {0} archive",
"namedLibraryAlreadyExists": "A library folder named {0} already exists. Do you want to overwrite it?",
"libraryAlreadyExists": "A library already exists. Do you want to overwrite it?",
"include": "Include Library",
"manageLibraries": "Manage Libraries...",
"arduinoLibraries": "Arduino libraries",
"contributedLibraries": "Contributed libraries",
"title": "Library Manager",
"needsOneDependency": "The library <b>{0}:{1}</b> needs another dependency currently not installed:",
"needsMultipleDependencies": "The library <b>{0}:{1}</b> needs some other dependencies currently not installed:",
"installOneMissingDependency": "Would you like to install the missing dependency?",
"installMissingDependencies": "Would you like to install all the missing dependencies?",
"dependenciesForLibrary": "Dependencies for library {0}:{1}",
"installAll": "Install all",
"installOnly": "Install {0} only",
"installedSuccessfully": "Successfully installed library {0}:{1}",
"uninstalledSuccessfully": "Successfully uninstalled library {0}:{1}"
},
"selectZip": "Select a zip file containing the library you'd like to add",
"sketch": {
"archiveSketch": "Archive Sketch",
"saveSketchAs": "Save sketch folder as...",
"createdArchive": "Created archive '{0}'.",
"new": "New",
"openRecent": "Open Recent",
"showFolder": "Show Sketch Folder",
"sketch": "Sketch",
"moving": "Moving",
"movingMsg": "The file \"{0}\" needs to be inside a sketch folder named as \"{1}\".\nCreate this folder, move the file, and continue?",
"cantOpen": "A folder named \"{0}\" already exists. Can't open sketch.",
"saveFolderAs": "Save sketch folder as...",
"sketchbook": "Sketchbook",
"upload": "Upload",
"uploadUsingProgrammer": "Upload Using Programmer",
"doneUploading": "Done uploading.",
"couldNotConnectToMonitor": "Could not reconnect to serial monitor. {0}",
"verifyOrCompile": "Verify/Compile",
"exportBinary": "Export Compiled Binary",
"verify": "Verify",
"doneCompiling": "Done compiling.",
"openSketchInNewWindow": "Open Sketch in New Window",
"openFolder": "Open Folder",
"close": "Are you sure you want to close the sketch?"
},
"bootloader": {
"burnBootloader": "Burn Bootloader",
"doneBurningBootloader": "Done burning bootloader."
},
"debug": {
"debugWithMessage": "Debug - {0}",
"noPlatformInstalledFor": "Platform is not installed for '{0}'",
"debuggingNotSupported": "Debugging is not supported by '{0}'"
},
"editor": {
"copyForForum": "Copy for Forum (Markdown)",
"commentUncomment": "Comment/Uncomment",
"increaseIndent": "Increase Indent",
"decreaseIndent": "Decrease Indent",
"increaseFontSize": "Increase Font Size",
"decreaseFontSize": "Decrease Font Size",
"autoFormat": "Auto Format"
},
"examples": {
"menu": "Examples",
"couldNotInitializeExamples": "Could not initialize built-in examples.",
"builtInExamples": "Built-in examples",
"customLibrary": "Examples from Custom Libraries",
"for": "Examples for {0}",
"forAny": "Examples for any board"
},
"help": {
"search": "Search on Arduino.cc",
"keyword": "Type a keyword",
"gettingStarted": "Getting Started",
"environment": "Environment",
"troubleshooting": "Troubleshooting",
"reference": "Reference",
"findInReference": "Find in Reference",
"faq": "Frequently Asked Questions",
"visit": "Visit Arduino.cc"
},
"certificate": {
"uploadRootCertificates": "Upload SSL Root Certificates",
"openContext": "Open context",
"remove": "Remove",
"upload": "Upload"
},
"firmware": {
"updater": "WiFi101 / WiFiNINA Firmware Updater"
},
"dialog": {
"dontAskAgain": "Don't ask again"
},
"monitor": {
"connectionBusy": "Connection failed. Serial port is busy: {0}",
"disconnected": "Disconnected {0} from {1}.",
"unexpectedError": "Unexpected error. Reconnecting {0} on port {1}.",
"failedReconnect": "Failed to reconnect {0} to the the serial-monitor after 10 consecutive attempts. The {1} serial port is busy.",
"reconnect": "Reconnecting {0} to {1} in {2] seconds..."
},
"electron": {
"couldNotSave": "Could not save the sketch. Please copy your unsaved work into your favorite text editor, and restart the IDE.",
"unsavedChanges": "Any unsaved changes will not be saved."
}
},
"theia": {
"core": {
"couldNotSave": "Could not save the sketch. Please copy your unsaved work into your favorite text editor, and restart the IDE.",
"offline": "Offline",
"daemonOffline": "CLI Daemon Offline",
"cannotConnectBackend": "Cannot connect to the backend.",
"cannotConnectDaemon": "Cannot connect to the CLI daemon."
},
"debug": {
"start": "Start...",
"typeNotSupported": "The debug session type \"{0}\" is not supported.",
"startError": "There was an error starting the debug session, check the logs for more details."
},
"editor": {
"unsavedTitle": "Unsaved – {0}"
},
"workspace": {
"fileNewName": "Name for new file",
"invalidFilename": "Invalid filename.",
"invalidExtension": ".{0} is not a valid extension",
"newFileName": "New name for file",
"deleteCurrentSketch": "Do you want to delete the current sketch?",
"sketchDirectoryError": "There was an error creating the sketch directory. See the log for more details. The application will probably not work as expected."
}
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"node": ">=12.14.1 <13"
},
"devDependencies": {
"@theia/cli": "1.17.2",
"@theia/cli": "1.19.0",
"@types/sinon": "^2.3.5",
"@types/jsdom": "^11.0.4",
"@typescript-eslint/eslint-plugin": "^4.27.0",
Expand All @@ -35,14 +35,18 @@
},
"scripts": {
"prepare": "cross-env THEIA_ELECTRON_SKIP_REPLACE_FFMPEG=1 lerna run prepare && yarn download:plugins",
"cleanup": "npx rimraf ./**/node_modules && rm -rf ./node_modules ./.browser_modules ./arduino-ide-extension/build ./arduino-ide-extension/downloads ./arduino-ide-extension/Examples ./arduino-ide-extension/lib ./browser-app/lib ./browser-app/src-gen ./browser-app/gen-webpack.config.js ./electron-app/lib ./electron-app/src-gen ./electron-app/gen-webpack.config.js",
"cleanup": "npx rimraf ./**/node_modules && rm -rf ./node_modules ./.browser_modules ./arduino-ide-extension/build ./arduino-ide-extension/downloads ./arduino-ide-extension/Examples ./arduino-ide-extension/lib ./browser-app/lib ./browser-app/src-gen ./browser-app/gen-webpack.config.js ./electron-app/lib ./electron-app/src-gen ./electron-app/gen-webpack.config.js",
"rebuild:browser": "theia rebuild:browser",
"rebuild:electron": "theia rebuild:electron",
"start": "yarn --cwd ./electron-app start",
"watch": "lerna run watch --parallel",
"test": "lerna run test",
"download:plugins": "theia download:plugins",
"update:version": "node ./scripts/update-version.js"
"update:version": "node ./scripts/update-version.js",
"i18n:generate": "theia nls-extract -e vscode -f '+(arduino-ide-extension|browser-app|electron|electron-app|plugins)/**/*.ts' -o ./i18n/en.json",
"i18n:check": "yarn i18n:generate && git add -N ./i18n && git diff --exit-code ./i18n",
"i18n:push": "node ./scripts/i18n/transifex-push.js ./i18n/en.json",
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/"
},
"lint-staged": {
"./arduino-ide-extension/**/*.{ts,tsx}": [
Expand Down
Loading