• Resolved sne_ejo

    (@sne_ejo)


    Hi.
    We have a site with language set on Bulgarian. When picking a list view, the slug looks like events/месец and events/списък. And it shows a “nothing found page”. I changed the .mo and .po file. I swapped ‘list-Списък’ with ‘list-list’, and left ‘list-Списък’. The same with month, day, etc. Now it works OK. The slug is right and the display is in Bulgarian.

    But.

    I’m concerned what will happen when I update the plugin. I tried to put my translation in our-theme/languages. Doesn’t load it. Nothing happens when I put it in plugins/the-events-calendar/languages or in wp-content/languages/the-events-calendar-bg_BG.mo&po

    There are some translations missing in bg_BG version, some others that I don’t agree with, so I really want to have my own translation.

    Please, help
    Thank you

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi. Thanks for your detailed question.

    How about using the gettext filter for your desired customization?

    Thread Starter sne_ejo

    (@sne_ejo)

    What I understand from gettext filter is that I can change some of the translations, one by one.
    But I have like 200-300 that I want changed. As I said, some are not translated, and with some translations I don’t agree (for example in day view the selected date label “Day Of” is translated “почивен ден” which means “holiday”).
    That is why I made my .mo and .po files.
    But they don’t load. And I don’t want to upload them every time I update the plugin.

    My question is: is there a folder in which when I put my .mo and .po files, they will load instead of those in plugins/the-events-calendar/lang?

    Hey @sne_ejo,

    There’s no easy way of doing this. You’ll need to custom code a work around to load an alternative translation. I guess it’s a rather complicated path, but of course you can do so.

    I think it might be best to collaborate with the correct translation of the plugin and suggest changes for the strings you don’t see fit (or create overrides as Cliff noted). Here’s the code for adding ‘string overrides’:

    function tribe_custom_theme_text ( $translations, $text, $domain ) {
    
    	$custom_text = array(
    		'Website:' => 'Site:'
    	);
    
    	if(strpos($domain, 'the-events-calendar') === 0 && array_key_exists($text, $custom_text) ) {
    		$text = $custom_text[$text];
    	}
    
    	return $text;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);

    Please go over this guide about Translating The Events Calendar.

    Best,
    Nico

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘bg_BG Translation causing an slug error’ is closed to new replies.