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

fr par défaut si pas de sous-dossier au dossier fragments

parent b9f0db2c
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ module namespace max.i18n = 'pddn/max/i18n';
import module namespace max.util = 'pddn/max/util' at 'util.xqm';



declare
%rest:GET
%rest:path("/{$projectId}/setlang/{$lang}")
@@ -42,10 +41,13 @@ declare function max.i18n:getText($projectId as xs:string, $key as xs:string, $l
};

declare function max.i18n:getLanguageList($projectId){
    try {
        let $defaults := file:list(max.util:maxHome() || '/editions/' || $projectId || '/fragments')
        for $l in $defaults
        where $l != '.ignore'
        return fn:substring-before($l, '/')
    }
    catch * {'fr'}
};
(:
declare function max.i18n:getMap($projectId, $locale){