Home › Forums › Ticket Products › Event Tickets Plus › label translations
- This topic has 4 replies, 3 voices, and was last updated 7 years, 10 months ago by John Paul.
-
AuthorPosts
-
June 11, 2016 at 9:18 am #1125580John PaulParticipant
Hi, I have used the following code snippet I get from another post on the fourm to translate ‘Tickets’ to ‘Places’ . Which has worked fine.
However, it will not change ‘Photo’ to ‘Grid’ or ‘Month’ to ‘Calendar’
can you advise what I need to do please.. thank you/*
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
* See the codex to learn more about WP text domains:
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology
* Example Tribe domains: ‘tribe-events-calendar’, ‘tribe-events-calendar-pro’…
*/
function tribe_custom_theme_text ( $translations, $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(
‘Tickets’ => ‘Places’,
‘Photo’ => ‘Grid’,
‘Month’ => ‘Calendar’,
);// If this text domain starts with “tribe-“, and we have replacement text
if(strpos($domain, ‘event-‘) === 0 && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}return $text;
}
add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);June 12, 2016 at 9:52 am #1125852GeorgeParticipantHey @John,
We have a slightly different version of that snippet available, along with some clearer instructions, on this knowledgebase article ? https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/
I would recommend replacing the code you’ve tried thus far with the similar-looking, but different code in that knowledgebase article.
Let me know if it works any more effectively!
— George
June 12, 2016 at 10:42 am #1125861John PaulParticipantMany thanks George
that did the trick !!
best regards
June 13, 2016 at 4:33 pm #1126421GeorgeParticipantGlad to hear it! 😀
Cheers,
George -
AuthorPosts
- The topic ‘label translations’ is closed to new replies.