• Resolved netschmiede24

    (@netschmiede24)


    Hi,

    I am using WooCommerce on a German website selling tickets for flea markets, so every “product” is actually a “date” when this flea market happens. The markets are in several different cities and I have a product category for each of these cities.

    Now I have overview pages for each of these cities to explain the location etc. On the bottom of these pages, I am using the shortcode [products category=”xxx”] to display all the dates where a flea market will happen in this city.

    Now, if there is currently no date scheduled, the shortcode will display the general notice “No products were found matching your selection.” – translated to German: “Es wurden keine Produkte gefunden, die deiner Auswahl entsprechen.”

    I want to change this to “No DATES were found..” (“Es wurden keine TERMINE gefunden…”)

    I am using LocoTranslate for these things. I have trouble finding the right place where this translation is stored. There are two strings in the WooCommerce Plugin which have this sentence. I changed them both – but the output on the website is still “no products” instead of “no dates”.

    Is there a different location for the translation of the shortcode content?

    Please advise, thanks!

    Astrid

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moin,
    das l?sst sich mit einem Snippet l?sen:

    add_filter( ‘gettext’, ‘translate_woocommerce_strings’, 999, 3 );

    function translate_woocommerce_strings( $translated, $untranslated, $domain ) {

    if ( ! is_admin() && ‘woocommerce’ === $domain ) {

    switch ( $translated ) {case ‘keine Produkte’ :

    $translated = ‘keine Termine’;
    break;
    }
    }
    return $translated;
    }

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    WooCommerce typically uses a shared function to display the “No products were found” message across different parts of the site, including shortcodes and product listing pages.

    However, If some of your translated strings don’t show up as expected on your WooCommerce site, the first thing to check is if these strings have both a?Single?and?Plural?form in the?Source text?section.

    If this is the case, then it is necessary to translate both these forms for your translation to work as expected. To do this, please use Loco Translate’s Single and Plural tabs that show up in the translation section towards the bottom of screen, as pictured below.

    Also, can you make a screenshot of how this translation appears in the woocommerce-[lang]_[LANG].po?file?

    Alternatively, if you only need to change specific text, you can use the Say What? plugin. This plugin lets you replace text without needing to edit the WordPress.com .po file directly.

    For more details you can use this artilce.
    https://woocommerce.com/document/woocommerce-localization/#translate-or-replace-default-text

    Thank you for your cooperation and understanding.

    Thread Starter netschmiede24

    (@netschmiede24)

    There is no singular/plural tab for German translations. Here is a screenshot of the woocommerce_de_DE.po file:

    And here is the translations, I added:

    But as you can see, for example on this link: https://www.rieder-maerkte.de/standort/dueren-obi/ (at the bottom), the shortcode still displays “Es wurden keine Produkte gefunden.”

    Next attempt was to use the “Say What” Plugin that you suggested. I set it up as follows:

    Unfortunately this doesn’t change a thing.

    Any other ideas? The snippet that @chris2201 mentioned doesn’t work either.

    Thanks,
    Astrid

    • This reply was modified 4 months, 4 weeks ago by netschmiede24.
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I have tried to change the error message on my test site using local translate and I’m able to translate that text, as shown in the below screenshot:
    https://go.screenpal.com/watch/cZ6UIjncrIx

    Here is the result what we are seeing on my test site.
    https://go.screenpal.com/watch/cZ6UI6ncr2e

    Could you please make sure there is no update available for the translation in the update list.
    you can do this by following these steps:

    1. Go to to?Dashboard > Updates.
    2. Scroll to the bottom and click?Update Translations.

      After that please try to clear your browser cache and then try to check if your issue resolved.

    After that, please clear your browser cache and check if the issue is resolved.

    If you’re still unable to change the text, please open a support ticket with the plugin here: Loco Translate Support.

    You can include the link to this ticket in your new support request so that the team has all the information needed to assist you further.

    Thread Starter netschmiede24

    (@netschmiede24)

    Thanks – no translation updates are available. I just opened a support ticket with Loco Translate and hope they can help.

    Hi @netschmiede24,

    I just opened a support ticket with Loco Translate and hope they can help.

    It’s a good step that you’ve opened a support ticket with Loco Translate. Please keep us updated on what they have to share. While you’re awaiting their response, we’re here to assist you with any WooCommerce related issues you may be experiencing.

    Thread Starter netschmiede24

    (@netschmiede24)

    Well, that wasn’t helpful at all. See here: https://www.ads-software.com/support/topic/woocommerce-shortcode-block-translation/#post-18106980

    Do you have any other idea?

    Thanks,
    Astrid

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I understand how important it is for you to translate that message. I’ve found that by default, when using the shortcode to display a category, no error message appears if no products are assigned to that category.

    It seems like a third-party plugin or custom code on your site may be displaying the error message when no products are assigned to the category. This could be why the Say What? plugin and Loco Translate aren’t working as expected.

    To translate the error message, you’ll need to identify which plugin or your site theme is generating it. Here’s a simple test you can do:

    1. Deactivate all plugins except WooCommerce and Loco Translate.
    2. Activate a default theme like Storefront.
    3. Check if the error message appears when using the shortcode.

    If the error message no longer appears, it likely comes from your theme files or a third-party plugin. Here is the guide you help you how find which plugin generating that error message. https://woocommerce.com/document/how-to-test-for-conflicts/

    Alternatively, you could use custom code to translate the error message. However, since we don’t provide support for custom coding, you may need to handle this solution on your own.

    If you need more in-depth support or want to consider professional assistance for customization, I can recommend?WooExperts?and?Codeable.io?as options for getting professional help. Alternatively, you can also ask your development questions in the??WooCommerce Community Slack?

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.