Title: WordPress Translation Issue
Last modified: August 22, 2016

---

# WordPress Translation Issue

 *  [Varun Sridharan](https://wordpress.org/support/users/varunms/)
 * (@varunms)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/wordpress-translation-issue/)
 * I tried to change text using the below code
 *     ```
       function ctxtlearn_gettext( $ctxttranslation, $ctxttext ) {
          $ctxttrans = array_values(changeTxt_setting('trans',true));
          $ctxtdirty = false;
          $ctxtstrings_map = array();
          $ctxttext_words = explode( ' ', $ctxttext );
   
          foreach($ctxttrans  as $ctxtmytrans) {
       	   $ctxtstrings_map[$ctxtmytrans['key']] = $ctxtmytrans['val'];
          }
   
          foreach ( $ctxttext_words as $ctxtk => $ctxtword ) {
       	   $ctxtw = trim( $ctxtword, '.,:!?-_()' );
       	   if ( isset( $ctxtstrings_map[ $ctxtw ] ) ) {
   
       		   $ctxttext_words[ $ctxtk ] = str_replace( $ctxtw, $ctxtstrings_map[ $ctxtw ], $ctxtword );
       		   $ctxtdirty = true;
       	   }
          }
   
          if ( $ctxtdirty ) {
       	   return implode( ' ', $ctxttext_words );
          }
          return $ctxttranslation;
       }
       add_filter( 'gettext', 'ctxtlearn_gettext', 10, 2 );
       ```
   
 * If i give the below input it works
 * Post => My Book
    Page => My Vertical Comments => My Feedback
 * The Word before => is old string and after that is new string. if i pass it as
   an array it work’s. but if i provide the below input
 * First Name => My Name
    Username => User ID
 * The username text changes but First Name Not Changing in profile page.
    But if
   i split and provide its getting changed.
 * Who i can do this by providing Whole String..?

The topic ‘WordPress Translation Issue’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Varun Sridharan](https://wordpress.org/support/users/varunms/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/wordpress-translation-issue/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
