eventsmanager

change translatable text programatically

May 26th, 2014
382
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //Rewrite any gettext field, this works for any translation for any plugin, check the $domain == 'dbem' to be more specific
  3. function my_em_text_rewrites($translation, $orig, $domain) {
  4.     switch ($orig) {
  5.         case 'Booking is now fully paid and confirmed.' :
  6.             $translation = 'your text here';
  7.             break;
  8.         case 'Repeat this again for what you want to translate (needs to be exactly same text in english)' :
  9.             $translation = 'your text here';
  10.             break;
  11.         case 'You must allow us to collect and store your data in order for us to process your booking.' :
  12.             $translation = 'translated - You must allow us to collect and store your data in order for us to process your booking.';
  13.             break;
  14.     }
  15.     return $translation;
  16. }
  17. add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×