• Resolved bogger1234

    (@bogger1234)


    Hello WpDevArt support team,

    we need to offer our booking in three languages (English, German and French).

    While the calendar is multilingual using the .mo files, the forms, extras and notifications are not translatable? Having multiple forms, extras and notifications for each language is no solution it seems. Because we need to show the single same calendar in 3 languages instead of having 3 calendars for each language.

    How can we accomplish this?
    Best regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter bogger1234

    (@bogger1234)

    I got a temporary fix for this:

    We use the plugin ‘WPGlobus’ to translate our website includes. In order to enable your forms, extras and notifications to translate we changed your code in file booking-calendar/includes/booking_class.php in the line 759:
    <label for=”wpdevart_’.$form_field[‘name’].'” ‘.$class.’>’.esc_html(apply_filters(‘the_title’, $form_field[‘label’])).$required. ‘</label>’;

    This allows us to include the table name in your form as:
    {:en}First Name{:}{:fr}Nom de Famille{:}{:de}Nachname{:}

    The output is then correct for each language on the website.

    We’re not sure this is the best approach, though.
    Any recommendations?
    Best regards

    Hello!
    Works fine for labels, but how does it works for option values?
    Kind regards

    Thread Starter bogger1234

    (@bogger1234)

    exactly the same. we had to change the code of the plugin as described above.

    Plugin Author wpdevart

    (@wpdevart)

    Hi dear user.

    Can you contact us at [email protected], we will try to help you.

    We need more details.

    Best regards,
    WpDevArt support team.

    Hello bogger1234!
    I’ve change the line 807 to
    <option value=”‘.esc_html($select_option).'”>’.esc_html(apply_filters(‘the_title’, $select_option)).'</option>
    but it doesn’t work.
    In German (first language), it shows me, correctly, only German, but with empty lines below and in english, both languages.
    Where is the issue?
    Thanks for your help.
    Kind regards

    Thread Starter bogger1234

    (@bogger1234)

    Hello jimston,

    there are a few things you have to do:
    – install the plugins WPGlobus, WPGlobus Translate Options
    – configure WPGlobus Translate Options to use active_plugins and form_field_text
    – edit the Booking Calendar WpDevArt php files:
    — booking_calendar.php
    — booking_class.php
    — controllers/Reservations.php
    — views/Reservations.php

    I didn’t change the line esc_html($select_option)…
    This is the code I changed:
    booking_class.php line 624:
    $content .= “<span class=’form_info’><span class=’form_label’>”. apply_filters(‘the_title’, $form_fild_data[“label”]) .”</span> <span class=’form_value’>”. $form_fild_data[“value”] .”</span></span>”;

    booking_class.php line 633:
    $content .= “<h6>”.apply_filters(‘the_title’, $extra_data[‘group_label’]).”</h6>”;

    booking_class.php line 634:
    $content .= “<span class=’form_info’><span class=’form_label’>”. apply_filters(‘the_title’, $extra_data[‘label’]) .”</span>”;

    booking_class.php line 762:
    <label for=”wpdevart_’.$form_field[‘name’].'” ‘.$class.’>’.esc_html(apply_filters(‘the_title’, $form_field[‘label’])).$required. ‘</label>’;

    booking_class.php line 764:
    <label for=”wpdevart_’.$form_field[‘name’].'”>’.esc_html(apply_filters(‘the_title’, $form_field[‘label’])).'</label>’;

    booking_class.php line 792:
    <label for=”wpdevart_’.$form_field[‘name’].'”>’.esc_html(apply_filters(‘the_title’, $form_field[‘label’])).'</label>’;

    booking_class.php line 829:
    <label for=”wpdevart_’.$extra_field[‘name’].'”>’.esc_html(apply_filters(‘the_title’, $extra_field[‘label’])).'</label>’;

    booking_class.php line 838:
    $field_html .= ‘<option value=”‘.$select_option[“name”].'” data-operation=”‘.$select_option[“operation”].'” data-type=”‘.$select_option[“price_type”].'” data-price=”‘.$select_option[“price_percent”].'” data-label=”‘.apply_filters(‘the_title’, $select_option[“label”]).'”>’.apply_filters(‘the_title’, $select_option[“label”]).’ ‘.(($select_option[“price_percent”])? ‘(‘.$select_option[“operation”].(((isset($this->theme_option[‘currency_pos’]) && $this->theme_option[‘currency_pos’] == “before” && $select_option[“price_type”] == “price”) ? $this->currency : ”) . $select_option[“price_percent”] . (((isset($this->theme_option[‘currency_pos’]) && $this->theme_option[‘currency_pos’] == “after” && $select_option[“price_type”] == “price”) || !isset($this->theme_option[‘currency_pos’])) ? $this->currency : ”)).(($select_option[“price_type”] == “price”)? “” : “%”).’)’ : ”).'</option>’;

    booking_class.php line 1124:
    $form .= “<tr><td style=’padding: 1px 7px;’>”. apply_filters(‘the_title’, $form_fild_data[“label”]) .”</td> <td style=’padding: 1px 7px;’>”. $form_fild_data[“value”] .”</td></tr>”;

    booking_class.php line 1133:
    $extras .= “<tr><td colspan=’2′ style=’padding: 1px 7px;’>”.apply_filters(‘the_title’, $extra_data[“group_label”]).”</td></tr>”;

    booking_class.php line 1132:
    $extras .= “<tr><td colspan=’2′ style=’padding: 1px 7px;’>”.apply_filters(‘the_title’, $extra_data[“group_label”]).”</td></tr>”;

    booking_class.php line 1133:
    $extras .= “<tr><td style=’padding: 1px 7px;’>”. apply_filters(‘the_title’, $extra_data[“label”]) .”</td>”;

    I’m not sure if I’m allowed to share the modified files. So if you like me to send you the files trop me your email address.

    Best regards

    Thread Starter bogger1234

    (@bogger1234)

    one more thing:
    you have to include the labels in all languages you need in this format:

    Form fields
    {:en}First Name{:}{:fr}Prénom{:}{:de}Vorname{:}

    They are then rendered only in the language you choose.

    Hello bogger1234!
    Thank you very much for your help!
    Can you send me te files to ****?
    Kind regards

    • This reply was modified 8 years, 4 months ago by jimston.
    Thread Starter bogger1234

    (@bogger1234)

    @jimston
    yes, of cause
    please give me an email address to send it to

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Multilingual calendar – Forms, Extras and Notifications’ is closed to new replies.