On Thu, Dec 8, 2011 at 1:55 PM, Harry Burt jarry1250@gmail.com wrote:
Hey all.
I'm looking for comments regarding an extension I knocked up today and its viability for Wikimedia wikis:
https://github.com/Jarry1250/TranslateSvg
The extension removes the need for duplicating a file (an administrative nightmare) when you want to translate it. It does this by creating an extra information flow:
[[File:Example.svg|thumb|120px|lang=en]] => rsvg "...Example.svg" "120px-en-Example.svg" (lang='en') => Displays in English [[File:Example.svg|thumb|120px|lang=fr]] => rsvg "...Example.svg" "120px-fr-Example.svg" (lang='fr') => Displays in French
It means rsvg SVG to PNG will finally "understand" the <switch> tag, enabling fully translatable SVGs [1]. It would eventually work in tandem with a translating interface, e.g. through TranslateWiki and/or a local special page.
Awesome! I like the way you're saving updates back into the file using the native <switch> capability.
This might need some additional work when we start serving native SVG images for supporting browsers, though, since we'd need to override that language from the system default. But we'll probably want to do other processing like minification anyway, so that may dovetail in nicely.
The only issue I know of is that the renderer will create a new file every
time you change the language parameter, causing a drain on memory/storage space. How do we handle this for random thumb sizes at the moment?
We basically just allow them to expand until something happens that clears the whole lot for a given image (updating it, deleting it, running a cache purge on it).
Yes it's kinda nasty. :(
-- brion