Question

qTranslate creates additional language fields for products pages in JigoShop but not also for category|tags product as it does for posts.

If I put in the title of a menu item <!--:en-->title<!--:--><!--:fr-->title<!--:--> i'll get the translation I want. But when creting a new category|tag title the <!--:--> is striped out. How can I enable comments tags for cat|tag title?

Another option is to use [:en]Title[:fr]Titre in the same title field when creating a new category|tag product. On the admin panel I see the proper text for the language selected but for end user i see [:en]Title[:fr]Titre.

I found this link https://wordpress.stackexchange.com/questions/28165/translating-a-custom-taxonomy and according to this answer http://www.qianqin.de/qtranslate/forum/viewtopic.php? f=4&t=2045&start=0#p7380 I addet in functions.php

add_action('jigoshop_add_form', 'qtrans_modifyTermFormFor');
add_action('jigoshop_edit_form', 'qtrans_modifyTermFormFor');

Did not work. I don't see aditional translations fields for categories|tags in JigoShop.

The basic question is:

How do I translate product categories|tags in JigoShop using qTranslate?

Was it helpful?

Solution 2

Not the ideal solution but works.

In JigoShop/edit product category/name:

[:en] Big [:fr] Grand

In functions.php

function translate_q ($echo) {
    if (function_exists('qtrans_split')) {
        $selectLanguage = qtrans_split($echo);
        return $selectLanguage[qtrans_getLanguage()];
    } else {
        return $echo;
    }
}

qtrans_split and qtrans_getLanguage are functions created by qTranslate.

From JigoShop plugin directory I opened jigoshop_template_functions.php, I grabbed from jigoshop_breadcrumb() function all the echos in $echo variable and at the end I have:

echo function_exists('translate_q') ? translate_q($echo) : $echo;

You will have to do the same thing in other places in JigoShop. I posted here to be a starting point.

OTHER TIPS

I was having very similar problem. I found a solution here: http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=4064&start=10#p12940

Basically, all you have to do is to rename all the categories as suggested in the answer above, then add to your theme's functions.php file:

function p_filter_categories( $categories ) {
  if ( is_array( $categories ) ) {
    foreach ( $categories as $i => $cat ) {
       $categories[ $i ]->name = __( $cat->name );
    }
  } else {
    $categories->name = __( $categories->name );
  }
  return $categories;
}
add_filter( 'get_the_categories', 'p_filter_categories', 10 );
add_filter( 'get_the_terms', 'p_filter_categories', 10 );
add_filter( 'get_term', 'p_filter_categories', 10 );

Hope that helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top