The GitHub Action
The GitHub action enables a fully automated localisation workflow, eliminating the need for manual file handling

Content
How to get your EasyTranslate account ready
How to push content from GitHub to EasyTranslate
How to pull content back to GitHub
How to download translated files
How to start the translation automation
Where to review your translations
What is the GitHub action
The EasyTranslate GitHub action streamlines your string localisation process by eliminating time-consuming manual workflow steps. It synchronises your translation files from your source code to the EasyTranslate String Library, where highly customised HumanAI workflows are used to localise your content. Afterwards, you can pull the translated strings back into your repository, completely preserving your file structure.
Find more details about the general use of GitHub actions HERE.
How to get your EasyTranslate account ready
On the EasyTranslate platform your content will be organised in a string library and translation managed via a dedicated workflow. Hence, in order to start connecting and using the GitHub action you will need to create both a string library and an automation workflow in your EasyTranslate account. For more details on how to use the EasyTranslate String Library see HERE. You can find a detailed description on how to set up and use automation workflows HERE.
If you are using HumanAI for your translations, the workflow will be set up by your AI training specialist during the training phase. Feel free to contact your customer success manager or write to us in the website support chat if you have any questions.
How to push content from GitHub to EasyTranslate
When your pull request (PR) is open and labelled with push-easytranslate-strings it will trigger the workflow to call the EasyTranslate translation action. The action will push the strings found within the address pattern resources/files/**/**json. It uses the given access token to create or sync them with the string library you have selected.
Below example shows a list of all the properties you need to update or pay attention to.
Example:
name: 'Push your strings to EasyTranslate'
on:
pull_request:
types: [ labeled ]
jobs:
download_strings:
if: $false
runs-on: ubuntu-latest
name: Send strings to EasyTranslate
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: $ <-- This is the github access token and needs to be stored in your repo (settings -> secrets and variables -> actions)
ref: $ <-- this needs to stay as is
- name: Execute our action
uses: "easytranslate-com/strings-library-github-action@v1"
id: push_easytranslate
with:
easytranslate_action: 'push'
source_language: 'en'
source_root_folder: 'files'
translation_file_paths: '**/strings.json'
target_languages: 'de,ja'
access_token: $ <-- This is the ET access token and needs to be stored in your repo (settings -> secrets and variables -> actions)
base_api_url: 'https://api.platform.easytranslate.com'
team_name: 'easytrranslatecom'
string_library_id: '63d0e5b923e85e42250de2ba'
- name: Show Response
run: |
echo $
echo $
Remember to update the following properties with the correct information.
token: Should be set in your own environment
source_language: You need to state the source language of your text
source_root_folder: Make sure it matches your setup and needs
translation_file_paths: Make sure it matches your setup and needs
target_languages: Input the languages the strings should be translated to
access_token: Should be set in your own environment
team_name: The team identifier you are connecting to.
string_library_id: 'easytranslate-string-library-id'
Good to know:
-
Create your file under .github/workflows/push-to-easytranslate.yml
How to pull content back to GitHub
You can pull the localised content back from the string library to GitHub at any time.
When your pull request (PR) is open and labelled with pull-easytranslate-strings it will trigger the workflow to call the EasyTranslate translation action. The action will pull all strings from the given string library.
Please note this action only works if the strings are created using the push action.
Warning:
- Please note this action only works if the strings are created using the push action.
Example:
name: 'Pull your strings from EasyTranslate'
on:
pull_request:
types: [ labeled ]
jobs:
pull_strings_from_easytranslate:
if: $false
runs-on: ubuntu-latest
name: Download strings from EasyTranslate
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: $
ref: $
- name: Checkout PR
env:
GITHUB_TOKEN: $
run: gh pr checkout $
- name: Execute our action
uses: "easytranslate-com/strings-library-github-action@v1"
id: pull_easytranslate
with:
easytranslate_action: 'pull'
source_language: 'en'
source_root_folder: 'resources'
translation_file_paths: 'files/**/**json'
target_languages: 'da,de'
access_token: $
base_api_url: 'https://api.platform.sandbox.easytranslate.com'
team_name: 'x-force-deadpool'
string_library_id: 'easytranslate-string-library-id'
- name: Update the pull request
if: $false
env:
GITHUB_TOKEN: $
run: |
git config user.name 'Your Name'
git config user.email 'Your GitHub email'
git add .
git commit -am 'Updating strings'
git push
Remember to update the following properties with the correct information.
token: Should be set in your own environment
source_language: You need to state the source language of your text
source_root_folder: Make sure it matches your setup and needs
translation_file_paths: Make sure it matches your setup and needs
target_languages: Input the languages the strings should be translated to
access_token: Should be set in your own environment
team_name: The team identifier you are connecting to
string_library_id: The ID for your string library
git config user.name.: Add your Github username to authorise pull requests
git config user.email: Add your Github user email to authorise pull requests
How to download translated files
Although the GitHub action removes the need for manual up- and download of files it is possible to download the translated content as .json files as in the example below. The action will download all strings from the given string library. The files will be downloaded in i18n format.
When your pull request (PR) is open and labelled with download-easytranslate-strings it will trigger the workflow to call the EasyTranslate translation action. The action will download all the strings from the selected string library.
The files will be under the resources folder, and their file names will be based on the language code, so in the below example, 3 files will be created with the following names: en.json, de.json and da.json. Each file will contain the strings translated into the respective languages (da and de), and a file with the source (en).
The download_strings_format can be flat or nested.
If the value is flat the key names will be as string {"global.welcome": "Your Value"}. If the value is nested the key names will be as objects "{global": {"welcome": "Your Value"}}.
Example:
name: 'Download your strings from EasyTranslate'
on:
pull_request:
types: [ labeled ]
jobs:
pull_strings_from_easytranslate:
if: $false
runs-on: ubuntu-latest
name: Download strings from EasyTranslate
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: $
ref: $
- name: Checkout PR
env:
GITHUB_TOKEN: $
run: gh pr checkout $
- name: Execute our action
uses: "easytranslate-com/strings-library-github-action@v1.0.1"
id: pull_easytranslate
with:
easytranslate_action: 'download'
source_language: 'en'
source_root_folder: 'resources'
translation_file_paths: 'files/**/**json'
target_languages: 'da,de'
access_token: $
base_api_url: 'https://api.platform.sandbox.easytranslate.com'
team_name: 'x-force-deadpool'
string_library_id: 'easytranslate-string-library-id'
download_strings_format: 'flat'
- name: Update the pull request
if: $false
env:
GITHUB_TOKEN: $
run: |
git config user.name 'Your Name'
git config user.email 'Your GitHub email'
git add .
git commit -am 'Updating strings'
git push
Remember to update the following properties with the correct information.
token: Should be set in your own environment
source_language: You need to state the source language of your text
source_root_folder: Make sure it matches your setup and needs
translation_file_paths: Make sure it matches your setup and needs
target_languages: Input the languages the strings should be translated to
access_token: Should be set in your own environment
base_api_url: 'https://api.platform.sandbox.easytranslate.com'
team_name: The team identifier you are connecting to.
string_library_id: The ID for your string library
git config user.name.: Add your Github username to authorise download requests
git config user.email: Add your Github user email to authorise download requests
How to start the translation automation
Whenever you add new content to your repository simply sync the content to EasyTranslate and start the translations of the new keys in the string library. You can use the filter, search and automation options in the string library to either translate all new keys or specific keys only.
For more information on how to manage the translation step on EasyTranslate please see our string library documentation HERE.
Where to review your translations
We do not recommend making any changes directly in GitHub. If you wish to review and change any of the translations we strongly recommend you exclusively work in the internal review editor which you can access individually for each of your projects in your EasyTranslate account. Making the changes in the editor is the only way to implement the updates automatically across all relevant features. The amended translations are added automatically to your translation memory and glossary entries can be updated while editing. On top of that the string library gets updated which enables you to synchronise the updated translations back to GitHub. Finally, it ensures that your HumanAI models continuously learn from your input and preferences. You can find more info on how to access and use the internal review editor HERE.