Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit 5c14b40

Browse files
committed
Add extra check to handle formal and informal locales.
The wp_locale in the translation_sets object do not contain the _formal or _informal part. For example: the wp_locale of Dutch (Formal) is nl_NL. The information that it's formal is only in the `slug` property. Because this->locale does have the _formal or _informal part, the comparison with the wp_locale had an incorrect result for informal and formal languages. This commit adds an extra check in which the slug is appended to the locale if the slug is not 'default' (i.e. is 'informal' or 'formal'). This string is compared to this->locale to make sure the correct $set is returned.
1 parent 758b585 commit 5c14b40

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/i18n-v3.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ private function retrieve_translation_details() {
388388
return $set;
389389
}
390390
}
391+
if ( $set->slug !== 'default' && strtolower( $this->locale ) === strtolower( $set->wp_locale . '_' . $set->slug ) ) {
392+
return $set;
393+
}
391394
}
392395

393396
return null;

0 commit comments

Comments
 (0)