Commit 722367b0 authored by johnhuang0808's avatar johnhuang0808 Committed by bojanz
Browse files

Issue #2751679 by dww, johnhuang0808, bojanz: The address widget renders...

Issue #2751679 by dww, johnhuang0808, bojanz: The address widget renders subdivision dropdowns in the wrong language
parent 98ddd7b6
......@@ -270,6 +270,7 @@ class Address extends FormElement {
$subdivision_properties[] = FieldHelper::getPropertyName($field);
}
// Load and insert the subdivisions for each parent id.
$locale = \Drupal::languageManager()->getConfigOverrideLanguage()->getId();
$current_depth = 1;
$parents = [];
foreach ($subdivision_properties as $index => $property) {
......@@ -281,7 +282,7 @@ class Address extends FormElement {
break;
}
$parents[] = $value[$parent_property];
$subdivisions = \Drupal::service('address.subdivision_repository')->getList($parents);
$subdivisions = \Drupal::service('address.subdivision_repository')->getList($parents, $locale);
if (empty($subdivisions)) {
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment