Advertisement
vapvarun

Translate Strings with gettext

Feb 2nd, 2018
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. add_filter( 'gettext', 'bp_resume_manager_strings', 20, 3 );
  2. /**
  3.  * Change comment form default field names.
  4.  *
  5.  * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
  6.  */
  7. function bp_resume_manager_strings( $translated_text, $text, $domain ) {
  8.  
  9.  
  10.         switch ( $translated_text ) {
  11.  
  12.             case 'Professional Experience' :
  13.  
  14.                 $translated_text = __( 'Sports Experience', 'bp-resume-manager' );
  15.                 break;
  16.  
  17.             case 'This group contains fields which will appear in Professional Experience section.' :
  18.  
  19.                 $translated_text = __( 'This group contains fields which will appear in Sports Experience section.', 'bp-resume-manager' );
  20.                 break;
  21.  
  22.     }
  23.  
  24.     return $translated_text;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement