W3C home > Mailing lists > Public > www-svg@w3.org > November 2006

Re: switch with systemLanguage is broken by standards

From: Jonathan Chetwynd <j.chetwynd@btinternet.com>
Date: Thu, 16 Nov 2006 20:57:08 +0000
Message-Id: <8CAF42A7-ED14-4CEC-AB83-9EACE72C04C2@btinternet.com>
Cc: www-svg@w3.org
To: Doug Schepers <doug.schepers@vectoreal.com>


should we explicitly state the case where the author provides a  
fallback language for switch, in case of no match, also be honoured?
ie would most users  prefer some content rather than none, which they  
can than at least paste into babelfish, ask a colleague, copy and  


Jonathan Chetwynd

On 16 Nov 2006, at 18:19, Doug Schepers wrote:

Hi, Jonathan-

I think I agree with you and Stuart Morgan [1] that a negotiated  
choice with Accept-Language [2] would be better.

I don't know exactly how we can change it for SVG Tiny 1.2, but I  
suggest that at the minimum we can issue an errata (maybe even for  
SVG 1.0), if the rest of the SVG WG agrees.  I'll bring it up in an  
upcoming telcon soon.

For 'switch', I will propose text like, "The 'switch' element  
evaluates the requiredFeatures, requiredExtensions, and  
systemLanguage attributes on its direct child elements.  The order of  
evaluation for systemLanguage shall be the order of of preference  
expressed in HTTP/1.1 Accept-Language if defined.  The order of  
evaluation for systemLanguage where the language preference is not  
defined and for requiredFeatures and requiredExtensions shall be the  
document order.  The first most appropriate child for which these  
attributes evaluate to true shall be processed and rendered.  All  
others will be bypassed and therefore not rendered. If the child  
element is a container element such as a 'g', then the entire subtree  
is either processed/rendered or bypassed/not rendered."

(Maybe with an example, for clarity).  If the general premise is  
accepted by the WG, I will work up similar language for section 5.8.5  
(The systemLanguage attribute).

I can think of 2 arguments against this:

1) It may take too much processing for SVG Tiny UAs (I doubt this,  
but will ask implementors);

2) It removes control from the author, who may have listed the  
different options in order for a reason.  They may only supply  
fallback "translation" text like, "Please read this document in a  
browser that understands Arabic" or something (bad practice, but  
possible).  They may be very comfortable writing in Japanese, and so  
go into more detail in the first entry, with a more terse translation  
in English out of necessity.

That said, I still prefer the language negotiation.

Note that the UA is not prevented from creating a workaround for  
this, such as allowing the author to pick one language as the  
exclusive Accept-Language string on the fly.  A kluge, but it  
wouldn't break the spec.  Actually, I've wished before that we could  
allow the UA to give the list of options to the user to let them  
decide... maybe this could be a new feature for 'switch' in an  
upcoming version.

Does this work for you?

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=326375#c17
[2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4


Research and Standards Engineer
6th Sense Analytics
mobile: 919.824.5482

Jonathan Chetwynd wrote:
> Camino developers have suggested that the current definitions used  
> for 'switch' and 'systemLanguage'
> http://www.w3.org/TR/SVG11/struct.html#SwitchElement
> http://www.w3.org/TR/SVG11/struct.html#SystemLanguageAttribute
> mean that it's not possible for the client to express any language  
> preference.
> The result is that the user should have no control over the  
> language displayed, as the first language in the authors switch  
> statement which is accepted by the client will be used.
> It is evident this will only very rarely be the users language of  
> choice.
> a test case is here:
> https://bugzilla.mozilla.org/attachment.cgi?id=233450
> My machine is set to accept the three languages, french, spanish,  
> german, but I will only get french, whatever my preference, unless  
> I edit the accepted language list.
> a longer description of the issue is here:
> https://bugzilla.mozilla.org/show_bug.cgi?id=326375
> #3 & #17 in particular
> regards
> Jonathan Chetwynd
> it seems to me they may be equally true of the SVG1.2 definitions:
> http://www.w3.org/TR/SVGMobile12/struct.html#SwitchElement
> http://www.w3.org/TR/SVGMobile12/struct.html#SystemLanguageAttribute
> <?xml version="1.0" encoding="utf-8" standalone="no"?>
> <svg xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http:// 
> www.w3.org/1999/xlink" width="100%" height="100%">
>     <g id='symbol1Text'>
>                 <switch >
>                     <text x="20" y="20" systemLanguage="fr" >ploc</ 
> text>
>                     <text x="20" y="20" systemLanguage="es" >la  
> mancha</text>
>                     <text x="20" y="20" systemLanguage="de" >splat</ 
> text>
>                     <text x="20" y="20" >splat</text>
>                 </switch>
>     </g>
>   </svg>
Received on Thursday, 16 November 2006 20:57:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:09 UTC