Advertisement
eventsmanager

change translatable text programatically

May 26th, 2014
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  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 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement