Re: Translatable text in tag attributes

Marcel van der Boom <[email protected]> Sun, 26 Apr 2009 18:13:02 +0200
Newsgroups gmane.comp.cms.xaraya.devel
Message-ID <[email protected]>
On 25 apr 2009, at 09:19, [email protected] wrote:

> The other place we often encounter translatable text is in certain tag
> attributes. Consider the following example:
>
>     A. <input type="submit" value="#xarML('Log In')#" />
>     B. <input type="submit" value="Log In" />
>     C. <xar:var name="label">Log In</xar:var>
>        <input type="submit" value="#$label#" />

I am of the opinion that (translateable) content should never be in  
attributes, so I'd choose 'none of the above' here. The problem should  
be reformulated to "how to not allow (translateable) content in  
attributes" in my view.

( As an aside: The 'input element'-example given has another problem,  
because the value attribute is not only content, i.e. the 'label' of  
the input element, but is also used as the parameter to act on by the  
backend (so the received value is different for each different  
language. Sigh...)

So, I'd avoid the problem by doing one or more of the following things:

1. use an alternative tag which does not have content in attributes
(<button/> element could be used in the given html example)
2. define a more abstract element <xar:submit /> or <xar:button/> or  
something like that, which has a label that can be translated and  
generates the appropriate html or xml or whatever the output format is  
at that time.
3. use a specifically designed element set for the problem (XForms  
comes to mind for the given example)

where 1. is the least amount of work and the most specific and 3 is  
the most amount of work, but the most generic.

In short, I haven't thought much about translating attribute values,  
because I would like to avoid them alltogether.

marcel


-- 
Marcel van der Boom  -- http://hsdev.com/mvdb.vcf
HS-Development BV    -- http://www.hsdev.com
So! web applications -- http://make-it-so.info
Cobra Replica build  -- http://cobra.mrblog.nl

_______________________________________________
Xaraya_devel mailing list
[email protected]
http://xaraya.com/mailman/listinfo/xaraya_devel