Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Multilingual PDF with 1 language per column #212

Open
steinbacher01 opened this issue Oct 20, 2021 · 7 comments
Open

Question - Multilingual PDF with 1 language per column #212

steinbacher01 opened this issue Oct 20, 2021 · 7 comments

Comments

@steinbacher01
Copy link

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
Copy link
Contributor

ToshihikoMakita commented Oct 21, 2021

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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

mmg-hinchey commented Jul 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants