Commit 11e86033 authored by Yadd's avatar Yadd
Browse files

Enable AUTH_ERROR translation (#595)

parent bd7d6716
......@@ -188,7 +188,7 @@ MANAGERJSONDST=$(SRCMANAGERDIR)/site/static/struct.json \
# Javascript and CSS to minify
JSSRCFILES:=$(shell find */site/static/js $(SRCPORTALDIR)/site/htdocs/static/common/js -type f -name '*.js' ! -name '*.min.js') \
$(SRCMANAGERDIR)/site/static/bwr/file-saver.js/FileSaver.js
CSSSRCFILES:=$(shell find */site/static/css $(SRCPORTALDIR)/site/htdocs/static/common/css -type f -name '*.css' ! -name '*.min.css')
CSSSRCFILES:=$(shell find */site/static/css $(SRCPORTALDIR)/site/htdocs/static -type f -name '*.css' ! -name '*.min.css')
# Coffee files
MANAGERCOFFEESRCFILES:=$(shell find lemonldap-ng-manager/site/coffee -type f -name '*.coffee')
......
......@@ -18,6 +18,8 @@ translatePage = (lang) ->
translationFields = data
$("[trspan]").each ->
$(this).text translate $(this).attr 'trspan'
$("[trmsg]").each ->
$(this).text translate "PE#{$(this).attr 'trmsg'}"
translate = (str) ->
return if translationFields[str] then translationFields[str] else str
......
......@@ -20,9 +20,12 @@ Used variables:
translatePage = function(lang) {
return $.getJSON(window.staticPrefix + "languages/" + lang + ".json", function(data) {
translationFields = data;
return $("[trspan]").each(function() {
$("[trspan]").each(function() {
return $(this).text(translate($(this).attr('trspan')));
});
return $("[trmsg]").each(function() {
return $(this).text(translate("PE" + ($(this).attr('trmsg'))));
});
});
};
......
(function(){var d,e,j,a,h,k,i,f,b,l,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};c={};l=function(m){return $.getJSON(window.staticPrefix+"languages/"+m+".json",function(n){c=n;return $("[trspan]").each(function(){return $(this).text(b($(this).attr("trspan")))})})};b=function(m){if(c[m]){return c[m]}else{return m}};h=window.newwindow.match("1")?true:false;e=window.antiframe.match("0")?false:true;d=window.activeTimer.match("0")?false:true;f="#appslist";j=function(){return $.ajax({type:"POST",url:scriptname,data:{storeAppsListOrder:$(f).sortable("toArray").join()},dataType:"json"})};i=function(){var o,n,r,z,m,w,q,s,p,u,x,t,y;u=$(f);if(!((u!=null)&&appslistorder)){return null}o=appslistorder.split(",");w=u.sortable("toArray");x=[];for(r=0,s=w.length;r<s;r++){y=w[r];x[y]=y}for(q=0,p=o.length;q<p;q++){m=o[q];if(g.call(x,m)>=0){z=x[m];n=$(f+".ui-sortable").children("#"+z);t=$(f+".ui-sortable").children("#"+m);n.remove();$(f+".ui-sortable").filter(":first").append(t)}}return 1};a=function(m){return $("#lmhidden_"+m).length};k=function(){return $.ajax({type:"POST",url:scriptname,data:{ping:1},dataType:"json",success:function(m){if(m.auth){return setTimeout("ping();",pingInterval)}else{return location.reload(true)}}})};window.ping=k;$(document).ready(function(){var y,x,A,w,B,z,D,u,t,C,s,r,v,p,n,o,m,q;if(e&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:0.5,revert:true,items:"> div.category",update:function(){return j()}});i();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));p=$("#menu").tabs({active:0});v=$('#menu a[href="#'+displaytab+'"]').parent().index();if(v<0){v=0}p.tabs("option","active",v);A=$("#authMenu").tabs({active:0});if(choicetab){A.tabs("option","active",$('#authMenu a[href="#'+choicetab+'"]').parent().index())}if(login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(h){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){y=$("form.login").attr("action");n=$("form.login").attr("method");w="";if(y.indexOf("?")!==-1){y.substring(0,y.indexOf("?"))+"?"}else{w=y+"?"}$("form.login input[type=hidden]").each(function(E){return w+="&"+$(this).attr("name")+"="+$(this).val()});r=$("p.removeOther a").attr("href")+"&method="+n+"&url="+btoa(w);$("p.removeOther a").attr("href",r)}if(navigator){u=[];t=[];m=[navigator.language];if(navigator.languages){m=navigator.languages}for(B=0,C=m.length;B<C;B++){o=m[B];q=window.availableLanguages;for(z=0,s=q.length;z<s;z++){x=q[z];if(x===o){u.push(x)}else{if(x.substring(0,1)===o.substring(0,1)){t.push(x)}}}}D=u[0]?u[0]:t[0]?t[0]:"en"}else{D="en"}return l(D)})}).call(this);
\ No newline at end of file
(function(){var d,e,j,a,h,k,i,f,b,l,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};c={};l=function(m){return $.getJSON(window.staticPrefix+"languages/"+m+".json",function(n){c=n;$("[trspan]").each(function(){return $(this).text(b($(this).attr("trspan")))});return $("[trmsg]").each(function(){return $(this).text(b("PE"+($(this).attr("trmsg"))))})})};b=function(m){if(c[m]){return c[m]}else{return m}};h=window.newwindow.match("1")?true:false;e=window.antiframe.match("0")?false:true;d=window.activeTimer.match("0")?false:true;f="#appslist";j=function(){return $.ajax({type:"POST",url:scriptname,data:{storeAppsListOrder:$(f).sortable("toArray").join()},dataType:"json"})};i=function(){var o,n,r,z,m,w,q,s,p,u,x,t,y;u=$(f);if(!((u!=null)&&appslistorder)){return null}o=appslistorder.split(",");w=u.sortable("toArray");x=[];for(r=0,s=w.length;r<s;r++){y=w[r];x[y]=y}for(q=0,p=o.length;q<p;q++){m=o[q];if(g.call(x,m)>=0){z=x[m];n=$(f+".ui-sortable").children("#"+z);t=$(f+".ui-sortable").children("#"+m);n.remove();$(f+".ui-sortable").filter(":first").append(t)}}return 1};a=function(m){return $("#lmhidden_"+m).length};k=function(){return $.ajax({type:"POST",url:scriptname,data:{ping:1},dataType:"json",success:function(m){if(m.auth){return setTimeout("ping();",pingInterval)}else{return location.reload(true)}}})};window.ping=k;$(document).ready(function(){var y,x,A,w,B,z,D,u,t,C,s,r,v,p,n,o,m,q;if(e&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:0.5,revert:true,items:"> div.category",update:function(){return j()}});i();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));p=$("#menu").tabs({active:0});v=$('#menu a[href="#'+displaytab+'"]').parent().index();if(v<0){v=0}p.tabs("option","active",v);A=$("#authMenu").tabs({active:0});if(choicetab){A.tabs("option","active",$('#authMenu a[href="#'+choicetab+'"]').parent().index())}if(login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(h){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){y=$("form.login").attr("action");n=$("form.login").attr("method");w="";if(y.indexOf("?")!==-1){y.substring(0,y.indexOf("?"))+"?"}else{w=y+"?"}$("form.login input[type=hidden]").each(function(E){return w+="&"+$(this).attr("name")+"="+$(this).val()});r=$("p.removeOther a").attr("href")+"&method="+n+"&url="+btoa(w);$("p.removeOther a").attr("href",r)}if(navigator){u=[];t=[];m=[navigator.language];if(navigator.languages){m=navigator.languages}for(B=0,C=m.length;B<C;B++){o=m[B];q=window.availableLanguages;for(z=0,s=q.length;z<s;z++){x=q[z];if(x===o){u.push(x)}else{if(x.substring(0,1)===o.substring(0,1)){t.push(x)}}}}D=u[0]?u[0]:t[0]?t[0]:"en"}else{D="en"}return l(D)})}).call(this);
\ No newline at end of file
......@@ -4,7 +4,7 @@
<div id="logincontent" class="container">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><TMPL_VAR NAME="AUTH_ERROR"></div>
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></div>
</TMPL_IF>
<TMPL_IF AUTH_LOOP>
......
......@@ -3,7 +3,7 @@
<div id="mailcontent" class="container">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><TMPL_VAR NAME="AUTH_ERROR"></div>
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></div>
</TMPL_IF>
<div class="panel panel-default">
......
......@@ -3,7 +3,7 @@
<div id="menucontent" class="container">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><TMPL_VAR NAME="AUTH_ERROR"></div>
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></div>
</TMPL_IF>
<div id="menu">
......
......@@ -4,7 +4,7 @@
<TMPL_IF NAME="AUTH_ERROR">
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert">
<TMPL_VAR NAME="AUTH_ERROR">
<span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span>
</div>
</TMPL_IF>
......
......@@ -3,7 +3,7 @@
<div id="mailcontent" class="container">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><TMPL_VAR NAME="AUTH_ERROR"></div>
<div class="message message-<TMPL_VAR NAME="AUTH_ERROR_TYPE"> alert"><span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></div>
</TMPL_IF>
<div class="panel panel-default">
......
......@@ -22,7 +22,7 @@
<h1 trspan="openSSOSession">Open your SSO session</h1>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p><span class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></span></p>
<p><span class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></p>
</TMPL_IF>
<!-- tabs -->
......@@ -122,7 +122,7 @@
<h1 trspan="openSSOSession">Open your SSO session</h1>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p><span class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></span></p>
<p><span class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></p>
</TMPL_IF>
<form action="#" method="post" class="login">
<TMPL_VAR NAME="HIDDEN_INPUTS">
......@@ -152,7 +152,7 @@
<h1 trspan="openSSOSession">Open your SSO session</h1>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p><span class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></span></p>
<p><span class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></p>
</TMPL_IF>
<form action="#" method="post" class="login">
<TMPL_VAR NAME="HIDDEN_INPUTS">
......@@ -182,7 +182,7 @@
<h1 trspan="openSSOSession">Open your SSO session</h1>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p><span class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></span></p>
<p><span class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span></p>
</TMPL_IF>
<form action="#" method="post" class="login">
<TMPL_VAR NAME="HIDDEN_INPUTS">
......@@ -212,7 +212,7 @@
<h1 trspan="openSSOSession">Open your SSO session</h1>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p><span class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></span></p>
<p><span class="text-error" trmsg"<TMPL_VAR NAME="AUTH_ERROR">"></span></p>
</TMPL_IF>
<form action="#" method="post" class="login <TMPL_VAR NAME="module">">
<TMPL_VAR NAME="HIDDEN_INPUTS">
......@@ -262,7 +262,7 @@
</div>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<TMPL_INCLUDE NAME="password.tpl">
</div>
......@@ -277,7 +277,7 @@
</div>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<TMPL_IF NAME="MSG">
<div id="content-all-info">
......@@ -298,7 +298,7 @@
</div>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<p>
<img src="<TMPL_VAR NAME="SKIN_PATH">/<TMPL_VAR NAME="SKIN">/images/arrow.png" /><a href="<TMPL_VAR NAME="LOGOUT_URL">" class="negative"><span trspan="logout">Logout</span></a>
......
......@@ -8,7 +8,7 @@
</div>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<TMPL_IF NAME="DISPLAY_FORM">
......
......@@ -5,7 +5,7 @@
<TMPL_IF NAME="AUTH_ERROR">
<div class="title">
<img src="<TMPL_VAR NAME="STATIC_PREFIX">/<TMPL_VAR NAME="SKIN">/images/logo-ok.png" />
<TMPL_VAR NAME="AUTH_ERROR">
<span trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></span>
</div>
<hr class="solid" />
</TMPL_IF>
......
......@@ -8,7 +8,7 @@
<div id="content-right">
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<TMPL_IF NAME="ID">
<p><span trspan="yourIdentityIs">Your identity is</span>:</p>
......
......@@ -8,7 +8,7 @@
</div>
<hr class="solid" />
<TMPL_IF NAME="AUTH_ERROR">
<p class="text-error"><TMPL_VAR NAME="AUTH_ERROR"></p>
<p class="text-error" trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></p>
</TMPL_IF>
<TMPL_IF NAME="DISPLAY_FORM">
......
......@@ -3,7 +3,7 @@
<div id="logincontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li><TMPL_VAR NAME="AUTH_ERROR"></li></ul></div>
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<div class="loginlogo"></div>
......
......@@ -3,7 +3,7 @@
<div id="mailcontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li><TMPL_VAR NAME="AUTH_ERROR"></li></ul></div>
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<div class="loginlogo"></div>
......
......@@ -3,7 +3,7 @@
<div id="menucontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li><TMPL_VAR NAME="AUTH_ERROR"></li></ul></div>
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<div id="menu">
......
......@@ -3,7 +3,7 @@
<div id="logincontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li><TMPL_VAR NAME="AUTH_ERROR"></li></ul></div>
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<div class="loginlogo"></div>
......
......@@ -3,7 +3,7 @@
<div id="mailcontent">
<TMPL_IF NAME="AUTH_ERROR">
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li><TMPL_VAR NAME="AUTH_ERROR"></li></ul></div>
<div class="message <TMPL_VAR NAME="AUTH_ERROR_TYPE">"><ul><li trmsg="<TMPL_VAR NAME="AUTH_ERROR">"></li></ul></div>
</TMPL_IF>
<div class="loginlogo"></div>
......
Markdown is supported
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