Support

Home Forums Event Espresso Premium BUG – "VAT/Tax Number" is not translatable using gettext

BUG – "VAT/Tax Number" is not translatable using gettext

Posted: October 30, 2016 at 3:01 pm

Viewing 3 reply threads


Simply Mindful

October 30, 2016 at 3:01 pm

I’ve been trying to change the “VAT/Tax Number” text that appears all over the site with ABN, however the gettext function recommended elsewhere in these forums doesn’t pick it up – I suspect because of the special characters in the translatable string resulting in an invalid array key.

I took your function in https://eventespresso.com/wiki/how-to-change-wording-with-poedit/

However, because of the invalid strings, both “VAT/Tax Number” and “VAT/Tax Number:” that appear in various template files never get picked up.

I need to make this change – where should I fix this so that it’ll actually work and not be overridden with your next update?


Tony

  • Support Staff

October 31, 2016 at 8:09 am

I suspect because of the special characters in the translatable string resulting in an invalid array key.

Which special characters do you mean? You can translate the string using:

VAT/Tax Number:

(Note the space on the end of the string, its needed as the original string must match exactly)

However ‘VAT/Tax Number: ‘ is included within 2 templates (Invoice and Receipt) and EE allows you to change the string from within the template rather than translating.

Go to:

Event Espresso -> Messages -> Default Message templates.

Find the Invoice message template and click to edit the template.

The shortcode that outputs that string is:

[INVOICE_PAYEE_TAX_NUMBER_*]

The default for that shortcode to output is VAT/Tax Number:, but you can change it by adding a custom string on the end of that shortcode:

[INVOICE_PAYEE_TAX_NUMBER_* prefix=ABN:]

Will output ‘ABN:’

Do the same for the Receipt message template and that should change any traces of ‘VAT/Tax Number: ‘.

  • This reply was modified 7 years, 11 months ago by Tony. Reason: add 'prefix' shortcode param


Simply Mindful

October 31, 2016 at 3:48 pm

[INVOICE_PAYEE_TAX_NUMBER_*ABN:] doesn’t appear to work.

I went digging through your docs for info on this and found this post:
https://eventespresso.com/topic/changing-vattax-number-label-on-invoicereceipt/
that uses different markup that did work though:

[INVOICE_PAYEE_TAX_NUMBER_* prefix=ABN:]


Tony

  • Support Staff

October 31, 2016 at 6:35 pm

My apologies, I completely missed the ‘prefix’ shortcode parameter from my example above, you do need to use that to change the shortcodes text. I’ll edit my original post to prevent further confusion in the future.

If you have any further problems please do let us know.

Viewing 3 reply threads

The support post ‘BUG – "VAT/Tax Number" is not translatable using gettext’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso