Commit e7ceb8bc authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

passage de la locale en paramètre de la transfo texte pr mise à disposition...

passage de la locale en paramètre de la transfo texte pr mise à disposition dans la text_hook.xsl. #110
parent a5e7f14f
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -334,6 +334,7 @@ function max:buildSitemap($project){


declare %private function max:invokePluginXQueries($project, $routeDoc, $id){
    try {
        let $dbPath := max.config:getProjectDBPath($project)
        let $pluginsHTML :=
            for $pluginName in max.config:getEnabledPluginNames($project)
@@ -351,6 +352,8 @@ declare %private function max:invokePluginXQueries($project, $routeDoc, $id){
                        })
            else ()
        return $pluginsHTML
    }
        catch * {max:max-error("Erreur code " || $err:code, $err:description,$err:module, $err:line-number)}
};


+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ module namespace max.config = 'pddn/max/config';
import module namespace rest = "http://exquery.org/ns/restxq";
import module namespace max.cons = 'pddn/max/cons' at 'cons.xqm';
import module namespace max.util = 'pddn/max/util' at 'util.xqm';
import module namespace max.i18n = 'pddn/max/i18n' at 'i18n.xqm';



(: CONFIGURATION file path. :)
@@ -187,6 +189,7 @@ declare function max.config:getXSLTParams($project, $doc, $id){
                   $pluginsParams, 
                   map{
                     'baseuri' : max.config:getBaseURI(),
                     'locale': max.i18n:getLang($project),
                     'route': if($doc) then $doc else '',
                     'id': if($id) then $id else '',
                     'project' : $project}))
+8 −8
Original line number Diff line number Diff line
@@ -10,14 +10,14 @@
        <xsl:param name="key"/>
        <xsl:param name="locale"/>

        <xsl:variable name="localPrefix">
            <xsl:choose>
                <xsl:when test="$locale">
                    <xsl:value-of select="$locale"/>
                </xsl:when>
                <xsl:otherwise>fr</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
<!--        <xsl:variable name="localPrefix">-->
<!--            <xsl:choose>-->
<!--                <xsl:when test="$locale">-->
<!--                    <xsl:value-of select="$locale"/>-->
<!--                </xsl:when>-->
<!--                <xsl:otherwise>fr</xsl:otherwise>-->
<!--            </xsl:choose>-->
<!--        </xsl:variable>-->

        <xsl:variable name="defaultEntry">
            <xsl:value-of select="document(concat('../i18n/i18n-',$locale,'.xml'))//entry[@key=$key]"/>