• Resolved Tea Romih

    (@tearo)


    Hi everyone,

    I’m trying to replace some words in the Slovenian translation of The Events Calendar because there are untranslated parts left and some declensions are off even in the fully translated parts. I’m a total newbie when it comes to coding, so the easiest way seemed to be the one suggested in your “Custom Wording in the Calendar” knowledgebase article.

    I created a child theme and edited the functions.php file according to the instructions. However, some replacements work and others don’t. I have the following code:

    function tribe_replace_strings() {
      $custom_text = [
        '%s onwards' => 'Prihodnji dogodki',
        'Zdaj!' => 'danes',
        'Subscribe to calendar' => 'Naroči se na koledar', 
        'Trenutno ni prihajajočih dogodki.' => 'Trenutno ni prihajajočih dogodkov.',
     ];
     
      return $custom_text;
    }

    If I inspect the code, it seems to me that “Trenutno ni prihajajočih dogodki.” (“There are no upcoming events” in English) should be an independent text string, just like the button text. But the replacement of the “Subscribe to calendar” button text works, the replacement of the other string doesn’t. Also, no matter what I do, I can’t seem to replace the “Latest Past” in the “Latest Past dogodki” showing up on the site.

    Here is the screenshot of the site I have issues with: https://www.dropbox.com/s/5kev0objclerfiw/Screenshot%202022-08-02%20114627.png?dl=0

    Many thanks for your help,

    Tea

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support WilloftheD

    (@abzlevelup)

    Hi @tearo, appreciate you providing details in regard to this issue here. That’s weird that should have worked, and it is the default way how WordPress replaces texts. Appreciate you bringing this to our attention, one of my colleagues already shared this with the team if it is related to a bug.

    I would also suggest you try out Loco Translate and search for “There are no upcoming %1$s.”, see the article here: https://theeventscalendar.com/knowledgebase/k/managing-translations-with-loco-translate/. Would be good if you could also try this one out.

    See the screenshot here:
    https://share.getcloudapp.com/OAu8Dwn8

    I’d also get back to you when I hear from the team as well.

    Best,
    Abz

    Thread Starter Tea Romih

    (@tearo)

    Hi Abz,

    Thank you for your reply, it seems that Loco Translate will do the trick. If I have any more issues, I’ll let you know. However, something funny is indeed happening. When I installed Loco Translate and synced it, the number of translated strings went from almost 100% to merely 22%, see here: https://www.dropbox.com/s/kdjrv3zbhopeolb/Slovenian_translation.png?dl=0. So I guess someone was recently updating the translations and some older strings just didn’t work anymore? My website now shows more untranslated text than it did before I installed Loco Translate. That’s not a problem, I can manually translate what I need, but funny enough, the plugin also overrides the functions.php file in the child theme. Is this expected?

    Any thoughts?

    Tea

    Thread Starter Tea Romih

    (@tearo)

    Also, the updated compilation of strings doesn’t show all words. For example, I can’t translate “Now” because there is no “Now” entry in Loco Translate.

    https://www.dropbox.com/s/4tc11u66cefratn/Slovenian_translation_2.png?dl=0

    Plugin Support WilloftheD

    (@abzlevelup)

    Hi @tearo, good to know that you tested Loco Translate, please test it on a staging site to be safe.

    Yes, perhaps that’s odd. Have you tried clicking on the “Sync” button again to make sure that all of the fields have the corresponding translations? That shouldn’t be < 50%.

    See the screenshot here:
    https://share.getcloudapp.com/7Ku65lRl

    Moreover, you could still do the Custom Wording as it overrides the Loco Translate.

    Let me know how it goes.

    Best,
    Abz

    Thread Starter Tea Romih

    (@tearo)

    Hi @abzlevelup,

    I synced it multiple times, it’s still at only 28% – the difference from the previously mentioned 22% comes from the translations that I personally added yesterday afternoon.

    Your screenshot shows that your last update was on June 13, 100% translated. I saw the same right after installing the plugin. But after syncing it’s showing last update on August 4, <30% translated. That’s the issue and I guess it’s not on your side but on the side of Loco Translate?

    Anyway, with the combination of Loco Translate and edits in the functions.php file I managed to get the wording under control. I’m using the most basic functions of your plugin, so my website will not be too affected even if some text remains untranslated. I’ll manually add new translations if the need arises.

    Thank you for your help!

    Plugin Support WilloftheD

    (@abzlevelup)

    Hi @tearo, apologies for this one. I tried syncing and updating my Loco Translate file but still have > 60%, I suspect because of the overrides you have or could be something else that’s causing this. Regardless, you could still populate and translate the 78%, sounds tedious but it is how Loco Translate works.

    Anyway, with the combination of Loco Translate and edits in the functions.php file I managed to get the wording under control. I’m using the most basic functions of your plugin, so my website will not be too affected even if some text remains untranslated. I’ll manually add new translations if the need arises.

    This sounds like a plan. That would work, translating what you only need and doing a combination of Loco and Custom Wording via overrides.

    Awesome! No worries. I’d be closing this thread, and please do not hesitate to bump a new ticket on our way if you need more assistance.

    Cheers,
    Abz

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom wording working only partially’ is closed to new replies.