Thursday, October 17, 2019

Drupal 7 / Ubercart 7 - Translating Main/Burger Menu Items Properly

Drupal core 7.67 / Ubercart 7.x-3.13

My Drupal implementation was losing its translations, which was driving me crazy.  Parts of the website remained translated, other parts didn't.  It was maddening.

Turns out that Drupal 7's treatment of translation (i.e i18n) is not consistent.

  • Sometimes you need to use String translation
  • Sometimes you need to use Multilingual variables

Of course, like with many things Drupal, it's not entirely clear which system uses what.

In terms of the Main Menu, the best approach is to use Multilingual variables.

If you use the Translation interface to translate Main Menu items, the translation will persist only for as long as you don't execute the Refresh Strings process:

If you ever do invoke this process, you will LOSE the translations for your Main/Burger menu, which actually relies on Multilingual variables to do  its thing.

Here's how to do the Multilingual variables thing with respect to Main/Burger menus:

click on add Translation

Supply the translation, click on Save when you are done.

No comments:

Post a Comment