• Resolved katalin89

    (@katalin89)


    Hi!

    I’m using your plugin to set up my page. To make it multilingual I’m using the Polylang plugin. Almost everything is working fine, except for some little translations, which I’m asking for your help.
    I set up shortcodes in different languages, but the “details” button in the room list and the calendar are never changing the language. I tried to load every translation setting in the Global/Translations menu in the admin panel, but none of these options were visible.
    Can you help me to find the solution with my Polylang plugin, or there is a shortcode that I can insert into one of the language/css files? Maybe an “if” code that decides how to translate these texts to a different language if the visitor is using one of those languages?

    I’m waiting for your suggestions, thank you.

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

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

    (@e4jvikwp)

    Hi,

    We would like to understand better what is currently not being translated. In short, there are two different “things” that could be translated: the language definitions and the database contents.

    An example of a language definition could be the strings “Book Now” or “Rooms”, while we call a “content” created through Vik Booking something like the name or the description of your rooms i.e “Double Room Superior”.

    You can translate anything into your preferred language(s), but depending on what you are translating, the system “responsible” of such translations will be different. In fact, all the language definitions are contained inside the .PO and .MO files of Vik Booking, which are loaded directly by WordPress depending on what’s the currently active language on your website, either front-end or back-end.
    Instead, contents like the names or the descriptions of your rooms will be translated by Vik Booking and its internal functions, but Vik Booking will “ask” the WordPress framework what’s the currently active language in this case.

    Shortcodes and their language attribute will not help you in this case, the language filter of the Shortcodes in Vik Booking is only needed to have a different URL for the same page, but for other languages.

    That said, any third party language plugin could obviously influence these behaviours, as they can dynamically change the currently active language. What we can tell you is that the plugin you mentioned is pretty common among our clients, just like 2 more popular language plugins. Honestly, we do not know how such plugins were set up, but as soon as they set the proper language in your site (front-end and/or back-end), Vik Booking will read it by using the WordPress native functions to load additional language files (.PO + .MO) as well as to apply the translations on the contents provided.

    Just for your information, on our website everyone can contribute on the translation files for our plugins for then downloading the .PO and .MO compressed files.

    I hope this helps. We invite you to reach out to our technical support team by using our website should you have any deeper questions. Thank you.

    Thread Starter katalin89

    (@katalin89)

    Thank you so much for your fast answer!
    If you would check my page maybe I can explain better… Here are the rooms/apartments
    https://kalihost.ro/apartmanok/
    The “details” button, as you see, is in English and it is not created by me, it is not a “content”. So that button should be in Hungarian as well and my problem is, even if I try to test the Hungarian form of the “details” button in the English .mo or.po files (so I’m changing the English text to Hungarian in those files), it is not changing at all when I refresh the page.
    Or maybe I am just changing the wrong lines… So I would be happy if you could tell me which lines should I translate to Hungarian to change the “Details”, also to find the Calendar’s rows… but when I refresh the page, nothing is changing.

    I changed the “details” here:

    #: libraries/language/site.php:672 libraries/language/system.php:260
    #: modules/mod_vikbooking_rooms/language/handler.php:60
    msgid "Details"
    msgstr "Részletek"

    and one of the Clanedar’s rows here:

    #: libraries/language/site.php:492
    msgid "Select a Check-in and Check-out Date"
    msgstr "Jel?ld be érkezésed és távozásod napját"
    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hello,

    I see that the “Details” button is not being translated, but some other language definitions are probably translated correctly, such as “per éjszaka”.

    For sure the .PO and .MO language files for Hungarian are not updated in your case, because they are incomplete and so they are missing some translations.

    We do not recommend to edit the language files of Vik Booking for English, you should rather work on a copy of those files to create the Hungarian translations. The files should have the tag of your language in the name, for example “vikbooking-hu_HU.po” and “vikbooking-hu_HU.mo”, and you should work on those files. That’s probably what you’ve done already.

    We know that some third party plugins can help you see the status of your translation file (Loco Translate for example), alternatively, a client software like Poedit could be used to complete your translation files for Hungarian.

    The Gettext extension of PHP for loading the translation strings will only need one translation for one “string” to be available in your .PO file, and so ideally, if you have already translated “Details” into “Részletek” this should work fine.

    It is necessary to understand if some translated strings are being read for Hungarian from its .PO/.MO files, or if no translation strings are read at all. In the latter case, WordPress is not loading your .PO/.MO files for Hungarian, either because they contain invalid contents, or because the path is incorrect.

    We suggest using a third party plugin or a client software just to make sure the content of your .PO/.MO files for Hungarian is correct.

    Thread Starter katalin89

    (@katalin89)

    The Polylang offers some translations through the Vik Booking admin, so this is why I could translate the “per night” text and not the rest of the text. The “per night” is already available on all of the 3 languages that I need:)

    I discovered that if I edit the “site.php”, then, of course, changes everything into another language, so I’m guessing the VikBooking is not recognizing the language files which are in the VIKBOOKING/LANGUAGES folder. Not the English files, either the Hungarian ones.
    Maybe the Polylang is “overwriting” these language files and it is trying to use its own translations? Do you have any idea what can I do if this happening? Or do you think that Loco Translate can help me in this case?

    Thread Starter katalin89

    (@katalin89)

    I tried Loco Translate and even if the translated Hungarian words were visible in the plugin, on the site weren’t. BUT after the first save, everything becomes visible. So I can translate everything now.
    Thank you so much for your help. You and Loco Translate saved me:))

    Plugin Author e4jvikwp

    (@e4jvikwp)

    That is good, not sure what that plugin did, but Vik Booking will load any files inside the “/languages” directory as long as the currently active language tag matches the name of the .PO/.MO files inside the /languages directory.

    The file “site.php” is a core file of Vik Booking, it’s the language handler for the front-end section of the website, and so it should not be modified as the .po/.mo files are compiled by parsing the source code of our handlers.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Translating “Details” button and the Calendar’ is closed to new replies.