Getting Started
Last updated
Last updated
To keep things simple, we will start with an example that does depend on any specific framework just yet (we will cover this later on in Supported Frameworks).
Simply run:
Let's assume that we are working on an app that shows a Hello World
message on its main page. We would want this to be available in English, German, and Spanish.
Let's start by creating a mooi
directory:
Inside, define a translations.yaml
file that will be our source of truth for all product texts:
To start the translation, run:
Once the command completes, you will see results in mooi/translations/
folder.
Let's imagine that we would like to have our translations to be stored in a bunch of JSON files (one file per language) called translations_en.json
, translations_de.json
, etc. And we would like these files to look something like this:
To achieve that, define a mooi/config.yaml
file:
Now just run mooi-cli
again and you will see the output being written into outputs
folder (that we have configured above):
You can refer to Supported Frameworks section for pre-made recipes on how to integrate mooi with your specific framework.
That is great, however, we are only halfway there. One could parse the output yaml
files to use it in their project, but there is a better way. mooi provides a way to output translations in whatever format you desire by leveraging .