I cannot translate Price label Hi, i cannot translate price label. Any clues? Log in or register to post a comment. Najtsirk Posted: Oct 12, 2011 Comments Entity translation + i18n_field Randy Fay on October 12, 2011 I think you'll want [Entity Translation](http://drupal.org/project/entity_translation) (read the project page there, which has a pointer to an [early article](http://randyfay.com/node/88) and Gabor's excellent articles). See [this issue](http://drupal.org/node/1030066) which says that the i18n_field module, a part of [i18n](http://drupal.org/project/i18n) solves the label problem. If it doesn't please reopen that issue. Log in or register to post a comment. These solutions does not Najtsirk on October 13, 2011 These solutions does not solve the problem. Still getting 'Price' in my price label, 'Total order' in my total order label and 'items' in number of items in my shoping cart. The only thing taht helped was to wrap $components['commerce_price_formatted_amount'] = array( 'title' => check_plain($instance['label']), 'price' => $item, 'weight' => $weight + 1, ); with t() functions, like that: $components['commerce_price_formatted_amount'] = array( 'title' => check_plain(t($instance['label'])), 'price' => $item, 'weight' => $weight + 1, ); Log in or register to post a comment. Not what t() is intended for... but works Randy Fay on October 13, 2011 Yeah, that's not really what's intended, but it works. There are better ways, we can hope. BTW: You don't need both check_plain() and t(). Just go with t(). Log in or register to post a comment. I have the same issue Laurent Bekaert on January 13, 2012 Ok is there an other way to translate the price label? If not where do I need to put in that code? Ok I found a solution here http://drupal.org/node/1121722 Log in or register to post a comment. Simple solution here drukmetkleur on December 24, 2013 https://drupal.org/node/1451132#comment-5984944 Log in or register to post a comment.
Entity translation + i18n_field Randy Fay on October 12, 2011 I think you'll want [Entity Translation](http://drupal.org/project/entity_translation) (read the project page there, which has a pointer to an [early article](http://randyfay.com/node/88) and Gabor's excellent articles). See [this issue](http://drupal.org/node/1030066) which says that the i18n_field module, a part of [i18n](http://drupal.org/project/i18n) solves the label problem. If it doesn't please reopen that issue. Log in or register to post a comment.
These solutions does not Najtsirk on October 13, 2011 These solutions does not solve the problem. Still getting 'Price' in my price label, 'Total order' in my total order label and 'items' in number of items in my shoping cart. The only thing taht helped was to wrap $components['commerce_price_formatted_amount'] = array( 'title' => check_plain($instance['label']), 'price' => $item, 'weight' => $weight + 1, ); with t() functions, like that: $components['commerce_price_formatted_amount'] = array( 'title' => check_plain(t($instance['label'])), 'price' => $item, 'weight' => $weight + 1, ); Log in or register to post a comment.
Not what t() is intended for... but works Randy Fay on October 13, 2011 Yeah, that's not really what's intended, but it works. There are better ways, we can hope. BTW: You don't need both check_plain() and t(). Just go with t(). Log in or register to post a comment.
I have the same issue Laurent Bekaert on January 13, 2012 Ok is there an other way to translate the price label? If not where do I need to put in that code? Ok I found a solution here http://drupal.org/node/1121722 Log in or register to post a comment.
Simple solution here drukmetkleur on December 24, 2013 https://drupal.org/node/1451132#comment-5984944 Log in or register to post a comment.
Comments
Entity translation + i18n_field
I think you'll want [Entity Translation](http://drupal.org/project/entity_translation) (read the project page there, which has a pointer to an [early article](http://randyfay.com/node/88) and Gabor's excellent articles).
See [this issue](http://drupal.org/node/1030066) which says that the i18n_field module, a part of [i18n](http://drupal.org/project/i18n) solves the label problem. If it doesn't please reopen that issue.
These solutions does not
These solutions does not solve the problem. Still getting 'Price' in my price label, 'Total order' in my total order label and 'items' in number of items in my shoping cart.
The only thing taht helped was to wrap
$components['commerce_price_formatted_amount'] = array(
'title' => check_plain($instance['label']),
'price' => $item,
'weight' => $weight + 1,
);
with t() functions, like that:
$components['commerce_price_formatted_amount'] = array(
'title' => check_plain(t($instance['label'])),
'price' => $item,
'weight' => $weight + 1,
);
Not what t() is intended for... but works
Yeah, that's not really what's intended, but it works. There are better ways, we can hope.
BTW: You don't need both check_plain() and t(). Just go with t().
I have the same issue
Ok is there an other way to translate the price label?
If not where do I need to put in that code?
Ok I found a solution here http://drupal.org/node/1121722
Simple solution here
https://drupal.org/node/1451132#comment-5984944