RE: "Translatable text in CSS"

Hi Russ,

Here are some examples for which storing text in CCC has benefits: 
 Page, Chapter numbering
 Copyright statement
 Navigation information (e.g. for tutorial)

I created a sample showing some generated text using CSS:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
/>
 <title>Generating content with CSS - Sample2</title>
    <link rel="stylesheet" type="text/css" href="sample2.css" />
</head>

<body>

<div class='trans'><span>http://www.hp.com </span><span class='idl'>French
</span><a href='http://translate.google.com/translate'>Google</a></div>

<p class='pageNum'>11</p>

</body>
</html>

And the css:
============
div.trans:before { content: "To Translate the URL: ";}
span.idl:before { content: " in ";}
span.idl:after { content: ", Go to ";}

p.pageNum:before { content: "Page number:";
             margin-top: 1em; display: block; font-weight: bold; text-align:
right; }
p.pageNum { text-align: right; }

body:after { content: "Copyright (c) for ...";
             margin-top: 1em; display: block; font-weight: bold;text-align:
center;  }




/F
 

>-----Original Message-----
>From: Russ Rolfe [mailto:rrolfe@windows.microsoft.com]
>Sent: Tuesday, January 20, 2004 6:56 PM
>To: RICHARD,FRANCOIS (HP-France,ex1); public-i18n-geo@w3.org
>Subject: RE: "Translatable text in CSS"
>
>
>Although I read the reasons for having text in the CSS file, I
>am having a hard time coming up with an example that fits the 
>reasons.  It might be good to give an example of when to use 
>text in the CSS file.
>
>Russ
>
>-----Original Message-----
>From: public-i18n-geo-request@w3.org
>[mailto:public-i18n-geo-request@w3.org] On Behalf Of 
>RICHARD,FRANCOIS (HP-France,ex1)
>Sent: Tuesday, January 20, 2004 3:17 AM
>To: 'public-i18n-geo@w3.org'
>Subject: "Translatable text in CSS"
>
>
>Hi,
>
>Here is a draft of the FAQ.
>Rephrasing is going to be a necessity; Thanks for helping!
>
>
>
>Question:
>"Is it a good idea to put translatable text in Cascading Style 
>sheet (CSS)?"
>
>
>Background:
>CSS was designed to maintain the rendering information of a
>document and to separate it from the document content.
> 
>Answer:
>Under the condition that the translatable text has the following
>characteristics: 
> - Linguistic independence: It is a full phrase,
>independent from the main document content. In particular no 
>concatenation or embedding is used.
> - Meaningfulness
> - Repetitiveness
> 
>then storing translatable text in a CSS:
> - Improves consistency.
> - Enables reuse.
> - makes maintenance efficient.
> 
>
>For translatable text in CSS , the Translation and
>Localisation process needs to:
> - Make sure the T&L tools used do support CSS
> - Translate/localise first the CSS (looking for 
>'content' property used in ':before' and ':after' pseudo-elements)
>
>
>Useful links:
> "XML Internationalization and Localization FAQ" at
http://www.opentag.com/xmli18nfaq.htm
 "Requirements for Localizable DTD Design" at
http://people.w3.org/rishida/localizable-dtd 
 "Cascading Style Sheets, level 2 CSS2 Specification" at
http://www.w3.org/TR/REC-CSS2/
 "An XSLT style sheet and an XML dictionary approach to
internationalization" at
http://www-106.ibm.com/developerworks/library/wa-xslt/

Received on Monday, 26 January 2004 11:55:59 UTC