On Mon, Jan 26, 2009 at 11:12 AM, Marcus Buck <[email protected]> wrote:
> Aryeh Gregor hett schreven: > > On Mon, Jan 26, 2009 at 10:13 AM, Marcus Buck <[email protected]> > wrote: > > > >> And then I want to bring back to mind my last message about "localize > >> transcluded image description pages". My proposal was easy to implement, > >> uncontroversial, so I think, and it would provide a big gain in > >> usability. At least it's relatively easy to implement for somebody with > >> commit access, unlike me. > >> > > > > Why don't you submit a patch, then? > Well, I kind of did. As far as I can judge, it's just changing > > 00298 function getDescriptionRenderUrl( $name ) { > > 00299 if ( isset( $this->scriptDirUrl ) ) { > > 00300 return $this->scriptDirUrl . > '/index.php?title=' . > > 00301 wfUrlencode( 'Image:' . $name ) . > > 00302 '&action=render'; > > 00303 } else { > > 00304 $descUrl = $this->getDescriptionUrl( $name ); > > 00305 if ( $descUrl ) { > > 00306 return wfAppendQuery( $descUrl, > 'action=render' ); > > 00307 } else { > > 00308 return false; > > 00309 } > > 00310 } > > 00311 } > > > to > > 00298 function getDescriptionRenderUrl( $name ) { > > 00299 global $wgLang; > > 00300 if ( isset( $this->scriptDirUrl ) ) { > > 00301 return $this->scriptDirUrl . '/index.php?title=' . > > 00302 wfUrlencode( 'Image:' . $name ) . > > 00303 '&action=render&uselang='. > $wgLang->getCode(); > > 00304 } else { > > 00305 $descUrl = $this->getDescriptionUrl( $name ); > > 00306 if ( $descUrl ) { > > 00307 return wfAppendQuery( $descUrl, > 'action=render&uselang='. $wgLang->getCode() ); > > 00308 } else { > > 00309 return false; > > 00310 } > > 00311 } > > 00312 } > > > As outlined in my first post. If I understand the code right, the cache > key is set in File.php: > > 01079 $key = wfMemcKey( > 'RemoteFileDescription', 'url', md5($renderUrl) ); > > > It includes $renderUrl (and the URL includes the uselang part) and > shouldn't need changes thus. No further changes needed. But as I also > said, I am no expert on the Mediawiki code and I may have missed some > code parts (I don't think so, but it would need much chuzpe if I'd deny > that it's possible). Therefore I asked that a developer (or anybody else > familiar with the internal mechanics of Mediawiki) take a look and > implement those three lines or adapt it if I am wrong. > > Marcus Buck > _______________________________________________ > Wikitech-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > Wouldn't exactly work. You'd need to cache per-language, or otherwise all users would get the latest cached version, whatever it happens to be. We should probably pass the language as a parameter, so it can be called there appropriately. We'll cache it a level above, which I believe is where it's done right now. -Chad _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
