(dev/translation#78) I18nSubscriber - Allow partial/negotiated locales
authorTim Otten <totten@civicrm.org>
Fri, 5 Aug 2022 10:02:04 +0000 (03:02 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 29 Aug 2022 03:00:14 +0000 (20:00 -0700)
commita6bd76228deffce6ac86249ab95f992971064b76
tree5a26a485e777b029606f40399812964235023fef
parent1190626dc6669a5a9242ab788a64d058e42dd9cb
(dev/translation#78) I18nSubscriber - Allow partial/negotiated locales

Definitions:

* A fully-supported locale is valid in all localization services (eg
  `ts()`, `Civi::format()`, `$dbLocale`).
* A "negotiated" or "mixed" locale can be used for communication, but
  it is not fully supported by all other layers. Consequently, it
  requires some kind of fallback or substitution.

Before:

* When an API call requests an alternate language (v3's `option.language` or
  v4's `setLanguage()`), it only activates fully-supported locales.
* Specifically, it validates against the multilingual configuration -- those
  are fully supported locales.) It otherwise ignores the alternate language.

After:

* When an API call requests an alternate language, it cacn activate
  fully-supported locales as well as mixed locales.
* Specifically, it asks `Locale::negotiate(...)` to examine the local
  configuration/resources and determine the effective locale.
Civi/API/Subscriber/I18nSubscriber.php