Score:2

How to translate the administrative area in an address field?

is flag

I am currently trying to change the confirmation email sent to purchasers after checkout to Japanese, but I am stuck because I don't know how to change only the arrowed part of the image, which shows the prefecture, to Japanese. Does anyone know how to make this part Japanese? This may be a very elementary question, but I have very little experience in web development and there are very few resources in Japanese on drupal commerce, so I have no idea what to do.

enter image description here

cn flag
Welcome to Drupal Answers :) Have you tried searching for the string you want to translate in the interface translation (/admin/config/regional/translate)? It might already be in there as an entry you can just edit. If it's not, could you edit the question and just explain what the arrowed label/field is within the email? That might make it easier for non Japanese speakers to work out where it would be translated if it's not interface text
Score:2
cn flag

Drupal Commerce uses the Address module for handling addresses.

In Address fields, Japanese prefectures correspond to Administrative area (e.g. State or Province).

I just installed the Address module in a Japanese language Drupal 10 site and the prefectures were translated correctly by default. So, it seems you failed to get the translations when you installed the module.

Usually, contrib module translations are bundled as PO files with the module. However, for the administrative divisions in the Address module, the commerceguys/addressing library is used, which provides its own translations.

There are docs for modifying the translations, but since the prefecture should already be translated, I would do the following:

  • Make sure that you installed Commerce/the Address module with composer.
  • Check the translation settings at /admin/config/regional/translate/settings. Make sure that the translation source is Drupal translation server and local files.
  • If the site has multiple languages, check the language settings at /admin/config/regional/language/detection and ensure that the language is being correctly set to Japanese for the logged-in account.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.