---
description: >-
  A guide on how translate the plugin if your desired translation is not
  bundled.
---

# Create translations

If you wish to translate the plugin to a new language, you have many options. Here we illustrate the "easy" way, and the "hard" way.

## Using LocoTranslate (easy way)

[LocoTranslate](https://it.wordpress.org/plugins/loco-translate/) is a handy WordPress plugin that allows you to manage translations within your WordPress dashboard. It provides in-browser editing of WordPress translation files and integration with automatic translation services.

After installing the plugin, go to LocoTranslate dashboard and select TheBooking.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2Fry0ioYNvpjviQZXKRhxd%2Fimage.png?alt=media&#x26;token=3dc44ffe-85d2-48ea-a599-4abff858e4f3" alt=""><figcaption></figcaption></figure>

A listo of already present languages appears. To create a new translation, click on **New Language**.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2FUu9FwfozcHvfc7jChCtG%2Fimage.png?alt=media&#x26;token=0eafa468-de1c-47e2-932b-5f44aedc010c" alt=""><figcaption></figcaption></figure>

In the screen that follows, choose the desired language. Then select the folder in which the translation files should be stored. Our suggestion is to select the `/languages/plugins` directory instead of the default one, so that translation files are not removed by a plugin update.

Finally, click on **Start translating**.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2Fgfal48G6xgizhdzQAcW9%2Fimage.png?alt=media&#x26;token=b19ed9e9-a910-4361-a70a-1c0ba2154b63" alt=""><figcaption></figcaption></figure>

Provide the proper translation for each string of the list, and don't forget to save the translation when done.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2FOvdrjqVKk0hAeFyo1WBY%2Fimage.png?alt=media&#x26;token=d0f17617-9112-4aed-ae8b-021c336d8a43" alt=""><figcaption></figcaption></figure>

## Using PoEdit (hard way)

{% hint style="info" %}
This process requires you to send us the translation files, as some JSON files need to be generated from the po/mo generated by PoEdit.
{% endhint %}

Using PoEdit, you must open the `team-booking.pot` file. PoEdit will notify you that the .pot file is only a template, and offers to create a new translation.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2F5mILHWiAR2IF007fV4Zw%2Fimage.png?alt=media&#x26;token=b9b62038-a9d6-427a-b821-d67e0834f90e" alt=""><figcaption></figcaption></figure>

Press the button, select your language, and begin the translation work. For each string, just write your translation in the **Translation** field.

<figure><img src="https://3756443945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB6MFqxyFEkMr6ffOGnO0%2Fuploads%2F9klCUfLddDAvYyuyWUvc%2Fimage.png?alt=media&#x26;token=0b5cc5d3-bf93-40ad-82b9-2f3925c15c47" alt=""><figcaption></figcaption></figure>

When you've finished with your translation, press the `Save` button, and you'll be asked to name your new .po file.&#x20;

You have to stricly follow the WordPress naming convention, so the file name must start with **team-booking-** followed by the locale code of your language (i.e. German is _de\_DE_, you can find a list of WordPress locales [here](https://make.wordpress.org/polyglots/teams/)).&#x20;

Pay attention to the name of the file and to the locale code, otherwise WordPress won't be able to load the translations.

When saved, PoEdit automatically generates the .mo file as well.&#x20;

**The process is not yet finished: get in touch with our support, provide those files and the support crew will send back to you a group of new files.**

Then you should upload those files to the `wp-content/languages/plugins` directory of your website via FTP.&#x20;

Be sure that your language is correctly selected in the WordPress general settings, and your new translations should be instantly loaded.

{% hint style="warning" %}
Always keep a backup of your new or edited .po/.mo files. If you put or replace them in the original language directory of the plugin, they will be lost after a plugin upgrade. Instead, put them inside the `wp-content/languages/plugins` directory and they will be preserved.
{% endhint %}
