• Resolved top-node

    (@top-node)


    How can I translate strings for this plugin using WPML? Currently my site’s default language is German, and all the text (z.B. EU VAT field label) is submitted in that language. I have now added English as an additional language but WPML does not give me this option. Has anyone had any success with this?

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

    (@daigo75)

    The EU VAT Assistant is fully integrated with WPML, out of the box. All the text it uses, as well as all the labels and strings entered in the settings page, are passed to the translation functions, so that it can be easily modified using localisation tools like WPML.

    The text domain used by the plugin is wc-aelia-eu-vat-assistant. If you use WPML’s features to scan for the text displayed by the plugins, you should be able to find it under that text domain.

    Thread Starter top-node

    (@top-node)

    Hi Diego, thank you for your answer. Unfortunately, I cannot confirm this. After scanning the plugin with WPML, I get three different text domains: “default”, “plugin-update-checker” and “easy_booking” – https://paste.pics/72a74f6446df92eecd21dd01f91457a8 .
    Also, the text I want to translate is the “EU VAT field label” in the “EU VAT Assistant – Settings”, not an actual string in the plugin – https://paste.pics/4b3c34fa88e6bba453f1c5ca9ef7e7d4

    Plugin Author Diego

    (@daigo75)

    I can confirm both that the text domain is wc-aelia-eu-vat-assistant and that the EU VAT Assistant passes all its strings, as well as its settings, to WPML. That has always been the case, since the first version.

    The “EU VAT field label” is one of the plugin settings. That field is is passed to WPML using the wpml-config.xml file, as indicated in the official WPML documentation about admin texts and options: https://wpml.org/documentation/support/language-configuration-files/#admin-texts. If you go to WPML > String Translation, you should be able to find the text there. Example: https://prnt.sc/1rbcunk

    Update
    Another example, from a fresh sandbox: https://prnt.sc/1rbgmet. This also shows the new domain woocommerce-eu-vat-assistant, which we will update in the next release.

    I also think that, to translate the plugin’s internal text, you will have to enable option Use theme or plugin text domains when gettext calls do not use a string literal, located at WPML > Theme and plugins localization (see https://prnt.sc/1rbgw6w). This is because the plugin still uses constants for the text domain, and the scan tool won’t be able to detect the correct value.

    To save time, you can do that when we release the version with the updated text domain, the coming week.

    Plugin Author Diego

    (@daigo75)

    Additional note: the text domain of the plugin is wc-aelia-eu-vat-assistant, but it should actually be woocommerce-eu-vat-assistant. I will add a note to update that element.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translating strings using WPML’ is closed to new replies.