W3C home > Mailing lists > Public > www-style@w3.org > June 2014

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 17 Jun 2014 15:14:37 -0700
Message-ID: <CAAWBYDCmjhbYt8QcLK2CM3VMng-54_esEH9Qsrwo76CJdaT+QQ@mail.gmail.com>
To: Liam Quin <liam@w3.org>
Cc: Christoph Päper <christoph.paeper@crissov.de>, www-style list <www-style@w3.org>
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.

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC