Last modified: 2014-09-24 00:15:09 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 T40652, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38652 - Gallery always uses user language (as opposed to say content lang)
Gallery always uses user language (as opposed to say content lang)
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-24 21:36 UTC by Bawolff (Brian Wolff)
Modified: 2014-09-24 00:15 UTC (History)
2 users (show)

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


Attachments
ImageGallery use appropriate lang. (3.10 KB, patch)
2012-07-24 21:36 UTC, Bawolff (Brian Wolff)
Details

Description Bawolff (Brian Wolff) 2012-07-24 21:36:18 UTC
Created attachment 10884 [details]
ImageGallery use appropriate lang.

ImageGallery always uses the user interface language, which sometimes is
bad if the gallery is on a content page via <gallery> or an extension.

I have a patch to fix this, but I'm not sure I like it (attached) So adding to bug for now while i think about it.
    

    
This issue is rather minor since it mainly affects the showfilesize
option, which is not triggerable from the <gallery> tag hook,
however some extensions output galleries in content pages too.

what this patch does is:

Add a method to trigger using content language instead, and also
get the language object from parser if parser object is available.

(Would Context something or other be better?)
Comment 1 matanya 2012-08-11 23:11:54 UTC
did you finish thinking? :P Please push to gerrit if you find it good enough.
Comment 2 Bawolff (Brian Wolff) 2012-08-15 19:56:57 UTC
I got sidetracked [I'm a bit of a flitty person and have a tendency of doing that], but basically I don't really like it - it seems ugly to me - using lang globals instead of context, and the distinction between parser vs non-parser. OTOH I'm not sure what a better method would be
Comment 3 Robin Pepermans (SPQRobin) 2012-08-15 20:02:03 UTC
In which cases it ImageGallery used not in the content? Because, if it's only on special pages, you can just use the page content language (i.e. parser language) because that is the same as the user language on special pages.
Comment 4 Bawolff (Brian Wolff) 2012-08-16 12:02:10 UTC
(In reply to comment #3)
> In which cases it ImageGallery used not in the content? Because, if it's only
> on special pages, you can just use the page content language (i.e. parser
> language) because that is the same as the user language on special pages.

Also category pages at the bottom of the page. (However in that case it is also not passed a parser object as well.)
Comment 5 Robin Pepermans (SPQRobin) 2012-08-20 18:11:34 UTC
(In reply to comment #4)
> Also category pages at the bottom of the page. (However in that case it is also
> not passed a parser object as well.)

So we might just do: if parser object, use parser language; else use the user language.

(More generally, category pages are a bit troublesome since they are a mix of content and user language, so the page content language for categories is the site language by default though a lot of it is in the user language...)
Comment 6 Sumana Harihareswara 2012-08-27 15:18:31 UTC
about to mark patch obsolete, removing tags.
Comment 7 Sumana Harihareswara 2012-08-27 15:18:58 UTC
Comment on attachment 10884 [details]
ImageGallery use appropriate lang.

Author said "basically I don't really like it".

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


Navigation
Links