diff --git a/index.php b/index.php
index 1d05ba6..4808951 100644
--- a/index.php
+++ b/index.php
@@ -26,14 +26,14 @@ include LIB_DIR."/functions.php";
### Translations
loadlang(LANGUAGE);
-global $LANG;
+global $LANG,$JSLANG;
### Security
testip();
logprotect();
### Sessions
-session_name(markdoc);
+session_name('markdoc');
session_start();
/*var_dump($_POST);
@@ -223,6 +223,9 @@ print(($_SESSION['md_admin'] == true)?'
+
':''); ?>
diff --git a/js/functions.js b/js/functions.js
index 9a39905..56ae9cf 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -10,13 +10,14 @@
var external = RegExp('^((f|ht)tps?:)?//');
var javascript = RegExp('^javascript:');
var emoji;
+var LANG;
$(function(){
$("#files").jstree({
themes: { responsive: true },
plugins: [ "types" ],
core:
{
- strings:{ loading: "Chargement" },
+ strings:{ loading: LANG['LOADING'] },
check_callback: true,
data : {
type: "POST",
@@ -75,7 +76,7 @@ function openlink(dest,majtree)
if (dest!="special/404.md")
openlink("special/404.md",false);
else
- $("#content").html("Erreur 404 sur erreur 404: pas de /special/404.md !");
+ $("#content").html(""+LANG['404X2']+"");
}
});
}
@@ -173,7 +174,7 @@ function search(arg)
if (dest!="special/404.md")
openlink("special/404.md",false);
else
- $("#content").html("Erreur 404 sur erreur 404: pas de /special/404.md !");
+ $("#content").html(""+LANG['404X2']+"");
}
});
}
diff --git a/js/functionsadmin.js b/js/functionsadmin.js
index 178df0d..5fd840c 100644
--- a/js/functionsadmin.js
+++ b/js/functionsadmin.js
@@ -56,7 +56,7 @@ $(function(){
plugins: ["contextmenu", "dnd" ],
core:
{
- strings:{ loading: "Chargement" },
+ strings:{ loading: LANG['LOADING'] },
check_callback: true,
data : {
type: "POST",
@@ -77,7 +77,7 @@ $(function(){
preview.innerHTML = emoji.replace_colons(this.parent.markdown(plainText));
Prism.highlightAll();
}.bind(this), 1)
- return "Chargement..."
+ return LANG['LOADING']
},
toolbar: ["bold","italic","strikethrough","|","heading-1","heading-2","heading-3","|","quote","unordered-list","ordered-list","horizontal-rule","|",
{
@@ -161,12 +161,12 @@ $(function(){
alertBox(data[1], data[0]);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
- alertBox('Erreur AJAX !','danger');
+ alertBox(LANG['AJAXERROR'],'danger');
}
});
}
else
- alertBox('Erreur de sélection !', 'danger');
+ alertBox(LANG['SELECTERROR'], 'danger');
});
$("#files").on("select_node.jstree", function (e, nodes) {
@@ -174,7 +174,7 @@ $(function(){
if ($("#files").jstree("is_leaf",nodes.node))
editlink(file);
else
- alertBox('Fonction non implémentée !','danger');
+ alertBox(LANG['NOTCODED'],'danger');
});
$("input[name=submit]").click(function(e) {
@@ -239,7 +239,7 @@ function openlink(dest,majtree)
if (dest!="special/404.md")
openlink("special/404.md",true);
else
- $("#content").html("Erreur 404 sur erreur 404: pas de /special/404.md !");
+ $("#content").html(""+LANG['404X2']+"");
}
});
}
@@ -329,7 +329,7 @@ function editlink(dest)
editfile=dest;
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
- alertBox('Erreur AJAX', 'danger');
+ alertBox(LANG['AJAXERROR'], 'danger');
}
});
}
@@ -361,7 +361,7 @@ function search(arg)
if (dest!="special/404.md")
openlink("special/404.md",true);
else
- $("#content").html("Erreur 404 sur erreur 404: pas de /special/404.md !");
+ $("#content").html(""+LANG['404X2']+"");
}
});
}
diff --git a/lib/functions.php b/lib/functions.php
index 1f4a57d..ad2b3f4 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -157,8 +157,9 @@ function searchstr($path, $string){
function loadlang($language)
{
- global $LANG;
- $LANG=json_decode(file_get_contents(ROOT_DIR."lang/".$language.".json"),true);
+ global $LANG,$JSLANG;
+ $JSLANG=file_get_contents(ROOT_DIR."lang/".$language.".json");
+ $LANG=json_decode($JSLANG,true);
}
function history($file)