W3C home > Mailing lists > Public > www-svg@w3.org > March 2007

Re: does the systemLanguage attribute apply to tspan? alternatively does the switch element take x & y coordinates?

From: Doug Schepers <doug.schepers@vectoreal.com>
Date: Wed, 14 Mar 2007 15:25:39 +1100
Message-ID: <45F77943.1080701@vectoreal.com>
To: SVG List <www-svg@w3.org>
Cc: ~:'' ありがとうございました。 <j.chetwynd@btinternet.com>

Hi, Jonathan-

Doug Schepers wrote:
 >
 >  > does the systemLanguage attribute apply to tspan?
 >
 > A more pertinent question is whether the 'switch' element can be a
 > child of the 'text' element.

I forgot to mention that the systemLanguage attribute, by itself, can 
selectively hide or show any graphical element ('tspan' included).  If 
not a child of a 'switch' element, however, it cannot supply a fallback. 
  For example, as per spec, this snippet will always show 'games', and 
for those devices with Italian, French, Spanish, or German as the system 
language, it will also show the given word (so it will say, "juegos 
games" for a Spanish user:

    <text x="130" y="65">
       <tspan systemLanguage="it">giochi</tspan>
       <tspan systemLanguage="fr">jeux</tspan>
       <tspan systemLanguage="es">juegos</tspan>
       <tspan systemLanguage="de">spiele</tspan>
       <tspan>games</tspan>
    </text>

You could filter this out by adding another systemLanguage attribute:

    <text x="130" y="65">
       <tspan systemLanguage="it">giochi</tspan>
       <tspan systemLanguage="fr">jeux</tspan>
       <tspan systemLanguage="es">juegos</tspan>
       <tspan systemLanguage="de">spiele</tspan>
       <tspan systemLanguage="en">games</tspan>
    </text>

But this would not display anything at all for someone with e.g. 'ja' 
(or even 'en-gb'!) as their system language. Ideally, you'd want the 
fallback, which is why I recommended using it with 'switch'.

Also note that FF1.5 doesn't implement systemLanguage as a standalone 
conditional, either (though O9 and ASV3 do).

I would stick with the <g><switch> combo for your uses, as it works in FF.

Regards-
-Doug

Research and Standards Engineer
6th Sense Analytics
www.6thsenseanalytics.com
mobile: 919.824.5482
Received on Wednesday, 14 March 2007 04:25:49 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:36 GMT