Page 1 of 1

Segmentation problem with variables

Posted: Mon Sep 05, 2011 8:52 am
by jasonsmith
We are having problems in getting content with variables translated. When a variable is located at the end of a heading in the source file the segment generated by lingo stops just before the variable.

source: <h2>Calculating a <MadCap:variable name="GUI_Terms.Thing" /></h2>

target:<h2><MadCap:segment>Calculating a </MadCap:segment><MadCap:variable name="GUI_Terms.Thing" /></h2>

This means that our translators can't see the variable or move it to accomodate local syntax.

We are using lingo V3, this may have been fixed in the later versions. I see that in V4 this kind of behavior for bold, underlined etc. text was fixed, but was wondering if the same applies to variables.

Re: Segmentation problem with variables

Posted: Fri Feb 10, 2012 1:03 pm
by WDClark
I can confirm that it is NOT fixed in 5.0, and the effect of the segment/variable break is actually even worse.

In our case, we use variables for, among other things, product names. So we might have a sentence that starts with a variable, such as "Product Awesome allows you to do amazing things." In MadCap's XML, this sentence would look like this:

Code: Select all

<p MadCapConditions="Default.IncludeDescription"><MadCap:variable name="MyVariables.ProductName" /> allows you to do amazing things.</p>
A very annoying problem arises when you pass the XML through Lingo, however. After you prepare a translation bundle and segmenting content, the code comes out the other side looking like this:

Code: Select all

<p MadCapConditions="Default.IncludeDescription">
  <MadCap:variable name="MyVariables.ProductName" />
  <MadCap:segment>allows you to do amazing things.</MadCap:segment>
</p>
Send that to the translators and you get back something like this (my Pig Latin is a little rusty):

Code: Select all

<p MadCapConditions="Default.IncludeDescription">
  <MadCap:variable name="MyVariables.ProductName" />
  <MadCap:segment>yallowsay ouyay otay oday mazingays ingsthay.</MadCap:segment>
</p>
The problem with the returned XML, however is that when you export it back to Flare, and build your help project, the line comes out like this (not doing any more Pig Latin; you get the idea from the English):
Product Awesomeallows you to do amazing things.
If the variable is at the end of the sentence, you get this:
The product that allows you to do amazing things isProduct Awesome.
Anybody have any idea how to deal with this?

Nine languages, 240 pages in the help project (glad we didn't translate the WHOLE thing), and it's completely borked. Every time the variable isn't in the middle of a sentence, MadCap drops any and all white space on either side of it.

Re: Segmentation problem with variables

Posted: Tue Feb 21, 2012 10:44 am
by techwriter31
Hmmm...I'd be curious to see if there are any "<![CDATA[ ]]>" tags next to the variable. If there are, you could potentially do a search and replace for the CDATA tags, and replace them with "&160;".

Re: Segmentation problem with variables

Posted: Wed Feb 22, 2012 9:47 am
by benjimenez
I've seen this same problem in v5 and found the CDATA tags next to the variables.

Re: Segmentation problem with variables

Posted: Fri Jun 29, 2012 2:18 am
by jasonsmith
I have kind of solved this; adding a zero-width space (⁠) either before or after the offending variable bumps it into the segment and hopefully doesn't mess up any alignment.

Flare

<xhtml:td xhtml:style="font-size: 9pt;">Page <MadCap:variable xhtml:name="System.PageNumber" /> of <MadCap:variable xhtml:name="System.PageCount" />⁠</xhtml:td>

Lingo

<xhtml:td xhtml:style="font-size: 9pt;"><MadCap:segment>Page <MadCap:variable xhtml:name="System.PageNumber" /> of <MadCap:variable xhtml:name="System.PageCount" />⁠</MadCap:segment>