[Clipart] Text labels in SVGs

Frederik Elwert frederik.elwert at web.de
Wed Nov 7 04:23:25 PST 2007


Hello!

Am Mittwoch, den 07.11.2007, 22:46 +1100 schrieb Brianna Laugher:
> A technical question for SVG experts. :)
> It is possible to use text labels in SVGs especially in maps and
> diagrams. see e.g.
> http://commons.wikimedia.org/wiki/Image:African_language_families.svg
> .
> Is there some formalised way of representing multiple languages within
> the same file?

Yes, there is:

http://www.w3.org/TR/SVG11/i18n.html

You can specify a systemLanguage attribute on the text, and let it be
rendered depending on the system locale. This is especially useful in
conjunction with a switch element.

> At the moment on Wikimedia each time someone translates the labels on
> an SVG, they upload a separate file. I am wondering whether it would
> be preferable to be able to store all the labels within a single SVG,
> maybe have a default that shows up and the others are invisible, and
> then later reference them like
> 
> [[image:foo.svg|language=en]]
> 
> Does SVG have any kind of protocol or whatever around how language
> text should be represented?

I have no idea if it is possible to affect the rendered language in any
other way than the system locale.

Another way might be to use xml:lang instead, and control the rendering
of the text with CSS. I don't know if any SVG viewers already support
CSS3 selectors like :target, but this would be a nice way to control the
displayed language via the URL.

Or you keep one file per language, but use xml2po for the translation
process.

Cheers,
Frederik




More information about the clipart mailing list