CRM_Core_I18n - Provide a better label for new/unknown locales #17021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Mixing the current
l10n
data with a stablecivicrm-core
codebase leads to warnings/failures about the localenl_BE
(even if you don't use that locale). This patch aims to makecivicrm-core
more forward-compatible asl10n
evolves.Suppose you add data-files for a new language/locale in the
l10n
folder - and then you navigate to the screencivicrm/admin/setting/localization?reset=1
. How is this new language presented?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, even if your system never uses that locale.
When running automated tests, the warning can lead to a large number of false-negatives.
After
The new language appears in the admin UI with a placeholder name (based on the code).
Also, the pervasive warning goes away.
Comment
We've just had an issue where a new language (
nl_BE
) was added to thel10n
data-set, and then all automated test-suites for all versions (incl5.25
RC and5.24
stable) started to throw numerous errors (about the unrecognized locale) on unrelated PRs. The issue is thatl10n
data is generally evergreen (so new languages can be added at anytime), but each branch/tag ofcivicrm-core
has multiple hard-coded language lists (which locks in the list for a given release).Mixing the current
l10n
with a stablecivicrm-core
leads to the warnings/failures. This patch tries to make the symptom less painful when mixing/matching different revisions ofcivicrm-core
andl10n
.