Separate Portuguese regional locale exports - #17009
Draft
Blackspirits wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed and why
This PR prevents Portuguese (Portugal) (
pt-PT) and Portuguese (Brazil) (pt-BR) from being exported by Crowdin to the sameptpaths.The current Crowdin configuration uses
%two_letters_code%. Both Portuguese regional variants share the ISO 639-1 codept, so enabling both target languages can make their exported files collide. Crowdin documentslanguages_mappingas the mechanism for overriding placeholder values for specific languages.This change:
pt-BRexplicitly topt-BR;pt-PTexplicitly topt-PT;language_pt-BRandlanguage_pt-PT, which are needed because MODX derives language display-name keys from the exact locale directory name;language_ptandlanguage_pt-brkeys as legacy compatibility identifiers for now.This PR deliberately does not edit, rename, or delete any non-English lexicon files. Those translations should continue to be managed through Crowdin according to the project contribution guidelines.
The existing generic
ptfiles are also left untouched in this change so installations already configured withptare not broken while the regional locale migration is completed.The current generic
pttranslation originated from the former Brazilian Portuguese (pt-br) lexicons. That existing Brazilian translation work should therefore be reused/migrated as the starting point for the canonicalpt-BRlocale in Crowdin rather than translated again from scratch.pt-PTshould remain a separate translation maintained independently for European Portuguese.How to test
crowdin.ymlas YAML.pt-BR->pt-BRpt-PT->pt-PTcore/lexicon/pt-BR/...core/lexicon/pt-PT/...core/lexicon/country/pt-BR.inc.phpcore/lexicon/country/pt-PT.inc.phpsetup/lang/pt-BR/...setup/lang/pt-PT/...language_pt-BRandlanguage_pt-PTonce the corresponding Crowdin exports are present.The modified YAML was parsed successfully and the modified PHP source content passes PHP syntax validation. Full export verification requires the MODX Crowdin project/integration.
Related issue(s)/PR(s)
Related to #14659.
Compatibility notes
This is intentionally a staged migration. The existing generic
ptlocale and the olderlanguage_pt-bridentifier are kept for backward compatibility, while the canonical regional locales are introduced aspt-PTandpt-BR.Once the
pt-PTandpt-BRexports are established and verified, the legacyptlocale andpt-bridentifier can be considered for deprecation and eventual removal in a separate follow-up change. Keeping that cleanup separate avoids breaking existing installations as part of this Crowdin export fix.Breaking change assessment
No public API signatures, return types, or defaults are changed. The legacy Portuguese identifiers are retained in this PR.
Test coverage
No PHP runtime tests were added because this change does not modify PHP runtime logic. Configuration structure and PHP syntax were validated locally; the remaining meaningful test is the Crowdin integration export itself.
Contributors
This follows the discussion in #14659 about maintaining separate European and Brazilian Portuguese localisations.
AI tool use
I used ChatGPT to help review the Crowdin configuration and MODX language-loading code, as well as to help draft this PR. The resulting changes were reviewed before submission.