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 11:00:06 -0700
Message-ID: <CAAWBYDCkG9b57iKwY0TZSpD5_d_nLzQsYZr0K2t63E-T+9HuhQ@mail.gmail.com>
To: François REMY <francois.remy.dev@outlook.com>
Cc: Christoph Päper <christoph.paeper@crissov.de>, www-style list <www-style@w3.org>
On Tue, Jun 17, 2014 at 10:54 AM, François REMY
<francois.remy.dev@outlook.com> wrote:
>> On Tue, Jun 17, 2014 at 4:44 AM, Christoph Päper
>> <christoph.paeper@crissov.de> 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) ")"}
>> >
>> > Features and values from GCPM etc. are more powerful if used this way.
>>
>> Are you using this in more than one place?  If not, it seems to be
>> simpler to just put the :lang() on the a selector.
>
>
> But you may want to create a single file containing the data to translate.
> You usually don't want your translator to have to deal with your entire CSS,
> just the strict minimum relevat to them.

Ah, good point.  Okay, I can add an example with this.

~TJ
Received on Tuesday, 17 June 2014 18:00:54 UTC

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