Translation of autonumbered items?

This forum is for Single-Sourcing your Flare content to multiple outputs.

Translation of autonumbered items?

Postby laurentv on Thu Jan 21, 2016 7:43 am

My team is generating training manuals in PDF and HTML5 formats. These manuals used to be written in English only. Now the company has grown a lot, and customers are requesting training manuals in French or German. I am in charge of finding a scalable solution to handle the translations directly from Flare.

I read some posts on this forum about the best architecture to adopt. I am aware that separate projects for each language are strongly advised, as well as the use of Lingo. However, our translation team already has some processes in place and they think having one project with all languages is the best option. It probably means I have to maintain separate TOCs for each language, but I can figure something out. Or they can handle it.

Based on these requirements, I came up with a proof of concept that handles translation quite well by relying on Condition Tags (which is also a best practice, from what I have heard). There is but one remaining item to be translated: auto-numbering. It is currently handled at the CSS level. Here is an example for h1 headers:

Code: Select all
h1
{
    mc-auto-number-class: ChapAutoNum;
   mc-auto-number-format: 'CH:LESSON {chapnum} ';
}


This way, every lesson gets prefixed with LESSON and an automatically incremented number: "LESSON 1 Getting Started", "LESSON 2 Going deeper"... The TOC looks good, and I like it this way.

My question is: Is there a simple way to handle the translation of this 'LESSON' term? I would like to handle the routing at the Target level, again with Condition Tags. So far, I have created a Condition Tag Set called i18n with as many fields as supported languages (EN, FR, DE...). Ideally, I would like to include or exclude some languages at the Target level, and the auto-numbering would automatically adapt.

Is this achievable? I could not apply Condition Tags to CSS stylesheets as I did for the other Resources (Page Layouts, Topics).
Do you think I need separate stylesheets for each language?

Thanks in advance for any tip/experience you might share,

Laurent
laurentv
Jr. Propeller Head
 
Posts: 2
Joined: Thu Jan 21, 2016 6:35 am

Re: Translation of autonumbered items?

Postby LTinker68 on Thu Jan 21, 2016 3:43 pm

I don't have to do any translations (thank goodness), so I'm probably not the best one to answer this, but just based on what you've written, I would suggest separate stylesheets, with a slight caveat. I would have one "base" stylesheet that defines all your base styles and appearances, including any styles that would include the text, but don't define the text in that base stylesheet. Or you could include the text you'd use for English as a placeholder, but really I'm talking about creating just this in the base class:

Code: Select all
h1
{
    mc-auto-number-class: ChapAutoNum;
}

Then create a second stylesheet for each language, but in each of the language stylesheets, insert a line of code to call that base stylesheet. Then in your target, you point to the language stylesheet, which in turn will call to that base stylesheet. (Hope that makes sense.) Then in each language stylesheet, you specify only the additional style parameters that build on the styles you defined in that base stylesheet. So in your English stylesheet, for example, you would add:

Code: Select all
h1
{
    mc-auto-number-format: 'CH:LESSON {chapnum} ';
}

It will still inherit the auto-number class (ChapAutoNum), but the specific auto-class format is specific to the English language stylesheet. So your language stylesheets will only have the styles that include text specific to that language output.

Hope all that makes sense. And again, someone who does translations regularly might have better advice or an even stronger argument to use multiple projects, but that's my two cents based on what you've described.

Oh, and also, there are a LOT of other styles where you might want specific text, too, like cross-references, mini-TOCs, togglers, etc.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Translation of autonumbered items?

Postby laurentv on Fri Jan 22, 2016 2:40 am

Hi Lisa,

It all makes perfect sense, as I came up with a slightly more convoluted solution yesterday.

I defined separate stylesheets for each language with just the mc-auto-number-* for h1, keeping all other styles in Main.css. Then I relied on a snippet to include the right stylesheet in every Topic where H1 titles appear.

Code: Select all
<head>
    <link href="../../Resources/Stylesheets/Main.css" rel="stylesheet" type="text/css" />
    <MadCap:snippetBlock src="../../Resources/Snippets/AutoNumberingCSS.flsnp" MadCap:conditions="Shared.PDF" />
</head>


This snippet is responsible for switching between the specialized stylesheets, based on the Condition Tags defined earlier. I thought it was a good workaround, as it shifted the decision-making to the snippet instead of the CSS (which is not compatible with Condition Tags).

Your solution is even better and does not require any snippet.

By the way, I was not aware you could include a CSS from another one using an @import directive. Learning something new every day feels good :-)

Thanks for confirming I was heading in the right direction, and for offering a simpler and more robust solution.

Laurent
laurentv
Jr. Propeller Head
 
Posts: 2
Joined: Thu Jan 21, 2016 6:35 am

Re: Translation of autonumbered items?

Postby LTinker68 on Mon Jan 25, 2016 10:11 am

laurentv wrote:By the way, I was not aware you could include a CSS from another one using an @import directive.

In "traditional" websites, you could call multiple stylesheets on each page, and the order of the insert controlled which one had precedence. Flare does that a bit after you compile (open a topic in your generated output and you'll see multiple stylesheets being called), but it's a bit harder to control in Flare, since it adds some of its own stylesheets. I'm not sure if there's a recommendation of which method to use in "traditional" websites, but using the import works better in Flare.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
LTinker68
Master Propellus Maximus
 
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Re: Translation of autonumbered items?

Postby Uwe on Wed Feb 17, 2016 8:17 am

Laurent,

Lisas solution is a good one, but in regards to the having one project for all languages, keep in mind the following:

While your team handles as in your example French and German, make sur to have also processes in place when you handle it when more "exotic" (Japanese for example) languages are required and they need to be handled somewhere else. While it might not be an issue now, try to stay a step ahead.

I started with 2 languages and now I am dealing with up to 19 based on product.

Uwe
Uwe
Propeller Head
 
Posts: 19
Joined: Wed Mar 04, 2015 2:52 pm

Re: Translation of autonumbered items?

Postby jasonsmith on Fri Feb 19, 2016 7:11 am

Something else you might want to consider (as long as your number of languages remains relatively manageable) is using mediums. This feature lets you define separate styles for a given element.

@media en
h1
{
mc-auto-number-format: 'CH:LESSON {chapnum} ';
}

@media de
h1
{
mc-auto-number-format: 'CH:LEKTION {chapnum} ';
}

You choose the medium used for each target in the Advanced > Stylesheet Medium setting of your fltar target file. All other styles will be the default settings.
jasonsmith
Sr. Propeller Head
 
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am


Return to Single-Sourcing

Who is online

Users browsing this forum: No registered users and 1 guest