• Am I missing something, or is it possible to translate this string:

    “Please checkout within XX Minutes XX Seconds to guarantee your items don’t expire.”?

    Second question is about sitewide notice. Is it possible to enable this great notice sitewide rather than in WooCommerce pages only? At least for me it is visible in the WooCommerce Category, Product and Cart pages only.

    https://www.ads-software.com/plugins/woocommerce-cart-stock-reducer/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author James Golovich

    (@jamesgol)

    I’ve added minimal support for translations but you are the first person to ask anything about it. Translating this string is complicated because there are two components to it

    $expiring_cart_notice = apply_filters( 'wc_csr_expiring_cart_notice', sprintf( __( "Please checkout within %s to guarantee your items don't expire.", 'woocommerce-cart-stock-reducer' ), $item_expire_span ), $item_expire_span, $expire_soonest );

    This generates the text but the countdown portion is separate, the javascript module I’m using for this does support localisation but we are not passing this information along so some changes will have to be made to the code.

    Hopefully one of the languages you are using is supported, the list is here: https://keith-wood.name/countdown.html#l10nPkgs

    Since the notices are using the WooCommerce notice facility you could use something like this to use shortcodes to add them elsewhere:
    https://docs.woothemes.com/document/woocommerce-cart-notices/

    Another option would be to create a function/shortcode yourself that calls the wc_print_notices() function. This is outside the scope of this plugin so I won’t be adding anything like it.

    Thread Starter thlinna

    (@thlinna)

    Thank you for detailed answer! The countdown timer javascript has been translated to my language, and it works perfectly.

    However, I did not follow how come other strings can be tranlated in the backend, but not this one?

    AFAIK translating “Please checkout within %s to guarantee your items don’t expire.” manually to the source code is not a good option, for it will be deleted everytime the plugin is updated. I believe the parameter “%s” can be replaced with the shortcode that is used in the admin backend to tranlate other strings too.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translation of strings’ is closed to new replies.