Localazy Release Tags management with GitHub Actions

Search for a command to run...

No comments yet. Be the first to comment.
Are you looking for a translation API to use in your new project? We curated a list of the 18 most popular translation service providers’ APIs available on the market. Maybe you’ll find a match! Translating your content online hasn’t ever been easier...

Learn why Spanish is an important language to consider and why it might be one of the first to choose when you start with the localization of your product. There’s no wonder Spanish is the most popular language on our platform! 📖 Introduction Before...

Learn why idioms are difficult to translate correctly, how to identify them in the text, and figure out their meaning to come up with the best translation in this article. Translators know very well that idioms aren't a piece of cake to translate. 🧁...

This short tutorial will help you set up a scalable Nuxt 3 boilerplate for small and large projects. Find out more about the configuration that Localazy uses for their website and build your next project on proven and solid ground. Nuxt 3 is nearing ...

Localazy can take complete care of your translation process with the built-in translation services available inside the platform. Forget the hassle of managing translation projects forever. All you need to do is choose the language and service. Learn...

vaclavhodek's blog
94 posts
Entrepreneur, idea maker, developer, saas & mobile enthusiast. Building developer-friendly localization solution at localazy.com.
Release Tags are a great way of managing differing states of your translation. E.g., you can use one tag for production while another for the testing environment. To make things easier, it’s now possible to automate this process with GitHub actions.
We already support automated uploads and downloads with GitHub Actions for some time. For a general dive-in into the basic usage of Localazy's GitHub actions, check out our previous article. Today, we're going to look at how we can take this automation one step further.
Read the article: Automated Localization: GitHub Actions ❤ Localazy
Release tags work pretty much like tags on GitHub, GitLab, or Docker. They allow you to mark the state of your Localazy app, preserving the translations and translation progress at the given time, which is super helpful, for instance, when you use different branches for production, testing, and development.
You can preserve translations for production for as long as you are working on a new release, and only once you publish it, you start using the latest translations as well.
You can read more about Release tags in the documentation.
In the lines below, you'll find a comprehensive overview of everything Localazy's Tag action can do for you. All the options are based on the capabilities of Localazy CLI.
Check out related documentation to read about every option in greater detail.
To run a GH action, you need to create a YAML file in .github/workflows in your code. Each example represents a single step of a complete custom workflow. You can skip to see the full workflow to see the whole configuration.
The following paragraphs presume you have access to Release tags through an active professional plan and you have integrated Localazy in your code (there are write and read keys in either
localazy.jsonorlocalazy.keys.json)
This lists all the tags associated with your application.
- name: List tags
uses: localazy/tag@v1
with:
list: true
This command saves the current state of your app under a given new-tag name.
- name: Publish new-tag
uses: localazy/tag@v1
with:
publish: 'new-tag'
Replaces the target tag, new-tag-2, with the state of the new-tag.
- name: Promote new-tag
uses: localazy/tag@v1
with:
promote_from: 'new-tag'
promote_to: 'new-tag-2'
Simply renames the target tag.
- name: Rename new-tag
uses: localazy/tag@v1
with:
rename_from: 'new-tag'
rename_to: 'renamed-tag'
Merging tags allows you to apply translations from the source tag to the target tag. The result of the operation is stored as the output tag. Several optional parameters alter what kind of changes are applied.
Check out the documentation for a complete overview.
In this example, we merge state of the renamed-tag into new-tag-2 and save the output under a new merged-tag. On top of that, we added a single parameter --add-languages which adds any missing language to the target tag if the source tag contains any additional languages.
- name: Merge tag
uses: localazy/tag@v1
with:
merge_from: 'renamed-tag'
merge_to: 'new-tag-2'
merge_output: 'merged-tag'
merge_parameters: '--add-languages'
Lastly, this command deletes an existing tag.
- name: Delete renamed-tag
uses: localazy/tag@v1
with:
delete: 'renamed-tag'
When this workflow successfully finishes, it will leave your app in the same state as before since the config will delete all the newly created tags at the end. Feel free to create a new testing project and try it out.
### .github/workflows/locales.yml
on: [push]
jobs:
release_tags:
runs-on: ubuntu-latest
name: Complex overview of tags management
steps:
- uses: actions/checkout@v1
- name: List tags
uses: localazy/tag@v1
with:
list: true
- name: Publish new-tag
uses: localazy/tag@v1
with:
publish: 'new-tag'
- name: Publish new-tag-2
uses: localazy/tag@v1
with:
publish: 'new-tag-2'
- name: Promote new-tag
uses: localazy/tag@v1
with:
promote_from: 'new-tag'
promote_to: 'new-tag-2'
- name: Rename new-tag
uses: localazy/tag@v1 Q
with:
rename_from: 'new-tag'
rename_to: 'renamed-tag'
- name: Merge tag
uses: localazy/tag@v1
with:
merge_from: 'renamed-tag'
merge_to: 'new-tag-2'
merge_output: 'merged-tag'
merge_parameters: '--add-languages'
- name: Delete renamed-tag
uses: localazy/tag@v1
with:
delete: 'renamed-tag'
- name: Delete merged-tag
uses: localazy/tag@v1
with:
delete: 'merged-tag'
- name: Delete new-tag-2
uses: localazy/tag@v1
with:
delete: 'new-tag-2'
This was a comprehensive overview of what you can do with Github actions and Localazy's Release Tags. You may checkout the sample repo for reference. Happy coding!