Last modified: 2014-09-20 19:42:55 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 T30596, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28596 - Add a parser function to return the fallback language for a given language code
Add a parser function to return the fallback language for a given language code
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Ryan Kaldari
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-18 18:59 UTC by Ryan Kaldari
Modified: 2014-09-20 19:42 UTC (History)
5 users (show)

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


Attachments

Description Ryan Kaldari 2011-04-18 18:59:49 UTC
Right now Commons relies on templates like {{GetFallback}} and {{GetFallback2}} to retrieve fallback languages. These templates consist of hard-coded switch statements which have to be updated by hand.

It should be rather trivial to code a parser function which returns Language::getFallbackFor( $code ) so that such templates aren't necessary.
Comment 1 Happy-melon 2011-04-18 19:02:25 UTC
Surely what Commons actually needs is nice ways of doing internationalisation, not for even more of MediaWiki's dirty laundry to be exposed to compound the hacks it already uses?
Comment 2 Ryan Kaldari 2011-04-18 20:33:51 UTC
Yes, there is definitely a bigger issue to solve here. Fixing this bug would only take 1 day, however, and would probably solve the transclusion limit problems currently happening on Commons. I disagree that it would compound the hacks. It would actually eliminate 1 of the hacks, but not the entire leaning tower of hacks. It might be a good interim fix until the bigger issues can be solved.
Comment 3 Umherirrender 2011-04-21 20:09:22 UTC
also: bug 23414, I do not know which is the better extensions.
Comment 4 Jarek Tuszynski 2011-04-24 01:30:28 UTC
Where is the MediaWiki's fallback code? We can at least synch commons templates with MediaWiki software, so it is consistent.
Comment 5 Roan Kattouw 2011-04-25 09:47:38 UTC
(In reply to comment #4)
> Where is the MediaWiki's fallback code? We can at least synch commons templates
> with MediaWiki software, so it is consistent.

See e.g. http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/messages/MessagesNds_nl.php?view=markup , which has $fallback = 'nl'; near the top of the file.
Comment 6 Ryan Kaldari 2014-01-08 18:47:57 UTC
Per Niklas: "Fallbacks are actually a list now, not a recursive tree you can just walk."
Comment 7 Jackmcbarn 2014-09-20 19:42:55 UTC
Scribunto now exposes this via mw.language.getFallbacksFor(). Adding a parser function to do it would seem to be clutter.

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


Navigation
Links