CRM_Core_I18n - Provide a better label for new/unknown locales
authorTim Otten <totten@civicrm.org>
Wed, 8 Apr 2020 04:14:38 +0000 (21:14 -0700)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 8 Apr 2020 22:20:49 +0000 (08:20 +1000)
commit8cc46dd8070e691349b9e52971f45761d64d2ecb
tree3dab7d2d382327cd66757c002a221a9456990f8b
parente265dbca06b45992617540348c933ce765a846e5
CRM_Core_I18n - Provide a better label for new/unknown locales

Overview
--------

Suppose you add new/unrecognized data files in the `l10n` folder - and then
you navigate to the screen `civicrm/admin/setting/localization?reset=1`.

Before
------

The new language appears in the admin UI as a blank item.

Every page in the app displays a warning about the unrecognized locale.

After
-----

The new language appears in the admin UI with a placeholder name (based on the code).

The warnings are not displayed.

Comment
-------

We've just had an issue where a new language was added to the `l10n`
data-set, and then all automated test-suites for all versions (incl `5.25`
RC and `5.24` stable) started to throw blocker errors on unrelated PRs.
This is because the `l10n` data is generally evergreen, but each branch/tag
of `civicrm-core` has the list hard-coded in multiple spots.

This patch tries to make the symptom less painful when mixing/matching
different revisions of `civicrm-core.git` and `l10n.git`.
CRM/Core/I18n.php