WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Cart translation show Items->Položky->Items

[Resolved] Cart translation show Items->Položky->Items

  • mkalinska

    @mkalinska

    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/

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

    @mkalinska

    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).

    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'),

    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.

    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.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Cart translation show Items->Položky->Items’ is closed to new replies.