Adding a New Language

This guide should help you add a new language with ease. If you have any questions regarding these implementation steps, consult Team SOSO.

1. Add a new language in Lokalise

In Lokalise, you simply click the “Add language” button and select the language you wish to add.

You should select the bulk-add, machine translated option, as the cost is minimal.

When selecting which machine translation provider to use, select DeepL.

2. Add the language config to Lapis

You must update lapis/app/Domain/Language/Services/SupportedLanguagesService.php:supportedLanguages with a key-value pair indicating the ISO code of the language and whether the language is in beta. If the language is in beta, you must reference the ConfigCat flag you created earlier.

As in our example, let’s add Brazilian Portuguese (pt_BR):

[
    'slug' => 'pt_BR',
    'isBeta' => true,
],

3. Testing the language

If you’ve defined your keys properly, you can navigate to your user dashboard in your local environment and turn on your beta language. Verify that the language changes as you expect and that there are no errors when you browse around the site.

4. Releasing the Language

Once the new language is out of beta and you’re ready to fully release it, you can flip the isBeta flag to false. Usually this is done after the language has been live for some time and there are no translation issues reported.