mirror of
https://github.com/24eme/signaturepdf
synced 2024-05-21 15:16:37 +02:00
add logic to handle button to change language (#48)
This commit is contained in:
parent
6d91f77c51
commit
00c7b3ff5c
9
app.php
9
app.php
|
@ -8,7 +8,8 @@ if(getenv("DEBUG")) {
|
|||
|
||||
$f3->set('LANGUAGES',
|
||||
['fr' => 'Français',
|
||||
'en' => 'English']);
|
||||
'en' => 'English',
|
||||
'de' => 'Deutsch']);
|
||||
|
||||
$f3->set('XFRAME', null); // Allow use in an iframe
|
||||
$f3->set('ROOT', __DIR__);
|
||||
|
@ -34,7 +35,11 @@ if($f3->get('DISABLE_ORGANIZATION')) {
|
|||
$f3->set('disableOrganization', $f3->get('DISABLE_ORGANIZATION'));
|
||||
}
|
||||
|
||||
setlocale(LC_ALL, 'fr');
|
||||
if ($f3->get('GET.lang')) {
|
||||
$lang = $f3->get('GET.lang');
|
||||
putenv("LANGUAGE=$lang");
|
||||
$f3->set('LANGUAGE', $lang);
|
||||
}
|
||||
bindtextdomain('application', $f3->get('ROOT')."/locale/");
|
||||
textdomain('application');
|
||||
|
||||
|
|
|
@ -19,6 +19,18 @@
|
|||
</div>
|
||||
</noscript>
|
||||
<div id="page-upload">
|
||||
<div class="dropdown float-end">
|
||||
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<?php echo _("Language"); ?>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||
<?php
|
||||
foreach ($LANGUAGES as $item => $key) {
|
||||
echo '<li><a class="dropdown-item" href="?lang=' . htmlspecialchars($item) . '">' . htmlspecialchars($key) . '</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="nav justify-content-center nav-tabs mt-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo $REVERSE_PROXY_URL; ?>/signature"> <?php echo sprintf(_("%s Sign"), '<i class="bi bi-vector-pen"></i>'); ?></a>
|
||||
|
@ -29,16 +41,6 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link active" href="<?php echo $REVERSE_PROXY_URL; ?>/metadata"> <?php echo sprintf(_("%s Metadata"), '<i class="bi bi-tags"></i>'); ?></a>
|
||||
</li>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<?php echo _("Language"); ?>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="px-4 py-4 text-center">
|
||||
<h1 class="display-5 fw-bold mb-0 mt-3"> <?php echo sprintf(_("%s Edit metadata"), '<i class="bi bi-tags"></i>'); ?></h1>
|
||||
|
@ -105,8 +107,7 @@
|
|||
</div>
|
||||
|
||||
<span id="is_mobile" class="d-md-none"></span>
|
||||
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.bundle.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf.js?legacy"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf-lib.min.js?1.17.1"></script>
|
||||
<script>
|
||||
|
|
|
@ -19,6 +19,18 @@
|
|||
</div>
|
||||
</noscript>
|
||||
<div id="page-upload">
|
||||
<div class="dropdown float-end">
|
||||
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<?php echo _("Language"); ?>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||
<?php
|
||||
foreach ($LANGUAGES as $item => $key) {
|
||||
echo '<li><a class="dropdown-item" href="?lang=' . htmlspecialchars($item) . '">' . htmlspecialchars($key) . '</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="nav justify-content-center nav-tabs mt-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo $REVERSE_PROXY_URL; ?>/signature"> <?php echo sprintf(_("%s Sign"), '<i class="bi bi-vector-pen"></i>'); ?></a>
|
||||
|
@ -108,7 +120,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="top_bar_action_selection" class="d-none">
|
||||
<div id="top_bar_action_selection_recap" class="bg-primary text-white text-center rounded-top p-1 position-relative"><button id="btn_liste_pdf_bar" type="button" style="text-decoration: none;left: 0px; top:0px;" class="btn bg-white bg-opacity-50 text-primary position-absolute p-0 ps-1 pe-1 mt-1 ms-1"><i class="bi bi-files"></i> <span></span> PDF</button><span id="top_bar_action_selection_recap_nb_pages"><?php echo _("No"); ?>></span> <?php echo _("page"); ?><button id="btn_cancel_select_mobile" type="button" style="text-decoration: none;right: 0px; top:0px;" class="btn bg-white bg-opacity-50 text-primary position-absolute p-0 ps-1 pe-1 mt-1 me-1"><i class="bi bi-x-lg"></i> <?php echo _("Cancel"); ?>></button></div>
|
||||
<div id="top_bar_action_selection_recap" class="bg-primary text-white text-center rounded-top p-1 position-relative"><button id="btn_liste_pdf_bar" type="button" style="text-decoration: none;left: 0px; top:0px;" class="btn bg-white bg-opacity-50 text-primary position-absolute p-0 ps-1 pe-1 mt-1 ms-1"><i class="bi bi-files"></i> <span></span> PDF</button><span id="top_bar_action_selection_recap_nb_pages"><?php echo _("No"); ?>></span> <?php echo _("page"); ?><button id="btn_cancel_select_mobile" type="button" style="text-decoration: none;right: 0px; top:0px;" class="btn bg-white bg-opacity-50 text-primary position-absolute p-0 ps-1 pe-1 mt-1 me-1"><i class="bi bi-x-lg"></i> <?php echo _("Cancel"); ?></button></div>
|
||||
<div class="btn-group w-100">
|
||||
<button id="btn_rotate_select_mobile" type="button" class="btn btn-outline-primary" style="border-top-left-radius: 0 !important;"><?php echo sprintf(_("%s Turn"), '<i class="bi bi-arrow-clockwise"></i>'); ?></button>
|
||||
<button id="btn_drag_select_mobile" type="button" class="btn btn-outline-primary"><?php echo sprintf(_("%s Move"), '<i class="bi bi-arrows-move"></i>'); ?></button>
|
||||
|
@ -141,7 +153,7 @@
|
|||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"><?php echo _("PDF documents"); ?>></h1>
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel"><?php echo _("PDF documents"); ?></h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
@ -152,7 +164,7 @@
|
|||
|
||||
<span id="is_mobile" class="d-md-none"></span>
|
||||
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.bundle.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf.js?legacy"></script>
|
||||
<script>
|
||||
var maxSize = <?php echo $maxSize ?>;
|
||||
|
|
|
@ -18,6 +18,18 @@
|
|||
</noscript>
|
||||
<div id="page-upload">
|
||||
<?php if(!$disableOrganization): ?>
|
||||
<div class="dropdown float-end">
|
||||
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<?php echo _("Language"); ?>
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
|
||||
<?php
|
||||
foreach ($LANGUAGES as $item => $key) {
|
||||
echo '<li><a class="dropdown-item" href="?lang=' . htmlspecialchars($item) . '">' . htmlspecialchars($key) . '</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="nav justify-content-center nav-tabs mt-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="<?php echo $REVERSE_PROXY_URL; ?>/signature"> <?php echo sprintf(_("%s Sign"), '<i class="bi bi-vector-pen"></i>'); ?></a>
|
||||
|
@ -263,7 +275,7 @@
|
|||
|
||||
<span id="is_mobile" class="d-md-none"></span>
|
||||
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.bundle.min.js?5.1.3"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/pdf.js?legacy"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/fabric.min.js?4.6.0"></script>
|
||||
<script src="<?php echo $REVERSE_PROXY_URL; ?>/vendor/signature_pad.umd.min.js?3.0.0-beta.3"></script>
|
||||
|
|
Loading…
Reference in a new issue