Page MenuHomePhorge

Add fallback languages for locale files

Authored by pppery on Jun 19 2024, 20:12.
Referenced Files
F2327864: D25695.1721882050.diff
Wed, Jul 24, 04:34
Unknown Object (File)
Wed, Jul 24, 01:10
Unknown Object (File)
Wed, Jul 24, 00:13
Unknown Object (File)
Tue, Jul 23, 12:13
Unknown Object (File)
Tue, Jul 23, 08:07
Unknown Object (File)
Tue, Jul 23, 07:51
Unknown Object (File)
Tue, Jul 23, 07:44
Unknown Object (File)
Tue, Jul 23, 07:37


Test Plan

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

rARC Arcanist
Lint Not Applicable
Tests Not Applicable

Event Timeline

pppery requested review of this revision.Jun 19 2024, 20:12

See T15861 for the issue here.

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.

Set fallback locale in base class

Don't make unnecessary whitespace changes

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.

This revision is now accepted and ready to land.Jun 21 2024, 09:23