Thursday, October 17, 2019

Drupal 7 / Ubercart 7 - Multilingual Ubercart Messages

Drupal core 7.67 / Ubercart 7.x-3.13

We want to keep our users in their own preferred language as much as possible during the checkout process.  Unfortunately, at first, the checkout messages in Ubercart were not translating.

Here's an example of an "untranslatable" Ubercart message:

At first we tried using the Translate interface (where the string appeared when searched for) to translate the message - but it didn't work!  This turned out to be a false trail and very frustrating!  Don't use Translate interface for translating Ubercart messages!

As it turns out, Ubercart supports translation natively, but this feature needs to be turned on.  

In other words, Ubercart supports Multilingual variables, and those variables (once activated) may then be populated with the appropriate message in the appropriate language once suitably prepared.

The first thing to do is to enable the target areas of Ubercart as Multilingual variables in the Multilingual settings area.

Just enable *everything* under:

  • Ubercart checkout settings
  • Ubercart store settings.

(I think?)

Next, go to the Checkout screen of Ubercart and update all of the messages in:

  • Instruction messages
  • Completion messages:
Just choose the language at the top of the screen and then start typing in the translation, clicking on Save configuration when you are done.

Once the changes are made, the Ubercart message should translate successfully, like this:

No comments:

Post a Comment