• Resolved hunters-best

    (@hunters-best)


    Hi there, I hope someone has an idea:
    I use Woocommerce Germanized and WPML for a shop running in DE and EN. I cannot find a way to translate strings like “woocommerce_gzd_legal_text”. Whatever I write in the field will be shown in checkout – disregarding the language.

    Woocommerce Germanized saves texts like woocommerce_gzd_legal_text or woocommerce_gzd_legal_text_error in wp_options. In terms.php the function wc_gzd_get_legal_text() calls without any translatable text string and therefore gets the string with get_option( ‘woocommerce_gzd_checkout_legal_text’ ).

    Mind, there is a translatable string in woocommerce_germanized that sound close to right “With your order, you agree to have read and understood our {term_link}Terms and Conditions{/term_link} and your {revocation_link}Right of Recission{/revocation_link}.” as default text in the text field. That does not seem to be used anywhere at least as a fall back.

    Does anyone have an idea how to
    translate these strings without changing plugin files
    apply a filter to change to own registered and translatable string
    ???

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    you may use WPML String Translation to translate these options. Find more info here: https://wpml.org/documentation/getting-started-guide/string-translation/

    Cheers

    Thread Starter hunters-best

    (@hunters-best)

    Thank you for answering so quickly!

    actually tried that – but you have to generate and save an xml file in the plugin root folder to make it work. And I did not want to add anything in the plugin…

    With time running out, I solved it quick and dirty by adding filters to override all text strings I needed with my own (registered in my theme) strings.

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    the xml file does exist (woocommerce-germanized/wpml-config.xml) and is configured. You may need to search for the actual strings a little (should be prefixed by woocommerce_gzd though).

    I guess the quick-and-dirty solution is not very update-safe ??

    Cheers

    Thread Starter hunters-best

    (@hunters-best)

    Hello again!

    I did find the strings and translated them…. BUT, when I wrote a string in the Backend field (legal_text) – this string would be shown in both languages.
    Germanized -> Anzeige -> Rechtlicher Hinweistext (id=”woocommerce_gzd_checkout_legal_text”) – whatever you write in there will be shown in both languages. If you leave it empty you only have a checkbox with no text on the checkout page (also both languages).
    I hope we talk about the same strings….

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    could you explain a little more what you mean with “when I wrote a string in the Backend field (legal_text)”? Do you mean the Germanized settings or do you mean the WPML String Translation settings? You need to choose a string in your main language within the Germanized settings and then translate that string with the help of the WPML String Translation options to your secondary language.

    Cheers

    Thread Starter hunters-best

    (@hunters-best)

    Thanks a lot for your patience by the way, I appreciate that very much – and sorry if I sound a bit confused sometimes.

    My main language is German (WP settings), the second language I provide the website in is English
    In the Germanized settings I wrote a German text
    In WPML I searched the domain: admin_texts_woocommerce_gzd_checkout_legal_text and found the string “woocommerce_gzd_checkout_legal_text”
    The WPML translation had the german Text I had written in the Germanized settings (I can change that and the translation will change too – so no problem there)

    If I go to Checkout German – I get the german translation
    If I start another “shopping spree” with a clean, cookie free browser in English – I will also get the german translation on the checkout page.

    I hope this helps explaining. Thanks for your help.

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    don’t worry! I guess something is wrong with your configuration as I tested the scenario and it works just fine. Did you try to translate some other option strings via WPML (for other plugins and/or your theme)? Did that work out correctly? We do not take any further steps other than outputting the string via get_option (which is filtered by WPML) – so the only thing I can recommend you is check your setup and ask the WPML support for help. Maybe your configuration is messed up.

    Cheers

    Thread Starter hunters-best

    (@hunters-best)

    Thanks a lot – I will do just that and post here as soon as I find a solution.

    Thread Starter hunters-best

    (@hunters-best)

    Solution! As you suggested I got in contact the WPML Team.

    I put the German text in the Germanizer settings.
    I had to delete the translated strings from WPML.
    Realoaded the text-domains
    The main language was now set as German (String translations for these text-domains)
    When I translated the strings again – everything worked perfectly

    Thanks again for your help and patience.

    Thread Starter hunters-best

    (@hunters-best)

    reloaded – not realoaded ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘legal_text translation in Checkout page’ is closed to new replies.