Skip to content

Commit

Permalink
Language direction is store in a variable and always write in html.
Browse files Browse the repository at this point in the history
Bootstrap css rtl is store project and bootstrap css is rename with ltr
  • Loading branch information
wincelau committed Sep 22, 2023
1 parent 9d35daf commit 9da9891
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 33 deletions.
5 changes: 5 additions & 0 deletions app.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ function changeLanguage($lang, $f3) {
}

$f3->set('TRANSLATION_LANGUAGE', _("en"));
$f3->set('DIRECTION_LANGUAGE', 'ltr');
if($f3->get('TRANSLATION_LANGUAGE') == "ar") {
$f3->set('DIRECTION_LANGUAGE', 'rtl');
}


$f3->route('GET /',
function($f3) {
Expand Down
7 changes: 0 additions & 7 deletions public/vendor/bootstrap.min.css

This file was deleted.

1 change: 0 additions & 1 deletion public/vendor/bootstrap.min.css.map

This file was deleted.

8 changes: 2 additions & 6 deletions templates/compress.html.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<!doctype html>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>"<?php if($TRANSLATION_LANGUAGE == 'ar'): ?> dir="rtl" style="direction: rtl;"<?php endif;?>>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>" dir="<?php echo $DIRECTION_LANGUAGE ?>" style="direction: <?php echo $DIRECTION_LANGUAGE ?>;">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php if ($TRANSLATION_LANGUAGE == 'ar'): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<?php else: ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
<?php endif ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.<?php echo $DIRECTION_LANGUAGE ?>.min.css?5.1.1" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="<?php echo $REVERSE_PROXY_URL; ?>/favicon-metadata.ico">
Expand Down
8 changes: 2 additions & 6 deletions templates/metadata.html.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<!doctype html>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>"<?php if($TRANSLATION_LANGUAGE == 'ar'): ?> dir="rtl" style="direction: rtl;"<?php endif;?>>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>" dir="<?php echo $DIRECTION_LANGUAGE ?>" style="direction: <?php echo $DIRECTION_LANGUAGE ?>;">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php if ($TRANSLATION_LANGUAGE == 'ar'): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<?php else: ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
<?php endif ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.<?php echo $DIRECTION_LANGUAGE ?>.min.css?5.1.1" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="<?php echo $REVERSE_PROXY_URL; ?>/favicon-metadata.ico">
Expand Down
8 changes: 2 additions & 6 deletions templates/organization.html.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<!doctype html>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>"<?php if($TRANSLATION_LANGUAGE == 'ar'): ?> dir="rtl" style="direction: rtl;"<?php endif;?>>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>" dir="<?php echo $DIRECTION_LANGUAGE ?>" style="direction: <?php echo $DIRECTION_LANGUAGE ?>;">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php if ($TRANSLATION_LANGUAGE == 'ar'): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<?php else: ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
<?php endif ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.<?php echo $DIRECTION_LANGUAGE ?>.min.css?5.1.1" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="<?php echo $REVERSE_PROXY_URL; ?>/favicon-organization.ico">
Expand Down
10 changes: 3 additions & 7 deletions templates/signature.html.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<!doctype html>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>"<?php if($TRANSLATION_LANGUAGE == 'ar'): ?> dir="rtl" style="direction: rtl;"<?php endif;?>>
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>" dir="<?php echo $DIRECTION_LANGUAGE ?>" style="direction: <?php echo $DIRECTION_LANGUAGE ?>;">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Logiciel libre de signature de PDF en ligne">
<?php if ($TRANSLATION_LANGUAGE == 'ar'): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.rtl.min.css" integrity="sha384-+qdLaIRZfNu4cVPK/PxJJEy0B0f3Ugv8i482AKY7gwXwhaCroABd086ybrVKTa0q" crossorigin="anonymous">
<?php else: ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
<?php endif ?>
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.<?php echo $DIRECTION_LANGUAGE ?>.min.css?5.1.1" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap-icons.css?1.8.1" rel="stylesheet">
<link href="<?php echo $REVERSE_PROXY_URL; ?>/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
<title>Signature PDF</title>
Expand Down Expand Up @@ -265,7 +261,7 @@
var maxPage = <?php echo $maxPage ?>;
var sharingMode = <?php echo intval(!isset($noSharingMode)) ?>;
var hash = null;
var direction = '<?php if ($TRANSLATION_LANGUAGE == 'ar'): ?>rtl<?php else: ?>ltr<?php endif ?>';
var direction = '<?php echo $DIRECTION_LANGUAGE ?>';
<?php if(isset($hash)): ?>
hash = "<?php echo $hash ?>";
<?php endif; ?>
Expand Down

0 comments on commit 9da9891

Please sign in to comment.