How to get active locale (language) of the page, from where visitor submit booking?

On the Booking Listing page exist ability to change language (locale) of emails, that will send to visitor during approving or declining of the booking. But how to detect language/locale of webpage, from where visitor submit the booking.
Here is instruction how to do this.
Please open the Booking > Settings > Fields page and add to the booking form this shortcode and JavaScript code:

</p>
<div style="display:none;"> Active Language: [text active_language class:wpbc_lang_field]</div>
<p><script type="text/javascript">
 jQuery(document).ready(function(){
    jQuery('.wpbc_lang_field').val( wpbc_active_locale );
 });
</script>

Its will add to your booking form new field [active_language] and JavaScript for auto-inserting active locale into this field. Please note, this field is not visible for visitors, because of this CSS: style="display:none;"

Also you will be need to add to the "Content of booking fields data" form (its at the bottom of Booking > Settings > Fields page) this shortcode:

<strong>Active Language</strong>:<span class="fieldvalue">[active_language]</span>

For showing this field at the Booking Listing page.

Available translations for paid versions and progress of translation

You can download the original translations files from here. You can check instruction how to make or update translations files at this page.

Translations available in paid versions of Booking Calendar:

  • English
  • Spanish [99% Completed]
  • Italian [99% Completed]
  • French [99% Completed]
  • Polish [99% Completed]
  • Greece[99% Completed]
  • Slovak [99% Completed]
  • Czech [99% Completed]
  • Dutch [99% Completed]
  • Danish [99% Completed]
  • Bulgarian [99% Completed]
  • Russian [99% Completed]
  • Croatian [99% Completed]
  • German [99% Completed]
  • Swedish [99% Completed]
  • Norwegian [99% Completed]
  • Hungarian [99% Completed]
  • Finnish [99% Completed]
  • Catalan [99% Completed]
  • Ukrainian [99% Completed]
  • Portugal [99% Completed]
  • Brazilian Portuguese [95% Completed]
  • Hebrew [17% Completed]
  • Belorussian [11% Completed]

Different Languages on the same website

Paid versions of Booking Calendar support configuration in different languages of the booking form, email templates and some other text options in the settings . The active language of the booking form is depending from the active locale of the site.

Booking Calendar is supported WPML and qTranslate plugins for dynamic changing of website locale (language).

General Usage:
[lang=LOCALE] - start new translation section in specific language, where LOCALE - locale of the translation.

Example of English and French translation of "Thank you" message:

Thank you for your booking.[lang=fr_FR]Je vous remercie de votre reservation.
-

Important! Please note, by default you need to have the English section and then divided by this shortcode [lang=LOCALE] sections in all other languages.

Of course you can have more than 2 language sections.

Example of configuration booking form in English and French languages at the Booking > Settings > Fields page:

[calendar]
First Name (required): [text* name]
Last Name (required): [text* secondname]
Email (required): [email* email]
Visitors: [select visitors "1" "2" "3" "4"]
Details: [textarea details]
[submit "Send"]
[lang=fr_FR]
[calendar]
Prénom (obligatoire): [text* name]
Deuxième prénom (requis) [text* secondname]
Email (obligatoire) [email* email]
Visiteurs : [select visitors "1" "2" "3" "4"]
Détails : [textarea details]
[submit "Envoyer"]

In the same way, you can configure the email templates on the Booking > Settings > Emails page and search form on the Booking > Settings > Search page, etc..

How to make translation of plugin?

  1. Before making translation of wordpress plugin, you need to have Poedit program. You can download it from here. Its completly free.
  2. Start Poedit program.
  3. Select File -> New catalog from POT file from menu and select POT file for translation usually its inside of languages folder.
  4. Type description of your translation.
  5. Enter The name of PO file.
    Name of file consist from 2 parts:
    1st part its the filename of the plugin (in our situation its "wpdev-booking"),
    2nd part its the Locale (for Spanish translation: "es_ES").
    So we will have name "wpdev-booking-es_ES.po".
  6. Save file to the "languages" folder of plugin.
  7. Make translation.
  8. If you find in translation "%s" symbol you should leave it at the same place as at original translation line.
  9. Please be sure that you do not set specific translation line as "Fuzzy". You can check it at the "Edit menu" - "Translation is fuzzy" (Ctrl + U)
  10. Save file after translation.
  11. If you make translation, you can send this translation files (*.po, *.mo) to info@wpbookingcalendar.com and we will add them to the next release of plugin. Thank you.