Page 1 of 1
Profiling for multi-languages
Posted: Wed Mar 09, 2011 12:53 pm
by Peter2
I have made a docbook for Profiling
xml:lang="de" ,xml:lang="en"
I use it in <para> and <phrase> to show english/german text.
I made 2 pdf transforms from your video tutorial:
Docbook PDF de, Docbook PDF en
with ${frameworks}/docbook/xsl/fo/profile-docbook.xsl and profile.lang='de' / 'en'
It works fine, but there is a problem with the auto generated text:
Table of Contents, <Chapter>, <Note>
This text is alway in englisch.
It is german, if I use
<book xmlns="
http://docbook.org/ns/docbook" version="5.0" xml:lang="de">
But then the book is only for profile.lang='de' ,
for profile.lang='en' it is empty ->
Error 'A well-formed document requires a root element.'
What can I do, that also the auto generated text use profile.lang?
Now I have to change temporarily xlm:lang in <book>
Peter
Re: Profiling for multi-languages
Posted: Wed Mar 09, 2011 1:04 pm
by Radu
Dear Peter,
I've already emailed you but in order to update the post:
The Docbook XSL has a parameter called:
l10n.gentext.language
which you can set to "de" for the transformation scenario which will produce German content and to "en" for the transformation scenario which will produce English content.
The "xml:lang" is insufficient to output the correct Table Of Contents translation as the Table Of Contents is generated for the root element and you cannot set it there for the reasons you already know.
Regards,
Radu
Re: Profiling for multi-languages
Posted: Wed Mar 09, 2011 1:57 pm
by Peter2
Hi Radu,
Thank you, it works.
So I have adapt 2 parameters in the tranformation scenario:
l10n.gentext.language=de
profile.lang=de
Can use one parameter the value from the other?
This setting is saved local in %appdata%\com.oxygenxml.author\oxyAuthorOptionsSa12.1.xml. It's ok to backup this file to keep this seeting for a new installation?
Regards,
Peter
Re: Profiling for multi-languages
Posted: Wed Mar 09, 2011 3:10 pm
by Radu
Hi Peter,
In the Oxygen Preferences->Custom Editor Variables page you can define a custom editor variable with the name DE and the value de and use it like ${DE} in the parameter value fields.
The Oxygen settings are automatically imported when a new Oxygen version is installed for the same user. But yes, you can back up them or share them with your colleagues.
In the Oxygen Options menu there is an action called Import Global Options...
Regards,
Radu
Re: Profiling for multi-languages
Posted: Mon Mar 28, 2011 7:53 pm
by Peter2
Hi Radu,
thanks, that works. I made ${custom.lang}, wich I have to set to "de" or "en". But now I forgot tho set this variable ...
It is possible to set automaticly ${custom.lang} from the name of the active Profiling Condition Set?
I have 2 Profiling Condition Sets:
de -> xml:lang[de]
en -> xml:lang[en]
(Better would be from condition xml:lang of the active Profiling Condition set, if sometimes are more Profiling Condition set with other conditions.)
Otherwise can I get a Dialog where I choose de/en and then assign the result to ${custom.lang}?
Best Regards,
Peter
Re: Profiling for multi-languages
Posted: Tue Mar 29, 2011 9:06 am
by Radu
Hi Peter,
It is possible to set automaticly ${custom.lang} from the name of the active Profiling Condition Set?
I have 2 Profiling Condition Sets:
de -> xml:lang[de]
en -> xml:lang[en]
(Better would be from condition xml:lang of the active Profiling Condition set, if sometimes are more Profiling Condition set with other conditions.)
Actually we have this on our TODO list. So in a future version definitely.
Otherwise can I get a Dialog where I choose de/en and then assign the result to ${custom.lang}?
As a value for an XSLT parameter you can use editor variables like:
${ask('message')}
See this link for more details:
http://www.oxygenxml.com/doc/ug-oxygen/ ... eters.html
This means you will be asked for each of the set parameter's value. But in your case you will be asked twice.
Maybe you should duplicate the transformation scenario instead.
In the
Transformation Scenarios view you can double click the desired scenario to transform.
Regards,
Radu
Re: Profiling for multi-languages
Posted: Wed Mar 30, 2011 3:59 pm
by Peter2
Hi Radu,
I use ${custom.lang} also for the output filname, so ${ask('message')} would be called more than twice...
Can I make a batch process ?
For example:
Set ${custom.lang}="en"
Call Transform 'HTML Help ${custom.lang}'
Call External Tool 'Html Help Compiler'
Call Transform 'Docbook PDF ${custom.lang}'
Set ${custom.lang}="de"
Call Transform 'HTML Help ${custom.lang}'
Call External Tool 'Html Help Compiler'
Call Transform 'Docbook PDF ${custom.lang}'
The results are 2 chm + 2 pdf files in the projectfolder.
Now I have to call this steps manually.
Best Regards,
Peter
Re: Profiling for multi-languages
Posted: Wed Mar 30, 2011 5:55 pm
by Radu
Hi Peter,
No, you cannot do this from Oxygen.
Maybe you can set up an ANT build file which does all the XSLT transformations and run it from the command line.
Regards,
Radu