0

We are using expresso store with the german translation.

During checkout and also in the backend all country names are in english and are not translated within the german translation file.

How can we translate the country names both within the checkout and the control panel?

1 Answer 1

0

Alas you can't easily on the backend - the list is defined in the countries.php file in the config folder and not relevant to the language. You could possibly write an extension to get round this, but might want to just put up with English on the backend due to the development time. There is another way using JavaScript if all you want is to show the customer country in the correct language, similar to an approach mentioned below - use the CSS&JS add-on to inject custom code onto your page. Target the Select dropdown or value shown for the selected customer on the specific field you're displaying, and swap out with your JS array. The problem comes if you want to show the translated country within emails or you want to be able to edit the country lists within the Control Panel...!

Frontend though, you're free to do whatever you like. I've used the Reegion add-on in the past and defined separate lists for each language, alternatively there's Multi-Language Country Lists, which I've never used so can't comment on. You could even use JavaScript to replace the Expresso Store list on the frontend with your own stored as a JS array. Whichever approach, as long as the Country codes remain the same, there will be no problem with what is stored in the DB associated with the customer.

Edit

Just checked with an existing build, the customer data held with the order holds the address entered, but not the Country full name, just the Country Code, so it still uses the lookup to get the name (which is fixed as English). As well as the config file, there is a exp_store_countries table which allows the admin in the control panel to select which countries are valid - again this isn't related to language.

2
  • Thank you Peter for taking the time for your response! :) But unfortunately that is exactly the case that i would like to send my customers their invoice order confirmation receipt with the correct country translation within their address. I'm not able to code an extension by myself and i expect a full translation including the country names when i buy a software which claims to be fully translated in german. Mar 30, 2016 at 14:49
  • It's a slight hack approach, but you could store the country selected (as in the label shown, not the 2 digit reference) into a custom field, then this will be accessible in the Email template for display. It will require JS on the checkout page to copy the label to the hidden custom field. Mar 30, 2016 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.