• Resolved José Mundarain

    (@jemundarain)


    I’m going to be setting up a Portuguese, spanish and english website.
    How do I translate the datepicker? Does vikbooking compatibility with TranslatePress plugin?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi José,

    Thanks for contacting us. The datepicker is loading the language translations from the same PO/MO file with all the GetText definitions used by the rest of the pages of Vik Booking.

    You are free to use any plugin you want to manage the translations, but for Spanish and Portuguese we suggest downloading the contributed translations of our clients from our website. This way you will get a .PO and .MO file for each language, that you can directly upload on your website, or better, you can upload on the WordPress official translation site in case you have a polyglot account with permissions for Spanish and Portuguese.

    Having a dedicated translation file in PO/MO format for each language is much faster than having a database of translations generated by a third party plugin, which can still be useful to set up the multi-language functions on your website, or to override certain translations.

    We hope this helps!

    The VikWP Team

    Thread Starter José Mundarain

    (@jemundarain)

    Okay I understand. But I think I didn’t explain myself well. I want my site to be multilingual (Spanish, English and Portuguese), is there a way to make the language of the date picker change when using the language selector provided by Translate Press?

    Thank you very much in advance

    Thread Starter José Mundarain

    (@jemundarain)

    The jQuery UI Calendar has support for this, but the input id is assigned randomly.

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    We did understand your request, and of course as soon as the front-end language changes to a new one, the datepicker will apply the proper translations for that language. This is how a multi-language website is supposed to react.
    The datepicker calendars used by Vik Booking share the same translations of any other page or widget of our plugin, and so if you have a valid PO/MO language file for the currently active language, all language strings will be translated automatically, as they will be read from the apposite PO/MO file of your language.
    The datepicker calendars make no difference from the other sections/pages/widgets of our plugin.

    What we suggest is to prepare some translations in at least one language, either by uploading on your site an existing PO/MO translation file contributed by our clients (can be downloaded from our website) or by using a third party plugin to manage GetText language translations. Then you should use your preferred plugin to set up a language switcher and allow activating a different language. WordPress will do everything by itself, by loading the appropriate PO/MO language file for the currently active language.

    All you need to do is to have our plugin’s definitions translated into Spanish and Portuguese, then it’s up to your multi-language plugin to let the users switch the active language. Translations will then be made automatically, as they will be read for your current language.

    Regarding your last message:

    The jQuery UI Calendar has support for this, but the input id is assigned randomly.

    Do not rely on CSS selectors by ID for the datepicker calendars, as those IDs are voluntarily generated as random values. This is because the “id” attribute in HTML must be unique, and if you were to publish multiple instances of the same “Search Form” widget on the same page, you would no longer have unique IDs if we didn’t use this technique.
    If you need a CSS selector to identify the datepicker elements, you should rather rely on their “name” attribute, like ‘input[name=”checkindate”]’.

    We hope this helps!
    The VikWP Team

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translate datepicker’ is closed to new replies.