Title: Gettext and Plugin
Last modified: June 5, 2018

---

# Gettext and Plugin

 *  [lnbgrovestand](https://wordpress.org/support/users/lnbgrovestand/)
 * (@lnbgrovestand)
 * [8 years ago](https://wordpress.org/support/topic/gettext-and-plugin/)
 * After add something to cart and then choose a Pickup Location
    The “Schedule 
   a pickup appointment *” pops up.
 * I need to change this text to “Select Date” and having trouble with GETTEXT.
   
   The other two changes are working. The original text is coming from a plugin 
   called woocommerce-shipping-local-pickup-plus.
 * Any help is so appreciated! I am banging my head. thank you
 * I have tried woocommerce and woocommerce-shipping-local-pickup-plus for the theme_text_domain
   thinking this was the problem.
 * /**
    * Change text strings * * [@link](https://wordpress.org/support/users/link/)
   [http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext](http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext)*/
   function my_text_strings( $translated_text, $text, $domain ) { switch ( $translated_text){
   case ‘Cart totals’ : $translated_text = __( ‘Order Total’, ‘woocommerce’ ); break;
   case ‘Pickup Location’ : $translated_text = __( ‘Select Location’, ‘woocommerce’);
   break; case ‘Schedule a pickup appointment’ : $translated_text = __( ‘Select 
   Date’, ‘woocommerce-shipping-local-pickup-plus’ ); break; } return $translated_text;}
   add_filter( ‘gettext’, ‘my_text_strings’, 20, 3 );
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgettext-and-plugin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [JointByte](https://wordpress.org/support/users/jointbyte/)
 * (@jointbyte)
 * [8 years ago](https://wordpress.org/support/topic/gettext-and-plugin/#post-10366739)
 * Maybe the star is causing the issue? Have you tried checking if the string starts
   with “Schedule a pickup appointment” instead? ie:
 *     ```
       $check_text = 'Schedule a pickup appointment';
   
       if(substr($translated_text, 0, strlen($check_text)) === $check_text) {
          // do your thing
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Gettext and Plugin’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [JointByte](https://wordpress.org/support/users/jointbyte/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/gettext-and-plugin/#post-10366739)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
