diff --git a/public/about/index.php b/public/about/index.php
index a0a82ac..41e9635 100755
--- a/public/about/index.php
+++ b/public/about/index.php
@@ -4,29 +4,9 @@ ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
-require "$root/database/credentials.php";
-// Connect the database
-try {
- $db = new PDO("mysql:host=$host;dbname=$database;charset=utf8",
- $user,
- $password,
- array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
- ));
-} catch (Exception $e) {
- die("Error : ".$e->getMessage());
-}
-if (isset($_GET['record'])) {
- $req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` WHERE id=:id');
- $req->execute(array(
- "id"=>$_GET['record']
- ));
-} else {
- $req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` ORDER BY date DESC, time DESC LIMIT 1');
- $req->execute();
-}
-$data = $req->fetch();
+$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
+require("$root/lang/gettext.php");
?>
-
@@ -44,12 +24,12 @@ include("$root/analytics/owa.php");
- About
- Chiro-Canto is an online bat sound sharing set of tools, inspired by Xeno-Canto.
- Author
- This website is developped with ♥ by Samuel ORTION, a juvenile Geekus biologicus.
- Source code
- This project is available under the GNU Affero GPL v3 license at https://forge.ortion.xyz/Chiro-Canto/chiro-canto.
+ =_('About')?>
+ =_('Chiro-Canto is an online bat sound sharing set of tools, inspired by Xeno-Canto.')?>
+ =_('Author')?>
+ =_('This website is developped with ♥ by Samuel ORTION, a juvenile Geekus biologicus.')?>
+ =_('Source code')?>
+ =_('This project is available under the GNU Affero GPL v3 license at https://forge.ortion.xyz/Chiro-Canto/chiro-canto.')?>
diff --git a/public/api/v1/doc/index.php b/public/api/v1/doc/index.php
index 49b5bb0..7add4f5 100755
--- a/public/api/v1/doc/index.php
+++ b/public/api/v1/doc/index.php
@@ -5,6 +5,8 @@ error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include("$root/vendor/erusev/parsedown/Parsedown.php");
$Parsedown = new Parsedown();
+$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
+require("$root/lang/$lang/lang.php");
?>
diff --git a/public/articles/index.php b/public/articles/index.php
index c0dccff..f5012e5 100755
--- a/public/articles/index.php
+++ b/public/articles/index.php
@@ -8,7 +8,7 @@ ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include("$root/vendor/erusev/parsedown/Parsedown.php");
$Parsedown = new Parsedown();
-
+require("$root/lang/gettext.php");
function archive() {
global $root;
$results = array();
diff --git a/public/articles/list.php b/public/articles/list.php
index 00d4934..3b262d6 100755
--- a/public/articles/list.php
+++ b/public/articles/list.php
@@ -23,7 +23,7 @@ include("$root/analytics/owa.php");
diff --git a/public/articles/view.php b/public/articles/view.php
index caa2e71..ac23d61 100755
--- a/public/articles/view.php
+++ b/public/articles/view.php
@@ -2,5 +2,5 @@
title)?>
text(htmlspecialchars($results['articles'][0]->summary))?>
text(htmlspecialchars($results['articles'][0]->content))?>
-Published on publication_date)?>
-Return to Homepage
+=_('Published on ')?>publication_date)?>
+=_('Return to Homepage')?>
diff --git a/public/auth/index.php b/public/auth/index.php
new file mode 100644
index 0000000..89c73ca
--- /dev/null
+++ b/public/auth/index.php
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/public/auth/login/index.php b/public/auth/login/index.php
index 61275e8..9a1537e 100755
--- a/public/auth/login/index.php
+++ b/public/auth/login/index.php
@@ -4,7 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
-
+require("$root/lang/gettext.php");
?>
@@ -13,7 +13,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
- Login | Chiro - Canto
+ =_('Login')?> | Chiro - Canto
- Login
+ =_('Login')?>
=(isset($_SESSION['error_msg']) and ! $_SESSION['error_msg'] == "" ) ? ''.$_SESSION['error_msg'].'
' : ""?>
+ =_('Not yet registered ?')?>
diff --git a/public/auth/login/login.php b/public/auth/login/login.php
index e72f46d..ad41bd4 100755
--- a/public/auth/login/login.php
+++ b/public/auth/login/login.php
@@ -46,16 +46,16 @@ if (isset($_POST['submit']))
$username = $_POST['username'];
} else
{
- $_SESSION['error_msg'] .= "You did not enter a proper username.\n";
+ $_SESSION['error_msg'] .= _('You did not enter a proper username.').'\n';
}
if (isset($_POST['password'])) {
$password = $_POST['password'];
} else {
- $_SESSION['error_msg'] .= "You did not enter a proper password.\n";
+ $_SESSION['error_msg'] .= _('You did not enter a proper password.').'\n';
}
} else
{
- $_SESSION['error_msg'] .= "You did not submit the register form.\n";
+ $_SESSION['error_msg'] .= _('You did not submit the register form.');
}
if ($_SESSION['error_msg'] == "")
@@ -67,11 +67,11 @@ if ($_SESSION['error_msg'] == "")
$_SESSION['username'] = $username;
header('Location: '."/");
} else {
- $_SESSION['error_msg'] = "Incorrect password, please try again.\n";
+ $_SESSION['error_msg'] = _('Incorrect password, please try again.').'\n';
header('Location: '."../../auth/login");
}
} else
{
- // header('Location: '."../../auth/login");
+ header('Location: '."../../auth/login");
}
?>
\ No newline at end of file
diff --git a/public/auth/register/index.php b/public/auth/register/index.php
index e4ad8ff..31ef89f 100755
--- a/public/auth/register/index.php
+++ b/public/auth/register/index.php
@@ -4,6 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
+require("$root/lang/gettext.php");
?>
@@ -13,7 +14,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
- Register | Chiro - Canto
+ =_('Register')?> | Chiro - Canto
- Register
+ =_('Register')?>
=(isset($_SESSION['error_msg']) and ! $_SESSION['error_msg'] == "") ? ''.$_SESSION['error_msg'].'
' : ""?>
+ =_('Already registered ?')?>