Segmentation problem with variables

This Forum is for general issues about MadCap Lingo
Post Reply
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Segmentation problem with variables

Post 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.
WDClark
Jr. Propeller Head
Posts: 8
Joined: Fri Feb 10, 2012 12:45 pm

Re: Segmentation problem with variables

Post 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.
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

Re: Segmentation problem with variables

Post 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;".
Kellie
benjimenez
Propeller Head
Posts: 78
Joined: Mon Aug 30, 2010 4:17 pm

Re: Segmentation problem with variables

Post by benjimenez »

I've seen this same problem in v5 and found the CDATA tags next to the variables.
jasonsmith
Sr. Propeller Head
Posts: 205
Joined: Wed Apr 28, 2010 2:51 am

Re: Segmentation problem with variables

Post 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>
Post Reply