"Order total" is translated in the translation interface, but still the untranslated string appears in /checkout//review and in user//orders/. In the latter you can also see "Billing information" and "Shipping information" that have a translation in database but still appear in English.

Comments

rszrama’s picture

Category: bug » support
Status: Active » Fixed

If I'm not mistaken, it's because these items are coming from fields. Their labels would need to be translated using some sort of field translation module.

damien tournoud’s picture

You need the i18n_fields module.

ñull’s picture

Category: support » bug
Status: Fixed » Active

I was able to translate the "Billing information" and "Shipping information" with i18n_field (part of i18n module) but still don't know where "Order total" can be translated. It is not among the fields I found.

rszrama’s picture

Category: bug » support

Can you please post a screenshot of what you're talking about?

ñull’s picture

StatusFileSize
new32.46 KB

As you can it is Spanish except the "Order Total". You can see this both in /checkout/ and /checkout//review

rszrama’s picture

Status: Active » Needs review

Ok, that part of the page is generated by the Price field display formatter called "Formatted amount with components".

The particule code comes from commerce_price_field_formatter_view around line 439:

        // Add the actual field value to the array.
        $components['commerce_price_formatted_amount'] = array(
          'title' => check_plain($instance['label']),
          'price' => $item,
          'weight' => $weight + 1,
        );

Notice that it's just using the label of the Price field instance, in particular the Order Total price field attached to orders. I'd expect you to be able to translate this label like any other field label with i18n_fields. Is this not the case?

ñull’s picture

StatusFileSize
new14.07 KB

Ok I found now where I need to translate it, but now something else is wrong. Something I noticed once in a D6 system. I still don't know how it got solved, because suddenly with an upgrade it was solved.

I explain. In /admin/commerce/config/order/fields/commerce_order_total/translate I find the following:

 Order Total Translation swapped
What you see is that "suddenly" the original language is set as Spanish, but when you look at the label it is not, it is in the English language. Editing is not possible because it is locked. Translating the English has no use, because it will never appear when in Spanish mode.

Spanish as original language should never happen in Drupal. The original language of Drupal is always English and in my case the translated second language is Spanish.

I bumped the old issue here. Nobody took care so now it happened again.

ñull’s picture

I noticed that changing the default language to English will change the original language back to that too.

I was able to translate the label now, but still I don't see that translation in the checkout. Was the path I indicated, where I did the translation, the right one?

ñull’s picture

Version: 7.x-1.0 » 7.x-1.1
StatusFileSize
new965 bytes

Upgraded to 1.1. Same issue in this version.

I started looking and attach here a patch that worked for me. You'll have to check if this is the right thing to do. Since the strings already passed once through t() elsewhere in the code, I think it is valid.

ñull’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

Status: Needs review » Needs work

The last submitted patch, Total_order_localisation-1351948-9.patch, failed testing.

ñull’s picture

Category: support » bug
amateescu’s picture

Status: Needs work » Closed (works as designed)

The field label cannot (and should not) be translated by Drupal core since D7.2.

See issue #1157426: Field system uses t() incorrectly and inconsistently for Drupal core and #1157512: Labels are not translated with i18n_field for Drupal core. for a fix that will be added to the Internationalization module.

amateescu’s picture

Status: Closed (works as designed) » Closed (duplicate)
raphael apard’s picture

I found this alternative : http://www.drupalons.fr/node/5247
It's works for me.

/*
*  Implements hook_themet_commerce_price_formatteed_components().
*  Fix Order total for drupal commerce.
*/
function yout_theme_commerce_price_formatted_components($vars) {
  $vars['components']['commerce_price_formatted_amount']['title'] = t('Montant Total');
  return theme_commerce_price_formatted_components($vars);
}
DrupalDan’s picture

Issue summary: View changes
StatusFileSize
new12.39 KB
new6.16 KB

I can't get the field label "Order total" translated. the sceenshot 1 is what it looks like when I search "Order total" as a field. And when I click on edit, I got the page as screenshot 2, with no filed shown up for me to enter the translation I want.

Did I miss anything or did it wrong?

Really want to get the issue fixed. All other fields and the module work great after all.