1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-05-21 07:06:41 +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'])) {
changeLanguage($_COOKIE['LANGUAGE'], $f3);
}
bindtextdomain('application', $f3->get('ROOT')."/locale/");
textdomain('application');
function changeLanguage($lang, $f3) {
$_SESSION['LANGUAGE'] = $lang;
setcookie("LANGUAGE", $lang, strtotime('+1 year'));
putenv("LANGUAGE=$lang");
$f3->set('LANGUAGE', $lang);
getenv("LANGUAGE=$lang");
}
$f3->set('LANGUAGE', _("en"));
$f3->route('GET /',
function($f3) {
$f3->reroute($f3->get('REVERSE_PROXY_URL').'/signature');

View file

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

View file

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

View file

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

View file

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