cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Urs Iwert" <urs.iw...@sysinf.ch>
Subject AW: I18n transformer removes tags
Date Wed, 05 Oct 2005 09:05:08 GMT
Hello,

Yes, I'm using it for presentation, but I'm looking also for a solution
where I can have parts of the translated message be formatted in a
different way. The idea is more like RTF message. For this reason I must
be free to set tags wherever I want and it is not possible to have the
message be separated into smaller parts.

Once more. It must be possible to transfer a well formed message from a
message catalogue to my document.

Thanks for any help

Urs Iwert





Urs Iwert wrote:

>-- menu_en.xml -----------------------------------------
><catalogue xml:lang="en">
>  <message key="demo_reports"><b><i>Demo Reports</i></b></message>

>  ...
><catalogue>
>--------------------------------------------------------
>
>1. Problem (major)
>The message "Demo Reports" should be translated into different
>languages. I also like to have the message formatted with some
>attributes like <b/>, <i/> or <u/> tags. I'm using the keyword for
>translation. I expected that the original message would be replaced by
>the language specific message. But the i18n transformer just removes
all
>tags.
>  
>
I think you shouldn't mix presentation <b/>, <i/> with your i18n
messages.

If you need to translate to an other language, you will need to 
copy/paste all those <b/>... in every language catalogue :-(

If you decide one or many of those messages must not be in bold anymore,

you will need to update all the catalogues :-( (once again)

A better way to achieve this is to use a css style:
<span class="my_bold_and_italic_style"><i18n/></span>

and put only the sentence in the i18n catalogue.

<message key="demo_reports">Demo Reports</message>

Regards,
--
Benjamin Francisoud

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



Hi there,

I'm using i18n transformer and I got two different problems. 
Below there are two files: menu source file and one of the translation
files.


-- menu.xml --------------------------------------------
<menu xmlns:i18n="http://apache.org/cocoon/i18n/2.1">

  <caption>
    <i18n:text i18n:key="demo_reports">
      Demo <b>Reports<b>
    </i18n:text>
  </caption>
  ...
</menu>
--------------------------------------------------------


-- menu_en.xml -----------------------------------------
<catalogue xml:lang="en">
  <message key="demo_reports"><b><i>Demo Reports</i></b></message>

  ...
<catalogue>
--------------------------------------------------------


-- sitemap.xmap ----------------------------------------
<map:transformers default="xslt">
  <!-- Configure i18n transformer -->
  <map:transformer name="i18n" logger="sitemap.transformer.i18n"
src="org.apache.cocoon.transformation.I18nTransformer">
    <catalogues default="menu">
      <catalogue id="menu" name="menu" location="resources/languages"/>
    </catalogues>
    <untranslated-text>???</untranslated-text>
    <cache-at-startup>false</cache-at-startup>
  </map:transformer>
</map:transformers>
--------------------------------------------------------

1. Problem (major)
The message "Demo Reports" should be translated into different
languages. I also like to have the message formatted with some
attributes like <b/>, <i/> or <u/> tags. I'm using the keyword for
translation. I expected that the original message would be replaced by
the language specific message. But the i18n transformer just removes all
tags.

2. Problem (minor)
If there is no message catalogue available, the original text will be
shown with the tags applied in the original file, but all white spaces
before an after the tags are removed also ("DemoReports"). This Problem
is not really a problem, because I can have a translation for each tag.


Any help appreciated
Urs


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message