Upstream version of https://gerrit.wikimedia.org/r/c/phabricator/translations/+/1047593
Details
- Reviewers
avivey - Group Reviewers
O1: Blessed Committers - Commits
- rARC0af89f7d323b: Add fallback languages for locale files
Set any languages and observe untranslated strings display proper PLURAL rules
With the downstream "translations" extension installed, set the language to traditional Chinese and see Simplified Chinese rather than English translations if they exist, like "Foo added/removed a project"
Diff Detail
- Repository
- rARC Arcanist
- Lint
Lint Warnings Severity Location Code Message Warning src/internationalization/locales/PhutilPortugueseBrazilLocale.php:17 TXT3 Line Too Long Warning src/internationalization/locales/PhutilPortugueseBrazilLocale.php:18 TXT3 Line Too Long Warning src/internationalization/locales/PhutilPortuguesePortugalLocale.php:17 TXT3 Line Too Long Warning src/internationalization/locales/PhutilPortuguesePortugalLocale.php:21 TXT3 Line Too Long Warning src/internationalization/locales/PhutilSimplifiedChineseLocale.php:17 TXT3 Line Too Long Warning src/internationalization/locales/PhutilSimplifiedChineseLocale.php:20 TXT3 Line Too Long - Unit
Tests Passed - Build Status
Buildable 1353 Build 1353: arc lint + arc unit
Event Timeline
What's the current behavior for fallback from cs_CZ? Would it make sense to set the default to en_US in the base class?
The current behavior if a fallback locale is not specified is to fallback to the proto-English string (English without applying pluralization). It probably does make sense, now that you bring it up, to fall back to en_US instead by default instead of doing that in every locale.
Done that. I left the technically-redundant methods where I have a lengthy comment explaining why I return en_US, since I think it's helpful to explain why that is.