• Resolved Alelouya

    (@alelouya)


    For your information, I’m using your plugin (started with 3.6.1, updated 3.9.1) with list view ; my site is in French.

    Upcoming events of a category page : when there’s no event, the message shows up in English. (bugs noticed since 3.6.1.)

    =>No matching events listed under XXX. Please try viewing the full calendar for a complete list of events.

    I checked the .po file, there is a translation for this string ; apparently __() is not working in this code below in tribe-template-factory.class.php (function nothing_found_notice) :

    elseif ( ! empty( $tax_term ) && tribe_is_upcoming() ) {
                    TribeEvents::setNotice( 'events-not-found', sprintf( __( 'No matching events listed under %s. Please try viewing the full calendar for a complete list of events.', 'tribe-events-calendar' ), $tax_term ) );

    }
    By the way, it’s the same notice text for elseif ( ! empty( $tax_term ) && tribe_is_upcoming() ) and elseif ( ! empty( $tax_term ) ).
    I might be misunderstanding, but maybe it would be simpler to use only the latter ?

    Besides, I also get this :
    Notice: Undefined variable: tribe in … /the-events-calendar/lib/tribe-template-factory.class.php on line 273
    Notice: Trying to get property of non-object in …/the-events-calendar/lib/tribe-template-factory.class.php on line 273

    The variable $tribe is defined in this file under the function get_search_terms, and apparently is not global.

    Thank you in advance.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Brook

    (@brook-tribe)

    Howdy Alelouya,

    There is definitely an easier way! Checkout this guide. Using the snippet provided and modifying it as instructed, you can change any string of text including that one!

    Cheers!

    – BRook

    Thread Starter Alelouya

    (@alelouya)

    Howdy Brook,
    I followed the guidance, but that turned my site in English.
    Maybe I failed to explain my problem, but all I want is that the translation text that is already in the translations file shows up.
    Your code is using _(), and the translation exists for this string in the supplied translation file, so the text should be in the localized language, and I couldn’t find out why it’s not working.

    I switched my site to Spanish, and the string appeared in Spanish, so I assume that the problem comes from the translation file.
    Here are some tests I’ve done :
    In your “tribe-template-factory.class.php”, I replaced the non translatable string by another string which works, and the string was translated.
    Although the source text in .po seems exactely the same as the string, I pasted the string from.po, to the code file, but the string was not translated.
    I re-generated the .mo file and uploaded, but doesn’t work neither.

    Is it possible that the .po file is corrupted just at this line ?

    If this can’t be fixed, would it be possible to contact your french translator, for I suppose he had the same issue ?
    (Or could you suggest a way to replace the tribe-template-factory.class.php ?
    So far, I replaced the string in French directly in your plugin directory, since child-theme/lib/tribe-template-factory.class.php path doesn’t work for this file.)

    Brook

    (@brook-tribe)

    Oh I am sorry. I definitely misunderstood you before ?? . I reread everything, and it sounds to me like the french translation just needs to be fixed.

    The line you are referring to appears this way in the french .po file:

    “No matching events listed under %s scheduled for %s. Please try “

    But it should look like this:

    “No matching events listed under %s scheduled for %s. Please “

    The extra “try” bit is what is causing this to not translate properly.

    I believe we will need to update the .po file for french, then export the .mo. That will fix things up. If you are interested in helping us correct the French translation, could you open up a topic in the Premium Support Forums, specifically the “Translation” one? We can help you through that process of correcting the translation, then you will have the file that you need. You can copy/paste it over the current french .po and .mo files. Furthermore, it will be fixed in the next version of our plugin ?? .

    My apologies for the hassle. I wish there was an easier way. Let us know if you have any questions.

    – Brook

    Thread Starter Alelouya

    (@alelouya)

    I can consider contributing for updating the translation, but nonetheless, I definitely don’t understand.
    The string that can’t be translated is
    ‘No matching events listed under %s. Please try viewing the full calendar for a complete list of events.’, line 276 in your tribe-template-facory-class.php. When I paste this string and search in .po file, this string is found, which means that this matches exactely the string to be translated in .po. If this string in .po was cut after “please”, it wouldn’t work since that woudn’t match the string in the _() function, no ??? Besides, I don’t find the string you quoted, ie, “No matching events listed under %s scheduled for %s.” in lib/tribe-template-facory-class.php.
    Sorry, I’m totally lost !

    Brook

    (@brook-tribe)

    No worries. There is basically a small difference between the string in the french file and the string in all the other working language files. To fix it, we would have to do the steps I outlined above, which involves updating the .po file to match the base .pot file. Currently they are not identical. They need to be completely identical. And as you can see, they are not:

    “No matching events listed under %s scheduled for %s. Please try “

    “No matching events listed under %s scheduled for %s. Please “

    Cheers!

    – Brook

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘not found message translation not working’ is closed to new replies.