If your site is available in several languages, you will need to translate two types of text:
- Default texts: these are the texts integrated into the Booking Activities code, they are the same for everyone (e.g.: the “Calendar editor” menu).
- Custom texts: these are texts that you have manually input (e.g. your activities’ title).
1. Translate default texts
First, you need to translate Booking Activities and its add-ons’ default texts into each of the desired languages, by following the instructions on this page: https://booking-activities.fr/en/docs/user-documentation/advanced-use-of-booking-activities/translate-booking-activities/
2. Translate custom texts
You will need WPML and its String Translation add-on.
- Installation and updates: https://wpml.org/faq/install-wpml/
- Initial setup and usage: https://wpml.org/documentation/getting-started-guide/
Once installed and configured, translatable fields are marked with a blue border and a flag.
Note: You must input your texts in the flag’s language. It’s basically your site’s default language, you can change it in WPML > Languages > Change default language.
Once you have saved your custom texts in the default language, you can translate them:
- Go to WPML > String Translation
- In the “In domain:” option select “Booking Activities”
- You’ll find all your custom texts in the table, click on the “add” icon () or “edit” icon () to translate them into the corresponding language
- If you can’t find your text, just display it on the frontend, this is enough to register it in the table
Note: Texts whose “Name” column differs from the “String” column are indexed, i.e. even if the original text changes, the existing translation will be used. You won’t have to translate it over again with each change. If the original text has changed, the “edit” icon () becomes “update” ().
In order to list your custom texts in this table, you just need to display them once on the frontend.
You can also go to Booking Activities > Settings > General > “Search translatable texts” option: click on “Find and translate”, but this operation is resource intensive. It is recommended to use it to list all your strings once at the beginning, but afterwards, you’d rather display the new / modified texts on the frontend to register them.
Here’s how to install and update qTranslate-XT (manually necessarily):
- Download qTranslate-XT for free from its github page (click on “Source code (zip)”)
- Unzip the qtranslate-xt-x.xx.x.zip file you just downloaded
- Rename the folder to “qtranslate-xt”
- Zip the folder back to qtranslate-xt.zip
- On your site admin panel, go to Plugins > Add new > Upload plugin > Choose file: select the qtranslate-xt.zip file you just made > Install now > Activate / Replace current with uploaded
Once installed and configured, translatable fields are marked with a blue border and a language selector appears wherever it is possible to translate your texts. All you have to do is to fill in the fields in each language, the translatable fields content changes dynamically when you select a language.