Last modified: 2011-08-18 16:43:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32217, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30217 - Make pt-br a fallback of pt
Make pt-br a fallback of pt
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Niklas Laxström
: need-unittest
Depends on: 30216
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-04 11:41 UTC by Waldir
Modified: 2011-08-18 16:43 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Waldir 2011-08-04 11:41:47 UTC
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.
Comment 1 Brion Vibber 2011-08-04 14:48:07 UTC
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.
Comment 2 Dan Collins 2011-08-04 21:47:20 UTC
this is a test. ignore this.
Comment 3 Niklas Laxström 2011-08-05 06:53:39 UTC
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.
Comment 4 Siebrand Mazeland 2011-08-16 08:42:07 UTC
Any further discussion needed before we can proceed as proposed in comment 3?
Comment 5 Niklas Laxström 2011-08-18 16:43:44 UTC
r94908.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links