Home › Forums › Welcome! › Pre-Sales Questions › Removing a prefix
- This topic has 6 replies, 2 voices, and was last updated 8 years, 7 months ago by
Geoff B..
-
AuthorPosts
-
September 28, 2017 at 4:23 am #1356005
Mateusz EM
GuestSeptember 28, 2017 at 8:38 pm #1356566Geoff B.
MemberGood evening and welcome to the Events Calendar forum!
Thank you for your interest in our products.
We’ll be glad to answer your questions.To achieve this you simply need to customize our plugin language files.
I highly recommend reading the 3 following articles on translation:
- https://theeventscalendar.com/knowledgebase/translating-the-events-calendar/
- https://theeventscalendar.com/knowledgebase/how-to-override-plugin-language-files/
- https://theeventscalendar.com/knowledgebase/incomplete-translations/
The string you will want to change looks like “%1$s for %2$s”.
As an alternative, some of our users prefer using a plugin such as Loco Translate for that purpose.
You could also tweak and apply the following snippet in the functions.php file of your theme (without the PHP tag at the top): https://gist.github.com/andrasguseo/29903a974cb84060957881c17613c278
Best regards,
Geoff B.
September 29, 2017 at 3:36 am #1356636Mateusz EM
GuestThank you for your answer.
Unfortunately, the method of translation by loco translate didn’t.
I’m trying change functions.php but i don’t know which file to choose.
Main theme file “functions.php” or file in /plugins/the-events-calendar/funtions.php?September 29, 2017 at 12:33 pm #1356997Geoff B.
MemberGood afternoon,
Thank you for writing back.
The functions.php to modify is your theme’s (not our plugin’s).
2 words of cautions though:- Do NOT include the snippet’s opening <? PHP part in your functions file (there should already be one in place)
- Please use FTP or File manager to modify your functions.php file. This way if something goes wrong, you can roll back.
Have a good weekend,
Geoff B.
October 2, 2017 at 2:06 am #1357595Mateusz EM
GuestHi,
I’m adding code in functions.php and nothing happens.
add_filter('loop_shop_columns', 'loop_columns'); function tribe_custom_theme_text_with_context ( $translation, $text, $context, $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( 'for' => '-', ); // 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_with_context', 'tribe_custom_theme_text_with_context', 21, 4);October 2, 2017 at 2:47 am #1357604Mateusz EM
GuestSucceeded!
I edited file loop.php.Thanks for help!
October 2, 2017 at 10:21 pm #1358123Geoff B.
MemberGood evening,
I am super glad that you were able to get this to work for you!
Well played.You are welcome back in our support forums any time 🙂
For now, I am going to close this thread.
Have a great week!
Geoff B.
-
AuthorPosts
- The topic ‘Removing a prefix’ is closed to new replies.
