Commit 0c1c7563 authored by chauveau's avatar chauveau
Browse files

patch i18n - chemins absolus

parent ac23d030
......@@ -351,7 +351,7 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
<ul class="nav navbar-nav">{
for $se in $subEntries
let $target := $docMenu//entry[./id=$se/text()]/target/text()
let $label := max.i18n:getText($projectId, "menu." || $se/id)
let $label := max.i18n:getText($projectId, "menu." || $docMenu//entry[./id=$se/text()]/id/text())
return <li><a href="{$target}">{if(not($label='menu.')) then $label else $se/text()}</a></li>
}
</ul>
......@@ -362,7 +362,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
<ul class="nav navbar-nav">{
for $c in $parentEntry/subentry
let $target := $c/target/text()
return <li><a href="{$target}">{$c/text()}</a></li>
let $label := max.i18n:getText($projectId, "menu." || $c/id/text())
return <li><a href="{$target}">{if(not($label='menu.')) then $label else $c/text()}</a></li>
}
</ul>
</div>
......
......@@ -77,7 +77,7 @@ The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms.
:)
module namespace max.i18n = 'pddn/max/i18n';
import module namespace max.util = 'pddn/max/util' at 'util.xqm';
declare variable $max.i18n:DEFAULT_FILE := "../ui/i18n/I18n.xml";
declare function max.i18n:getText($projectId as xs:string, $key as xs:string){
......@@ -87,11 +87,11 @@ declare function max.i18n:getText($projectId as xs:string, $key as xs:string){
declare function max.i18n:getText($projectId as xs:string, $key as xs:string, $locale as xs:string ?)
{
let $i18nResourceFile := if($locale)
then "../i18n/I18n" || $locale || ".xml"
then max.util:maxHome() ||"/ui/i18n/I18n" || $locale || ".xml"
else $max.i18n:DEFAULT_FILE
let $projectI18nFile := if($locale)
then "../editions/" || $projectId || "/ui/i18n/I18n" || $locale || ".xml"
else "../editions/" || $projectId || "/ui/i18n/I18n.xml"
then max.util:maxHome() ||"/editions/" || $projectId || "/ui/i18n/I18n" || $locale || ".xml"
else max.util:maxHome() ||"/editions/" || $projectId || "/ui/i18n/I18n.xml"
return
try{
......@@ -106,4 +106,5 @@ declare function max.i18n:getText($projectId as xs:string, $key as xs:string, $l
then doc($i18nResourceFile)//entry[@key=$key]/text()
else $key
}
};
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment