thereelscene

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Rewording "tickets left" to "places left" #1547136
    thereelscene
    Participant

    That did the trick! Thanks!

    in reply to: Rewording "tickets left" to "places left" #1545022
    thereelscene
    Participant

    Hi Cliff

    It hasn’t worked for me. I’ve added it to the top of functions.php in the child theme. I tried changing

    if ( 'event-tickets' === $domain ) {

    to

    if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) ) {

    But now on the events page in list view I get, for example “16 ticket left”, so something is wrong somewhere lol. I will keep looking and let you know if I find a solution.

    Cheers

    in reply to: Rewording "tickets left" to "places left" #1543640
    thereelscene
    Participant

    Hi

    No, I haven’t yet, ngettext() has different parameters to gettext() so I need to rewrite that code snippet but haven’t gotten round to doing it yet, I”ll post it when I get it working 🙂

    Cheers

    in reply to: Rewording "tickets left" to "places left" #1536838
    thereelscene
    Participant

    Thanks Cliff, here’s the code at the top of the child theme functions file:

    
    function tribe_custom_theme_text ( $translation, $text, $domain ) {
     
    	// Put your custom text here in a key => value pair
    	// Example: 'Text you want to change' => 'This is what it will be changed to'
    	// The text you want to change is the key, and it is case-sensitive
    	// The text you want to change it to is the value
    	// You can freely add or remove key => values, but make sure to separate them with a comma
    	// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
    	$custom_text = array(
    		'%s ticket left' => '%s place left',
    		'%s tickets left' => '%s places left'
    	);
     
    	// If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
        	if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
    		$translation = $custom_text[$translation];
    	}
        return $translation;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
    

    Cheers

Viewing 4 posts - 1 through 4 (of 4 total)