The labels for address fields in the Ubercart checkout pane insist on being in English even if you’ve set the rest of your site to another language.

As it turns out, this is a known issue. It’s caused by address field names being stored as variables, which is a problem because variable values can’t be localized.

A proper solution has yet to be implement. For now you can do one of two things:

  • If your site is in one language only that just so happens to be not English, just translate the field names. You can do this on admin/store/settings/checkout/edit/fields.
  • If your site is multilingual, you’ll have to hack the code. This is generally frowned upon, and for good reason, but if you must, you must. Here’s the simplest possible fix:

    --- uc_store/uc_store.module (original)
    +++ uc_store/uc_store.module (patched)
    @@ -1196,7 +1196,7 @@
    return '';
    }

    - return variable_get('uc_field_'. $field, $default);
    + return t(variable_get('uc_field_'. $field, $default));
    }

    What this does is pass every field name through the t() translate function. Officially this is incorrect usage of the t() function (as this function should never be used for strings that could possibly be changed by users in the admin interface). However, if the user can be trusted not to muck about on admin/store/settings/checkout/edit/fields , it’s a fairly reasonable solution.

    Especially since there’s likely to already be translations for the default, English, field names on your system.