cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Replacable parameters in HTML in I18nTransformer
Date Thu, 17 May 2018 01:17:14 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

I'm using the i18n transformer to localize my XSLTs.

I have a somewhat odd use-case where I'd like to have some (final)
text that looks like this:

<p>Please <a href="[url]">click here</a> to do something interesting.</p
>

The url in the link needs to have some parameters added to it by the
template (it's not static), so I've done this:

<i18n:translate>
  <i18n:text catalogue="whatever" key="text.key" />
  <i18n:param><xsl:value-of select="$context-path" />
  <i18n:param><xsl:value-of select="@id" />
</i18n:translate>

In my catalogue, I have:

  <message key="text.key"><p>Please <a
href="{0}/relative?id=?id={1}">click here</a> to do something
interesting.</message>

The URL in the resulting output has literal {0} and {1} text in it. Is
there a way to get the i18n transformer to replace parameters within
markup in the message values? This works fine when the {0}, etc. are
outside of markup. Do I have any better options than splitting-up the
message into pieces and gluing them together? That's terribly awkward...

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlr82BoACgkQHPApP6U8
pFgXOA//QYR5daF16Y4aYqGMkmqlCexvkXIu9YkLThpnYXzepekLjUg7VGk8o0r1
UF6c8keBTBd35KXXNdOfwr5PDkPTSfgfAEk1oe4ZaxMQo+w325eDa2zebfycHUKt
G0n8DUx0K4Vwdmd9U3ZKB+9tym/pEEkv/ZfPdYcsqPIygfBj/KViKxItOGWLJ5RL
OuKge9Oo5Lyt6sLjGQ/0px6UK28LBKHxLyew6BH21156IvLput+owQ/4xHKmLLCO
IvxgL8zVTAFk9VCth+76mUPyeGOKngvsgQAXQLcckTnySoMoGIKuD8uWtDdJVSfX
tyJqUksNbIT3gUr3DscMb//YDmAihHaMsyHnU4ZCfe90C/4PrX2gLCs4iaVDLpVc
6O70/SjnIezfoRo3jz9hr5TdniFphWViRI9Ea/LrlgFCPUv2Bc/BYD0/gbY+Aay0
E+CTWDjGi1SdSp/gCPj8wLsG1rQTw31D87SppffFDDDTnfcFgZKGLpPtKu8quzQJ
7VmtcG4SGtDICNd2cqUe6APnXSoM1JyrDJjLNTBgyAVB6d7kRzgzPW09/YbDqOA9
zJxmUm7wv1xe6iirrNZ/qpOMp2JIm0YlJFFmCrsVYbOUBCKwD7EpyhdhMyxH40xh
6a/tbCqo07cGIOC8ykOcPeqyJx2mjbqmo1Y/Iu/oYDWnDXrbdh0=
=+f/W
-----END PGP SIGNATURE-----

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


Mime
View raw message