Skip to main content

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)

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.

LocoTranslate 1

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

LocoTranslate 2

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 won't be removed by a plugin update.

Finally, click on Start translating.

LocoTranslate 3

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

LocoTranslate 4

Using PoEdit (hard way)

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.

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.

PoEdit 1

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

PoEdit 2

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

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).

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.

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.

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

Important

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.