Untranslatable Instance Of The Word "Tickets" in tribe-link-tickets-message

Home Forums Ticket Products Event Tickets Plus Untranslatable Instance Of The Word "Tickets" in tribe-link-tickets-message

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1167128
    Kevin Morton
    Participant

    I believe there’s an untranslatable instance of the word “Tickets” in /event-tickets/src/views/tickets/orders-link.php

    I’ve used Tribe’s own recommended tribe_str_replace function for changing all instances of a word throughout the Event Calendar plugins to another. In this case, changing “Tickets” to “Registrations” (with plurals and capitalizations accounted for). But in that instance, which shows up event pages with tickets when a logged in user has a ticket purchased for that event, it is changing only 1 instance of “Tickets” to “Registrations” and not both instances.

    So the message in the “tribe-link-tickets-message” div on the event page reads:

    You have 2 Tickets for this Event. View your Registrations

    I had to manually change the text in the core plugin file to get it to read:

    You have 2 Registrations for this Event. View your Registrations

    #1167143
    Cliff
    Member

    Hi Kevin. Thanks for your detailed question.

    I believe you’re referring to this line of code: https://github.com/moderntribe/event-tickets/blob/4.2.7/src/views/tickets/orders-link.php#L37

    Please reference that line of code and this KB article (I believe you’ll need to enter %d Ticket and %d Tickets separately) and let me know if you have any follow-up questions.

    #1167152
    Kevin Morton
    Participant

    Hi Cliff,

    In fact, that is the tribe_custom_theme_text/tribe_str_replace function I am already using. It is only replacing the 2nd instance of “Tickets” in this section of the site (which is line 46), and not the first instance (line 37/45).

    $custom_text = array(
    	'%d Ticket' => '%d Registration',
    	'%d Tickets' => '%d Registrations',
    );

    Results still in:

    You have 2 Tickets for this Event. View your Registrations

    So it appears gettext is not working to translate line 37/45.

    #1167664
    Cliff
    Member

    Kevin, I checked with one of our developers and apparently the code snippet in that KB article is only filtering gettext and not ngettext. I have asked that this KB article’s snippet be updated for this.

    In the meantime, you could try filtering ngettext yourself or you might try a plugin like Say What?

    Let me know if you get further along with this or if you still need help.

    #1176633
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Untranslatable Instance Of The Word "Tickets" in tribe-link-tickets-message’ is closed to new replies.