DEV Community

Cover image for The basics - Using YAMLFish to easily manage I18n translations in your project
Adrien.S
Adrien.S

Posted on • Edited on

The basics - Using YAMLFish to easily manage I18n translations in your project

Translations management is never easy, without the proper tools, it can become tedious to work on translation keys, especially when involving non technical people in the process. Existing tools are very pricey and often very complex, making developers dread working on translations.

YAMLFish aims to help software teams managing their translations in a simple and cheap way.

In this series we'll learn how to use YAMLfish and how to implement basic use-cases. In this first article, we'll learn about the basics of the push and pull commands.

Setting-up

First, let's create a free account and create our first project and locales. For this demonstration, we'll assume our main locale is en and we want to translate our app in fr.

YAMLFish projects

Next, let's install the YAMLFish CLI and add the configuration file.

The CLI is a ruby gem, so you'll need ruby installed first.

gem install --pre yamlfish
Enter fullscreen mode Exit fullscreen mode

We need to save a YAMLFish config file .yamlfish.yml at the root of our project. The project token and API key can be found in the footer of the project page on the YAMLFish dashboard :

project_token: some-token
api_key: some-api-key
Enter fullscreen mode Exit fullscreen mode

By default, YAMLFish will look for translations in config/locales, you can override this with the locales_path config key (see the docs).

Pushing existing translations

Pushing our existing translations is as simple as

yamlfish push en
yamlfish push fr
Enter fullscreen mode Exit fullscreen mode

YAMLFish push

And our keys are now available on YAMLFish

YAMLFish dashboard

Retrieving updated translations

Let's assume the fr keys have been updated on YAMLFish by a translator, it's now time to retrieve them into our codebase.

yamlfish pull fr
Enter fullscreen mode Exit fullscreen mode

YAMLFish pull

This will download all fr keys and store them into config/locales/fr.yml

Conclusion

We've learned how to push and pull keys from YAMLFish, allowing non developers to update our translation keys.

In the next articles, we'll learn about how to integrate YAMLFish into the day-to-day of our project, and avoid any conflicts, thanks to branches.

Top comments (0)