• Resolved wphelpreq

    (@wphelpreq)


    Hello again,

    I followed your steps to make a translation via Poedit.

    • I downloaded the original en_US.po and .mo from my cpanel file manager within the vikbooking plugin.
    • I then found the elements I wanted to translate via Poedit and saved everything as xx_XX.po and .mo
    • I uploaded the new files in into the same folder as the original was: /wp-content/plugins/vikbooking/languages/

    However, when I then try to add a Calendar in that translated language, nothing is translated into it. It still remains in English. All the names of Days, Months and Legend elements are not translated.

    What am I doing wrong or missing?

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

    (@e4jvikwp)

    Hello,

    Thanks for the detailed steps. They look indeed correct, and VikBooking tells WordPress to load all language files from that exact directory under the text-domain “vikbooking”.

    The loading of the proper language file is handled by the WordPress framework itself, and so if your current language tag has got a dedicated PO/MO file, then this should be automatically loaded by WordPress.

    Our suggestion in these cases is to always test the results with a private/incognito session of your browser so that you won’t be logged in to your account and the language loaded will be the site’s default one. Most of the times WordPress loads first the user’s preferred language, but this only happens if you are logged into your account on the page you’re browsing.

    Therefore, if the website’s default language is, for example, Spanish, then WordPress will look for a PO/MO file named “vikbooking-es_ES.po” in the languages directory in /wp-content/plugins/vikbooking/languages/.
    As long as the file matches your current language in that directory, WordPress will automatically load it, and so the translations should be immediately visible and applied. Of course this whole scenario changes in case you’re using a third-party plugin to manage your multi-language website contents, because the languages root directory can be overridden.

    We hope this helps!
    The VikWP Team

    Thread Starter wphelpreq

    (@wphelpreq)

    Hello,

    I tried disabling the current Maintenance mode the site is in to access it via another browser as a logged-out visitor and it still didn’t load the translations.

    The default language site in WordPress options is set to XX.

    The shortcode of the Calendar has lang=”XX”.

    Yet, it loads the fully english version of the Calendar.

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hello,

    Thanks for the information. The language attribute of the Shortcodes will not affect what language will be loaded. In fact, the only purpose for using the language attribute is to have one unique type of Shortcode for each language, which can be published on the apposite page for that specific language.

    If your website is not using any third-party multi-language plugin, then it means your WordPress website has only got one language, which is the site’s default language defined in the page General – Settings. That will be the language file that WordPress itself will attempt to load from VikBooking, if available. It doesn’t matter what type of Shortcode or what language attribute your pages use, because the language is always loaded either by WordPress or by a third-party plugin that allows you to assign a specific language to each page of your website. Such language to be loaded is determined by the general WordPress settings (website default language) or by the settings of your pages whenever some third-party plugins are installed to manage multiple languages.

    Please try to change the WordPress general settings and choose the language for which you’ve created a PO file for VikBooking to be the website’s default language. At that point, WordPress should automatically load your custom PO file.

    Thread Starter wphelpreq

    (@wphelpreq)

    The site already is by default in language xx_XX.

    However, after attempting various solutions I finally simply tried the following:

    Since your shortcode says only lang=”xx” and not lang=”xx_XX” i tried naming the .po and .mo files that way as well. For example, instead of naming them vikbooking-it_IT.po, I renamed them into vikbooking-it.po.

    Now it works! It loaded it in a different language ????

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Thanks for sharing the solution you’ve found! That’s indeed correct, because the language tag is automatically given by WordPress for your currently active language. In case the language tag has got no suffix, like “el” for Greece, then your PO/MO files should be named accordingly. Instead, if your active language tag is spelled by WordPress with the country suffix like “it_IT” for Italy, then your PO/MO files should match the exact language tag in order for WordPress to be able to load them.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Translating .po / .mo’ is closed to new replies.