EU/UK VAT Manager for WooCommerce registers one shortcode, [alg_wc_eu_vat_translate]. Use it inside the plugin’s text settings at WPFactory > EU VAT (also reachable at WooCommerce > Settings > EU VAT), such as the field label, placeholder, description and validation messages, to show different text per language on WPML or Polylang stores. It is free.
The [alg_wc_eu_vat_translate] shortcode #
The shortcode reads the active language code (ICL_LANGUAGE_CODE, set by WPML and by Polylang) and outputs the text that matches, so a single settings field can carry several languages. It works two ways.
Wrapping form #
Wrap each language’s text in its own tag, and use not_lang for the fallback:
[alg_wc_eu_vat_translate lang="de"]EU-Steuernummer[/alg_wc_eu_vat_translate][alg_wc_eu_vat_translate lang="nl"]BTW nummer van de EU[/alg_wc_eu_vat_translate][alg_wc_eu_vat_translate not_lang="de,nl"]EU VAT Number[/alg_wc_eu_vat_translate]
Attribute form #
Pass both texts as attributes on a single tag:
[alg_wc_eu_vat_translate lang="de,nl" lang_text="EU-Steuernummer" not_lang_text="EU VAT Number"]
The attribute form is used only when lang, lang_text and not_lang_text are all present. If one is missing, the tag falls back to the wrapping form.
Parameters #
| Parameter | Description |
|---|---|
lang |
One or more language codes (comma separated), for example de or de,nl. The wrapped content (or lang_text) shows for these languages. Matching ignores case. |
not_lang |
Language codes for which the content should be hidden. Use it to build a fallback tag that shows for every other language. |
lang_text |
Attribute form only: the text to show for the lang languages. |
not_lang_text |
Attribute form only: the fallback text for all other languages. |
Basic HTML such as <strong> or a link is kept in the output.
How to translate the VAT field #
- Go to WPFactory > EU VAT (also reachable at WooCommerce > Settings > EU VAT) and open the General sub-tab.
- In Field label, replace
EU VAT Numberwith a shortcode set such as the wrapping example above. - Do the same for Placeholder and Description if you use them.
- Open the Messages sub-tab and repeat for the progress messages you show, for example Valid, Not valid and Is required.
- Click Save changes and load the checkout in each language.
Where to use it #
Paste the shortcode into any text setting on the General and Messages sub-tabs, for example the Field label, Placeholder, Description, the “Let customer decide” and “Valid VAT but still paying?” labels, and the validation progress messages. These settings are run through do_shortcode(), so the correct language renders on the checkout, the sign-up form and the order details.
Note: language codes are matched against your multilingual plugin’s active language. If no multilingual plugin is active, the lang content is hidden and the not_lang (fallback) text shows.
If it does not work #
- Only the fallback text shows: no
ICL_LANGUAGE_CODEis defined, or your codes do not match it. Use the same codes as your language switcher, for examplede, notde_DE. - The raw tag shows: the setting you pasted into is not one of the plugin’s text settings. The shortcode is not meant for pages or posts.
- Nothing shows for one language: add a
not_langfallback tag that lists every language you covered.
FAQ #
Does EU/UK VAT Manager have a shortcode to show the VAT number? #
No. [alg_wc_eu_vat_translate] is the only shortcode. To show the VAT number on orders, use General > Display, see Show VAT Numbers in Admin Orders and Reports.
Is it available in the free version? #
Yes. The shortcode works in both Free and Pro.
Can I also use WPML String Translation? #
The plugin ships a wpml-config.xml file, but the shortcode lets you keep all languages in one field without extra setup.
Related: Customize the VAT Validation Messages.
Need a hand? Our team answers every ticket on the EU/UK VAT Manager support forum.