Last modified: 2014-09-24 00:15:09 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?)
did you finish thinking? :P Please push to gerrit if you find it good enough.
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
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.
(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.)
(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...)
about to mark patch obsolete, removing tags.
Comment on attachment 10884 [details] ImageGallery use appropriate lang. Author said "basically I don't really like it".