AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

Question - Multilingual PDF with 1 language per column #212

Open steinbacher01 opened 3 years ago

steinbacher01 commented 3 years ago

Is it possible to publish two DITA maps, 1 English and 1 translated, so they flow next to each other on the same page in a 2 column layout? The English would be on one side (column 1), and the translated equivalent would be on the other (column 2).

Since translated content is often longer than the original source, the trick would be to keep the start of the English topic aligned with the start of the translated topic.

Is this possible?

image

Or, would it be easier if it was a single map that had the English and translated topics together with the same topic sequence?

topicref topic 1 English topicref topic 1 translation topicref topic 2 English topicref topic 2 translation

Any suggestions on getting something close to this?

Thanks,

Leroy Steinbacher

ToshihikoMakita commented 3 years ago

Using columns for this purpose is bit difficult because text flows from left column to right column automatically.

translation-by-column_New

If you use fo:block-container/@column-count="2" per topic, you may get the desired result. But one problem exists because if contents of English overs one page, it will move into right column from left column.

translation-block-container

I've consulted Formatter support colleague and got the the following fo:table solution. This is best at this moment.

translation-3

Also, making English and translated topic into one map will be easier because DITA-OT can input one root map per one processing.

Hope this helps your development.

mmg-hinchey commented 2 years ago

I have a follow up question to this, can the translated topics reference the appropriate string file in the Config folder. Specifically, I want to display the Target_language value when the language (as determened by xml:lang) changes.

ToshihikoMakita commented 2 years ago

If you define language specific variables in xx-YY_style.xml, you can obtain it via "getVarValueWithLang" template. Probably in your case, following variable definition will be needed in xx-YY_style.xml.

<variable name="myLang">xx-YY</varibale>

It will be important to call "getVarValueWithLang" inside the matching template (the context xml:lang is "xx-YY").

mmg-hinchey commented 2 years ago

Thank you for the suggestion.  I tried using 'getVarValueWithLang' - but my system doesn't recognize it.   I'm getting this message:

 [xslt] C:\DITA-OT-3x-WHR-PDF5-Beta\plugins\com.ge.pdf5.ml\xsl\dita2fo_title.xsl:565:0: Fatal Error! Cannot find a 1-argument function named Q{http://www.antennahouse.com/names/XSLT/Functions/Document}getVarValueWithLang()
 [xslt] Failed to process C:\DITA-OT-3x-WHR-PDF5-Beta\samples\A-IFU-combined\temp\pdf\oxygen_dita_temp\bm_A-IFU_SpO2_Nellcor_OxiMax_CONVERTED.xml

For reference, here is the code for the fo:block I'm trying to create: image I tried both "getVarValueWithLang" and "ahf:getVarValueWithLang" but I recieved teh same error.

Here is the .fo block, as created with the getVarValue function.  As you can see, the fo block has an xml:lang of "ko" (korean), but it is still pulls the variable from the default string file. fo output: image

If it matters, here are the string files involved: KO_style: image default_style: image

ToshihikoMakita commented 2 years ago

There is no function version of "getVarValueWithLang" defined in original XSLT code. Use xsl:call-template instead. Or you can define function version of this template by yourself.

ToshihikoMakita commented 2 years ago

There is no function version of "getVarValueWithLang" defined in original XSLT code.

This is also true in "getAttributeSetWithLang". This may be because it needs current context and xsl:function need to be passed it as xsl:param.

mmg-hinchey commented 2 years ago

Ohhh, I see. That did the trick. Thank you so much!

On Mon, Jul 11, 2022 at 12:07 AM Toshihiko Makita @.***> wrote:

There is no function version of "getVarValueWithLang" defined in original XSLT code.

This is also true in "getAttributeSetWithLang". This may be because it needs current context and xsl:function need to be passed it as xsl:param.

— Reply to this email directly, view it on GitHub https://github.com/AntennaHouse/pdf5-ml/issues/212#issuecomment-1179970933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW5O6GKFMUCU67OYDBOEAJ3VTOTXTANCNFSM5GMTSZDA . You are receiving this because you commented.Message ID: @.***>