• Resolved tonnick0033

    (@tonnick0033)


    Hello

    it seems that there is an issue with Woocommerce delivered email.

    subject : Se ha completado tu pedido en {site_title} del {order_date}.
    body : <p><?php printf( __( “Hi there. Your recent order on %s has been completed. Your order details are shown below for your reference:”, ‘woocommerce’ ), get_option( ‘blogname’ ) ); ?></p>

    y el resultado :
    subject : Se ha completado tu pedido en [:es]Hopefully[:en]Hop3fully[:fr]Hop3fully[:] del 28 octubre, 2015
    body : Hola. Se ha completado tu pedido reciente en [:es]Hopefully[:en]Hop3fully[:fr]Hop3fully[:]. Los detalles se muestran a continuación para tu referencia:

    It means that %s does not understand properly the qtranslate short code about the shop name. How can we solve that ?

    thx !

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Clause

    (@johnclause)

    No, %s will not be converted as _() works before it gets substituted. But get_option( 'blogname' ) should return already translated version on front end. Are you on admin side? If it is your code on admin side, you may wrap get_option( 'blogname' ) as apply_filter('translate_text', get_option( 'blogname' )), which will translate to currently active admin language. If this is not what you need, then we need to know what you are doing in details to be able to help meaningfully. Filter ‘translate_text’, can have second argument for language code too, which you potentially can extract from the order.

    Are you using integrating plugin “WooCommerce & qTranslate-X“? It should take care of email in proper language automatically. Does not it do it for you?

    If you are doing something custom, then looking at the code of functions “*email*” in /wp-content/plugins/woocommerce-qtranslate-x/qwc-admin.php may inspire you on what is needed.

    For further help contact us privately if needed.

    Thread Starter tonnick0033

    (@tonnick0033)

    I have plugin “qTranslate support for WooCommerce” installed. Do I have to replace it by “WooCommerce & qTranslate-X”?

    the code that I metioned is the original code from woocommerce emails template, nothing customized.

    if issue is only on blog name and if I have to “hack” the woocommerce code, the easiest way will be to replace %s by the blogname directly as it’s same on all languages ??

    What do you think ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘qtranslate-x / mails woocommerce delivered’ is closed to new replies.