WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Cart translation show Items->Položky->Items (6 posts)

  1. mkalinska
    Member
    Posted 11 months ago #

    WP 3.6
    Woocommerce v 2.0.14
    theme : Mystile
    plugin Woo Cart Tab: 0.2.1

    In Top menu (at present hidden) and in plugin Cart - Tab(on right side) the translation of word Item is not shown in right language (cs_CZ)

    There is shop with products:
    http://www.pomponella.cz/

    Try it and you'll see like in one second the word "Item" is changed in front of Your eyes to "Položka" and then into "Item".

    I'v checked translation and plural form of cs_CZ files in:
    theme
    plugin
    woocommerce

    Thanks for any ideas.

    http://wordpress.org/plugins/woocommerce/

  2. mkalinska
    Member
    Posted 11 months ago #

    UPDATE:

    just happend with Mystile theme.

    When Wootique or Artificer theme used, the word ITEM is translated to POLOŽKY (of course first the cs_CZ file has to be created).

  3. mkalinska
    Member
    Posted 10 months ago #

    Mistake found in code of theme Mystile.

    file: theme-woocommerce.php (includes folder)
    row: 367

    wrong code:
    echo '<span class="contents">' . sprintf(_n('%d item', '%d items', $woocommerce->cart->get_cart_contents_count(), 'woothemes'),

    right code:
    echo '<span class="contents">' . sprintf(_n('%d item &ndash; ', '%d items &ndash; ', $woocommerce->cart->get_cart_contents_count(), 'woothemes'),

  4. Kanye_East
    Member
    Posted 7 months ago #

    I'm not sure how adding a dash can fix the issue, if you can explain please do.

    After some further googling I came across some information to quickly patch this up. Here's a working example for that same line 367:

    echo '<span class="contents">' . __( sprintf(_n('%d [:en]item[:fr]article', '%d [:en]items[:fr]articles', $woocommerce->cart->get_cart_contents_count(), 'woothemes'), $woocommerce->cart->get_cart_contents_count())) . '</span>';

    Long and short of it: qTranslate's ‘Quicktags’ work so long as they're enclosed in WP’s translate function ‘__()’, for .php files.

  5. mkalinska
    Member
    Posted 7 months ago #

    Kanye_East

    Your solution will not work for all languages and does not respect translation philosophy.

    If you just add dash .po file for your language translate it right. Before that, you ended with untraslated (english) word.

  6. Kanye_East
    Member
    Posted 7 months ago #

    Can you explain further? I've been ad hocing my way through this terribly because .po .mo translations didn't take effect with mystile.

Reply

You must log in to post.

About this Plugin

About this Topic