• Resolved juhokokku

    (@juhokokku)


    Hello

    I can not get the language files (mo/po) working with my site.
    The wpml function the plugin uses __() in settings-array.php returns only english strings.
    Custom translation files are included in plugin folder, my theme lang folder and languages/plugins/ folder, but not one of these works.
    I think it is the plugin itself which does not translatete strings correctly.

    I am using Loco Translate to manually enter and save the string translations.

    Thank you for the help!

    • This topic was modified 6 years, 9 months ago by juhokokku.
Viewing 1 replies (of 1 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    Hello,

    in the /wp-content/plugins/wp-multi-step-checkout/languages/ folder there are the German and French translations. They seem to work alright on my side.

    As a quick test, to see if the plugin’s translation works, you can rename the French translation file to your language. For example, if you language is Japanese, then you can rename the wp-multi-step-checkout-fr_FR.mo to wp-multi-step-checkout-ja.mo. See this page if you’re not sure what your language’s locale is. If you see the strings in your backend changed to French, then there is an issue is with your translation file.

    Note that the .po/.mo files are used only for translating the text in the backend. For translating the step and button titles in the frontend you can simply edit them on the WP Admin -> WooCommerce -> Multi-Step Checkout -> Text on Steps and Buttons page.

    I didn’t know that you can translate a plugin by putting a .mo file into the theme’s lang folder or in the languages/plugins/ folder. Nor did I find any documentation related to this.

    Please read the WordPress documentation related to internationalization. There you’ll find that:

    • the __() function is from WordPress Core, not from WPML.
    • The translation is loaded only from the plugin-name/language/ folder, unless declared otherwise in the plugin’s header.
    • The translation’s file name has to follow the {text-domain}-{locale}.mo format, where the {text-domain} is the plugin’s slug (wp-multi-step-checkout in this case) and the {locale} is the language code and/or country code (for example: ‘de_DE’ for German, ‘ja’ for Japanese or ‘es_AR’ for Spanish in Argentina).
    • This reply was modified 6 years, 9 months ago by Diana Burduja.
Viewing 1 replies (of 1 total)
  • The topic ‘Language files not working’ is closed to new replies.