changing content in a style for various languages

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
pviscogl
Propeller Head
Posts: 16
Joined: Wed Sep 14, 2011 6:11 am

changing content in a style for various languages

Post by pviscogl »

Hi all, we use boxes for different purposes (notes, warnings, examples, etc.). In our example box, we are using the following "title" for the first line of the box :
p.ExampleTitle::before
{
color: #546673;
font-family: Roboto;
font-size: 13px;
line-height: 15px;
font-weight: 700;
line-height: 20px;
content: "EXAMPLE";
}

This is for my English output. I am looking for a way to translate the content properties in Lingo. Variables don't seem to work for this purpose. For example content: "[%=General.ExampleTitle%]";

Any other ideas how to do this.
Thank you,
Pascal
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: changing content in a style for various languages

Post by Nita Beck »

The easiest solution I've seen is to create new stylesheets, one for each langauge, that import everything from the main stylesheet and then swap in the translated terms, so instead of "EXAMPLE," the stylesheet for fr-FR would use "EXEMPLE" and the stylesheet for de-DE would use "BEISPIEL". (I assume you understand the language codes and country codes I'm using here.) Then, for a translated project, point its targets to the appropriate language stylesheet.

fr-FR

Code: Select all

@import url('MainStyles.css') ;
.
.
.
p.ExampleTitle::before
{
content: "EXEMPLE";
}
de-DE

Code: Select all

@import url('MainStyles.css') ;
.
.
.p.ExampleTitle::before
{
content: "BEISPIEL";
}
An advantage of this solution is that your "language" stylesheets need be translated only once. From there on, you just use them.

HTH
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
pviscogl
Propeller Head
Posts: 16
Joined: Wed Sep 14, 2011 6:11 am

Re: changing content in a style for various languages

Post by pviscogl »

Thank you so much Nita. I had already thought of importing a stylesheet, but I was thinking of importing my language stylesheet from my main stylesheet. But the idea of doing the opposite is so much simpler!!
Thank you again.
Post Reply