Android
This guide assumes that your app sources are located in the ./app folder. If that is not the case, adjust config.yaml accordingly.
Step 1 - Create a translations file
Create a mooi directory
mkdir mooiWithin that directory, create a translations.yaml file with your strings
# ./mooi/translations.yaml
languages: # English is assumed by default, you don't need to list it
- de
- fr
- ru
# etc.
entries:
- key: my_string_id
value: Hello World
description: A message that is shown on the main screen of the app
# etc.Step 2 - Define an output format
Within mooi directory, create a config.yaml file:
# ./mooi/config.yaml
formats:
- outputPath: app/src/main/res/values-{{languageCode}}/generated.xml
format: |
<resources>
{{#each translations}}
<string name="{{key}}">{{{value}}}</string>
{{/each}}
</resources>Step 3 - Run mooi
Run the following command:
npx mooi-cli translate --openAiKey {YOUR OPEN AI KEY}You are good to go! Use the generated translations as you normally would.
Last updated