Page MenuHomePhabricator

Make pt-br a fallback of pt
Closed, ResolvedPublic

Description

When European Portuguese messages don't exist, the Brazilian Portuguese version should be used as a fallback before going to the default (English). The language fallback code features loop detection code, so the fact that the opposite fallback pair exists (pt-br fallbacks to pt) shouldn't be a problem. So, apart from the pt-br --> pt fallback, a pt --> pt-br link should also be added.

A specific issue that would be solved by this change is the behavior of the {{#language:}} parser function, of the CLDR extension. Due to (1) pt-br being the default in CLDR (which is where the #language parser function gets its data) while pt-pt is the fallback, and (2) the way CLDR stores values in their database (for each variant, they only store the values that are different than the default variant), the European Portuguese language names aren't listed for most languages, and fallback to the English name. For example, {{#language:pt|pt-br}} returns "português" (correct), but {{#language:pt|pt}} returns "Portuguese" (wrong). Having this fallback in place would make the system work correctly.


Version: unspecified
Severity: enhancement

Details

Reference
bz30217

Related Objects

StatusSubtypeAssignedTask
ResolvedNikerabbit
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:52 PM
bzimport set Reference to bz30217.

Tagging this with needs-unittest -- this is exactly the sort of subtle thing that could break in several ways (breakage of loop detection code, refactoring accidentally dropping one of the connections, or changes to CLDR), so the patch for it should definitely include test cases.

EN.WP.ST47 wrote:

this is a test. ignore this.

Thinking about this more, there are probably many places which just loop through the fallbacks - and I think we should not break that assumption.

How about providing a function that returns a full fallback list for a given language, like:
pt -> pt-br, foo, ..., en
pt-br -> pt, foo, ..., en

For this we would need to introduce a new variable in the message files, or extend the current one with a new syntax.

Any further discussion needed before we can proceed as proposed in comment 3?

@Aklapper Would you help me? The problem came back and already happened here: https://pt.wikipedia.org/w/index.php?title=Wikipedia:Esplanada/anúncios&diff=prev&oldid=61370517 ; having the page translated in pt-br

@Juan90264: Hi, this task was resolved 10 years ago. If there is some problem today, then please follow https://www.mediawiki.org/wiki/How_to_report_a_bug - thanks a lot!

This is wrong task indeed. Abijeet and I looked into this comment, and our conclusion was that MassMessage was not used as intended and that there isn't a bug.

Aklapper added a subscriber: Esc3300.

@Esc3300: This task isn't related to "specific language code support in MediaWiki and Wikimedia production"