From: Pierre-Adrien Coustillas (pcoustillas@perinfo.com)
Date: 07/03/2002 - 09:58
Voila le truc que j'ai mis au point, je sais pas si c le mieux, mais ca
donne de bon résultat :
J'ai un premier XML qui contient tout les texte dans toutes les langues :
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <P_XML>
- <MSGALL t="Liste des clients">
<FR>Liste des clients</FR>
<EN>List customers</EN>
</MSGALL>
- <MSGALL t="Nom Usuel">
<FR>Nom Usuel</FR>
<EN>Name Usual</EN>
</MSGALL>
- <MSGALL t="Nom Complet">
<FR>Nom Complet</FR>
<EN>Name Complete</EN>
</MSGALL>
- <MSGALL t="Ville">
<FR>Ville</FR>
<EN>City</EN>
</MSGALL>
- <MSGALL t="Pays">
<FR>Pays</FR>
<EN>Country</EN>
</MSGALL>
- <MSGALL t="Type Clients">
<FR>Type Clients</FR>
<EN>Customers Type</EN>
</MSGALL>
- <MSGALL t="Rafraichir">
<FR>Rafraîchir</FR>
<EN>refresh</EN>
</MSGALL>
- <MSGALL t="Creer un nouveau client">
<FR>Créer un nouveau client</FR>
<EN>Create a new customer</EN>
</MSGALL>
- <MSGALL t="Nouvelle recherche">
<FR>Nouvelle recherche</FR>
<EN>New search</EN>
</MSGALL>
- <MSGALL t="Accueil">
<FR>Accueil</FR>
<EN>Home</EN>
</MSGALL>
</P_XML>
Ensuite ca rc'est trop gros on parseur pour chaque langue pour creer un
autre XML qui est (.xsl) :
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output encoding="ISO-8859-1" />
<xsl:output indent="yes" omit-xml-declaration="yes" />
- <xsl:template match="P_XML">
- <xsl:for-each select="MSGALL">
- <xsl:choose>
- <xsl:when test="FR!=''">
- <MSG t="{@t}">
<xsl:value-of select="FR" />
</MSG>
</xsl:when>
- <xsl:otherwise>
- <MSG t="{@t}">
<xsl:value-of select="FR" />
</MSG>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Ceci donne ce résultat :
<MSG t="Liste des clients">Liste des clients</MSG>
<MSG t="Nom Usuel">Nom Usuel</MSG>
<MSG t="Nom Complet">Nom Complet</MSG>
<MSG t="Ville">Ville</MSG>
<MSG t="Pays">Pays</MSG>
<MSG t="Type Clients">Type Clients</MSG>
<MSG t="Rafraichir">Rafraîchir</MSG>
<MSG t="Creer un nouveau client">Créer un nouveau client</MSG>
<MSG t="Nouvelle recherche">Nouvelle recherche</MSG>
<MSG t="Accueil">Accueil</MSG>
La force de ce systeme est qu'il n'y a qu'un et qu'un seul document a
modifier qu'en t'il y a des langues ou du texte a rajouté.
Par contre, comme toi je suis a fond dans XSL:FO, j'aimerais avoir ton mail
pour echanger des infos a ce sujet. Le mien est kaspa1@caramail.com.
T'utilise quoi comme parseur pour creer ton fic.fo ?
-----Message d'origine-----
De : xml-tech-bounce@xmlfr.org [mailto:xml-tech-bounce@xmlfr.org]De la
part de MAHEAS Jean-Francois
Envoyé : jeudi 7 mars 2002 10:01
À : xml-tech@xmlfr.org
Objet : [xml-tech] Internationalisation de document
Bonjour,
Je visualise des données XML en PDF via une transformation XSLT (vers FO)
puis d'un formatage avec FOP.
Je souhaite internationaliser le document produit, c'est-à-dire paramétrer,
en fonction de la langue, les "textes fixes" (libellés) du document produit.
Les textes à traduire pourrait-être dans un dictionnaire.
Existe-t-il un mécanisme conseillé pour ce type de problème ?
Jeff
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (http://xmlfr.org).
Cette liste est a votre disposition pour discuter en francais de
tout sujet technique lie a XML.
Pour resilier votre abonnement, envoyez un message contenant
la commande "unsubscribe" a xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Archive générée par hypermail 2.1.3 le 28/06/2004 - 11:06 UTC
webmaster@xmlfr.org
|