Re: [css-variables][i18n] :lang() Example

On Tue, Jun 17, 2014 at 2:14 PM, Liam R E Quin <liam@w3.org> wrote:
> On Tue, 2014-06-17 at 13:44 +0200, Christoph Päper wrote:
>> I believe the spec of the Custom Properties for Cascading Variables
>> module would benefit from an example that showed how to use variables
>> for internationalization, e.g.
>>
>>   :root, /* default */
>>   :root:lang(en) {--external-link: "external link";}
>>   :root:lang(de) {--external-link: "externer Link";}
>>
>>   a[href^="http"]::after {content: " (" var(--external-link) ")"}
>
> I think the Internationalization best practice currently suggests not
> putting all languages in the same file; furthermore this approach won't
> work if e.g. you have Japanese or Chinese with "ruby" annotations, or if
> for some other reason you need markup or formatting in the content.
>
>> Features and values from GCPM etc. are more powerful if used this way.
> You can use element() from gcpm with :lang and that may form a better
> example, I'm not sure. The two-argument element() isn't widely
> implemented, so you end up with extra copies of text in your document,
> but this is likely to be better than having document content in CSS,
> especially for accessibility.

GCPM's element() isn't implemented in any browser, and it conflicts
with the Image Values element() function.

~TJ

Received on Tuesday, 17 June 2014 22:15:24 UTC