I am coding a website where the language string is split in xml files. Depending on the language, I include one or the other. No problem with that.
By the way, this site is dynamic, so it will have a string like Hello ipalaus! in English, e.g. Bienvenido ipalaus !, etc. In this case, we have the same word order, but in some cases there will probably be a name string, string name, string name string ...
In any case, you can answer what sprintf()does in PHP? In PHP, we have this:
<?php
$name = "ipalaus";
$string = "Welcome %s";
echo sprintf($string, $name);
?>
I would like to have in my index.en.xml some like:
<language>
<welcome>Welcome %s</welcome>
</language>
In my index.xml generated with PHP will be:
<index>
<locale>en</locale>
<welcome>ipalaus</welcome>
</index>
XSLT ipalaus.
, XSLT :
<xsl:param name="language" select="document(concat('../lang/', $locale, '/index.xml'))" />
: <xsl:value-of select="$base/language/welcome" />.
!
: :
<index>
<video>
<author>ipalaus</author>
</video>
<video>
<author>Alejandro</author>
</video>
</index>
:
<language>
<video>
<made>This videos is made by <author/></made>
<random>Another string</random>
</video>
</language>