1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-06-03 06:22:13 +02:00

Language use for traduction

This commit is contained in:
Vincent LAURENT 2023-09-22 17:04:37 +02:00
parent 277e1669c3
commit 3c962b9a68
5 changed files with 8 additions and 6 deletions

View file

@ -44,16 +44,18 @@ if ($f3->get('GET.lang')) {
} elseif (isset($_COOKIE['LANGUAGE'])) { } elseif (isset($_COOKIE['LANGUAGE'])) {
changeLanguage($_COOKIE['LANGUAGE'], $f3); changeLanguage($_COOKIE['LANGUAGE'], $f3);
} }
bindtextdomain('application', $f3->get('ROOT')."/locale/"); bindtextdomain('application', $f3->get('ROOT')."/locale/");
textdomain('application'); textdomain('application');
function changeLanguage($lang, $f3) { function changeLanguage($lang, $f3) {
$_SESSION['LANGUAGE'] = $lang; $_SESSION['LANGUAGE'] = $lang;
setcookie("LANGUAGE", $lang, strtotime('+1 year')); setcookie("LANGUAGE", $lang, strtotime('+1 year'));
putenv("LANGUAGE=$lang"); getenv("LANGUAGE=$lang");
$f3->set('LANGUAGE', $lang);
} }
$f3->set('LANGUAGE', _("en"));
$f3->route('GET /', $f3->route('GET /',
function($f3) { function($f3) {
$f3->reroute($f3->get('REVERSE_PROXY_URL').'/signature'); $f3->reroute($f3->get('REVERSE_PROXY_URL').'/signature');

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="fr_FR"> <html lang="<?php echo $LANGUAGE ?>"<?php if($LANGUAGE == 'ar'): ?> dir="ltr" style="direction: ltr;"<?php endif;?>>
<head> <head>
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="fr_FR"> <html lang="<?php echo $LANGUAGE ?>"<?php if($LANGUAGE == 'ar'): ?> dir="ltr" style="direction: ltr;"<?php endif;?>>
<head> <head>
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="fr_FR"> <html lang="<?php echo $LANGUAGE ?>"<?php if($LANGUAGE == 'ar'): ?> dir="ltr" style="direction: ltr;"<?php endif;?>>
<head> <head>
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">

View file

@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="fr"> <html lang="<?php echo $LANGUAGE ?>"<?php if($LANGUAGE == 'ar'): ?> dir="ltr" style="direction: ltr;"<?php endif;?>>
<head> <head>
<!-- Required meta tags --> <!-- Required meta tags -->
<meta charset="utf-8"> <meta charset="utf-8">