Adds i18n, english l10n, CHANGELOG and lesserphp instead of lessphp

This commit is contained in:
Miraty 2020-07-01 20:47:02 +02:00
parent fc718d2e46
commit 3356db6555
17 changed files with 5732 additions and 3999 deletions

49
CHANGELOG.md Normal file
View File

@ -0,0 +1,49 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
### Added
* i18n system
* English l10n
* Changelog
### Changed
* Use lesserphp instead of lessphp
## 1.2.0 - 2020-03-23
### Added
* Ability to chooses QR code colors
### Changed
* The software is now named LibreQR
* Parameters now uses GET instead of POST
* The OpenSearch plugin now generate QR codes with arguments used when added
## 1.1.0 - 2019-03-29
### Added
* OpenSearch
* WebManifest
### Changed
* Server-side LESS compilation
* Icons are now themed and in multiple dimensions
### Fixed
* Placeholder font
## 1.0.0 - 2019-02-13
Initial release

View File

@ -59,8 +59,7 @@ Par défaut, trois thèmes sont proposés :
php themes/resize.php [nom de votre thème]
```
Cela nécessitera d'avoir installé [ImageMagick](https://imagemagick.org) et
[pngquant](https://pngquant.org).
Cela nécessitera d'avoir installé [ImageMagick](https://imagemagick.org) et [pngquant](https://pngquant.org).
## Contribuer
@ -80,7 +79,7 @@ Ce code source inclus :
* [phpqrcode](https://github.com/t0k4rt/phpqrcode) pour générer les codes QR
* [La police Ubuntu packagée pour le Web](https://github.com/earaujoassis/ubuntu-fontface)
* [lessphp](http://leafo.net/lessphp) pour compiler le [Less](http://lesscss.org)
* [lesserphp](https://github.com/MarcusSchwarz/lesserphp) pour compiler le [Less](http://lesscss.org)
## Licence

View File

@ -1,47 +1,22 @@
<?php
// ----- Settings -----
// ----- Paramètres -----
deleteOldQR(60 * 60 * 24 * 7); // Temps en secondes après lequel le code QR sera supprimé lors du chargement d'un page
// EN: Time in seconds after which the QR code will be deleted when a page loads.
// Default: 60 * 60 * 24 * 7 (one week)
// FR : Temps en secondes après lequel le code QR sera supprimé lors du chargement d'un page.
// Par défaut : 60 * 60 * 24 * 7 (une semaine)
deleteOldQR(60 * 60 * 24 * 7);
$theme = "dark"; // dark, light ou parinux
// EN: Theme's name (must be in the themes directory)
// FR : Nom du thème (doit être dans le dossier themes)
$theme = "dark";
// EN: Language used if those wanted by the user are not available
// FR : Langue utilisée si celles demandées par l'utilisateurice ne sont pas disponibles
$locale = "fr"; // fr ou en
$fileNameLenght = 32; // Longueur du nom du fichier du code QR
// ----- Trucs nécessaires partout -----
// Définit l'URL racine
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
$protocol = "https";
else
$protocol = "http";
$instPath = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$instPath = preg_replace('#\?.*$#', '', $instPath);
$instPath = preg_replace('#(manifest|opensearch|index).php$#i', '', $instPath);
require "themes/" . $theme . "/theme.php"; // Charge le thème graphique
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
function deleteOldQR($tempsDeSuppression) {
/*
Cette fonction supprime les fichiers (normalement des images de codes QR)
dans temp/ plus vieux que le temps en seconde passé en argument
*/
$listeCodesQR = new DirectoryIterator("temp");
foreach($listeCodesQR as $listeCodesQR) {
if ($listeCodesQR->getFilename() != "." AND $listeCodesQR->getFilename() != ".." AND $listeCodesQR->getFilename() != ".gitkeep") {
if ((time() - filemtime("temp/" . $listeCodesQR->getFilename())) > $tempsDeSuppression) { // Si le temps actuel (en heure Posix) moins la date de dernière modification de l'image est supérieur à la durée de vie demandée de l'image
unlink("temp/" . $listeCodesQR->getFilename()); // Alors supprimer cette image
}
}
}
}
//$additionalText = "This LibreQR instance is hosted by <a href='https://foo.bar'>foo</a>.";

48
inc.php Normal file
View File

@ -0,0 +1,48 @@
<?php // ----- This file is included everywhere -----
require "config.inc.php";
// Defines locale used
$clientLocales = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$clientLocales = preg_replace("#[A-Z0-9]|q=|;|-|\.#", "", $clientLocales);
$clientLocales = explode(',', $clientLocales);
$availableLocales = array('fr', 'en', 'template');
foreach ($clientLocales as $clientLocale) {
if (in_array($clientLocale, $availableLocales)) {
$locale = $clientLocale;
break;
}
}
require "locales/" . $locale . ".php";
// Defines root URL
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
$protocol = "https";
else
$protocol = "http";
$instPath = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$instPath = preg_replace('#\?.*$#', '', $instPath);
$instPath = preg_replace('#(manifest|opensearch|index).php$#i', '', $instPath);
require "themes/" . $theme . "/theme.php"; // Load theme
function generateRandomString($length) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
// Deletes images in temp/ older than the specified time in seconds
function deleteOldQR($deleteAfter) {
$files = array_diff(scandir("temp"), array('..', '.', '.gitkeep'));
foreach($files as $file) {
// If this actual time (in Posix time) less last modification image date is greater than time asked
if ((time() - filemtime("temp/" . $file)) > $deleteAfter) {
unlink("temp/" . $file); // Deletes this image
}
}
}

View File

@ -1,4 +1,4 @@
<?php require "config.inc.php"; ?>
<?php require "inc.php"; ?>
<!--
_ _ _ ___ ____
| | (_| |__ _ __ ___ / _ \| _ \
@ -95,15 +95,15 @@ if (badQuery()) {
?>
<!DOCTYPE html>
<html lang="fr">
<html lang="<?= $locale ?>">
<head>
<meta charset="UTF-8">
<title>Générateur de codes QR</title>
<meta name="description" content="Générez des codes QR librement. Choisissez le contenu, la taille, la couleur...">
<title>LibreQR · <?= $loc['subtitle'] ?></title>
<meta name="description" content="<?= $loc['description'] ?>">
<meta name="theme-color" content="<?php echo $variablesTheme['bg']; ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="manifest.php">
<link rel="search" type="application/opensearchdescription+xml" title="Générer un code QR" href="opensearch.php&#63;redondancy=<?= $_GET['redondancy'] ?>&amp;margin=<?= $_GET['margin'] ?>&amp;size=<?= $_GET['size'] ?>&amp;bgColor=<?= urlencode($_GET['bgColor']) ?>&amp;mainColor=<?= urlencode($_GET['mainColor']) ?>">
<link rel="search" type="application/opensearchdescription+xml" title="<?= $loc['opensearch_actionName'] ?>" href="opensearch.php&#63;redondancy=<?= $_GET['redondancy'] ?>&amp;margin=<?= $_GET['margin'] ?>&amp;size=<?= $_GET['size'] ?>&amp;bgColor=<?= urlencode($_GET['bgColor']) ?>&amp;mainColor=<?= urlencode($_GET['mainColor']) ?>">
<?php
// If style.min.css exists
if (file_exists("style.min.css"))
@ -112,17 +112,17 @@ if (badQuery()) {
// Then delete it
unlink("style.min.css");
require "lessphp/lessc.inc.php";
require "lesserphp/lessc.inc.php";
$less = new lessc;
$less->setVariables($variablesTheme); // Rends ces couleurs utilisables dans style.less
$less->setVariables($variablesTheme); // Make these colors available in style.less
$less->setFormatter("compressed");
$less->checkedCompile("style.less", "style.min.css"); // Compile, minimise et met en cache style.less dans style.min.css
$less->checkedCompile("style.less", "style.min.css"); // Compile, minimise and cache style.less into style.min.css
?>
<link type="text/css" rel="stylesheet" href="style.min.css">
<link type="text/css" rel="stylesheet" href="ubuntu/ubuntu.min.css">
<?php
foreach($themeDimensionsIcons as $dimFav) { // Indique toutes les dimensions d'icones
foreach($themeDimensionsIcons as $dimFav) { // Set all icons dimensions
echo ' <link rel="icon" type="image/png" href="themes/' . $theme . '/icons/' . $dimFav . '.png" sizes="' . $dimFav . 'x' . $dimFav . '">' . "\n";
} ?>
@ -130,14 +130,14 @@ if (badQuery()) {
<body>
<div class="center">
<main>
<header>
<a id="lienTitres" href="./">
<img id="logo" src="themes/<?php echo $theme; ?>/icons/128.png" alt="Code QR stylisé">
<img id="logo" src="themes/<?php echo $theme; ?>/icons/128.png">
<div id="titres">
<h1>LibreQR</h1>
<h2>Générateur de codes QR</h2>
<h2><?= $loc['subtitle'] ?></h2>
</div>
</a>
</header>
@ -147,24 +147,15 @@ if (badQuery()) {
<div id="firstWrapper">
<div class="param">
<label for="txt">Texte à encoder</label>
<label for="txt"><?= $loc['label_content'] ?></label>
<span class="conteneurAide">
<span class="boutonAide" tabindex="0"><img id="helpImg" src="help.svg.php?clr=<?= urlencode($variablesTheme["text"]) ?>" alt="Aide"></span>
<span class="contenuAide">
Vous pouvez encoder ce que vous voulez sous forme de texte.<br>
Les logiciels qui décodent ces codes QR pourraient proposer de les ouvrir avec un logiciel dédié, en fonction de leur <a href="https://fr.wikipedia.org/wiki/Sch%C3%A9ma_d%27URI">schéma d'URI</a>.<br><br>
Par exemple, pour ouvrir une page Web :<br>
https://www.domaine.tld/<br><br>
Pour envoyer un mail :<br>
mailto:contact@domaine.tld<br><br>
Pour partager des coordonnées géographique :<br>
geo:48.867564,2.364057<br><br>
Pour appeler un numéro de téléphone :<br>
tel:0639981871
<?= $loc['help_content'] ?>
</span>
</span>
<br>
<textarea rows="8" required="" id="txt" placeholder="Entrez le texte à encoder dans le code QR" name="txt"><?php
<textarea rows="8" required="" id="txt" placeholder="<?= $loc['placeholder'] ?>" name="txt"><?php
if (isset($_GET['txt'])) {
echo htmlspecialchars($_GET['txt']);
@ -176,31 +167,31 @@ if (badQuery()) {
<div id="menusDeroulants">
<div class="param">
<label for="redondancy">Taux de redondance</label>
<label for="redondancy"><?= $loc['label_redondancy'] ?></label>
<span class="conteneurAide">
<span class="boutonAide" tabindex="0"><img id="helpImg" src="help.svg.php?clr=<?= urlencode($variablesTheme["text"]) ?>" alt="Aide"></span>
<span class="contenuAide">La redondance est le "doublement" des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.</span>
<span class="contenuAide"><?= $loc['help_redondancy'] ?></span>
</span>
<br>
<select id="redondancy" name="redondancy">
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "L")) {echo 'selected="" ';} ?>value="L">L - 7% de redondance</option>
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "M")) {echo 'selected="" ';} ?>value="M">M - 15% de redondance</option>
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "Q")) {echo 'selected="" ';} ?>value="Q">Q - 25% de redondance</option>
<option <?php if ((isset($_GET['redondancy']) AND ($_GET['redondancy'] == "H")) OR (!isset($_GET['redondancy']) OR empty($_GET['redondancy']))) {echo 'selected="" ';} ?>value="H">H - 30% de redondance</option>
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "L")) {echo 'selected="" ';} ?>value="L">L - 7%</option>
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "M")) {echo 'selected="" ';} ?>value="M">M - 15%</option>
<option <?php if (isset($_GET['redondancy']) AND ($_GET['redondancy'] == "Q")) {echo 'selected="" ';} ?>value="Q">Q - 25%</option>
<option <?php if ((isset($_GET['redondancy']) AND ($_GET['redondancy'] == "H")) OR (!isset($_GET['redondancy']) OR empty($_GET['redondancy']))) {echo 'selected="" ';} ?>value="H">H - 30%</option>
</select>
</div>
<div class="param">
<label for="margin">Taille de la marge</label>
<label for="margin"><?= $loc['label_margin'] ?></label>
<span class="conteneurAide">
<span class="boutonAide" tabindex="0"><img id="helpImg" src="help.svg.php?clr=<?= urlencode($variablesTheme["text"]) ?>" alt="Aide"></span>
<span class="contenuAide">Nombre de pixels des bandes blanches autour du code QR.</span>
<span class="contenuAide"><?= $loc['help_margin'] ?></span>
</span>
<br>
<select id="margin" name="margin">
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "0")) {echo 'selected="" ';} ?>value="0">0</option>
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "1")) {echo 'selected="" ';} ?>value="1">1</option>
<option <?php if ((isset($_GET['margin']) AND ($_GET['margin'] == "2")) OR (!isset($_GET['margin']) OR empty($_GET['margin']))) {echo 'selected="" ';} ?>value="2">2 - par défaut</option>
<option <?php if ((isset($_GET['margin']) AND ($_GET['margin'] == "2")) OR (!isset($_GET['margin']) OR empty($_GET['margin']))) {echo 'selected="" ';} ?>value="2">2 - <?= $loc['value_default'] ?></option>
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "3")) {echo 'selected="" ';} ?>value="3">3</option>
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "4")) {echo 'selected="" ';} ?>value="4">4</option>
<option <?php if (isset($_GET['margin']) AND ($_GET['margin'] == "5")) {echo 'selected="" ';} ?>value="5">5</option>
@ -210,17 +201,17 @@ if (badQuery()) {
</div>
<div class="param">
<label for="size">Taille de l'image</label>
<label for="size"><?= $loc['label_size'] ?></label>
<span class="conteneurAide">
<span class="boutonAide" tabindex="0"><img id="helpImg" src="help.svg.php?clr=<?= urlencode($variablesTheme["text"]) ?>" alt="Aide"></span>
<span class="contenuAide">Par combien les dimensions de l'image seront-elles multipliées ?</span>
<span class="contenuAide"><?= $loc['help_size'] ?></span>
</span>
<br>
<select id="size" name="size">
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 1)) {echo 'selected="" ';} ?>value="1">1</option>
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 2)) {echo 'selected="" ';} ?>value="2">2</option>
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 3)) {echo 'selected="" ';} ?>value="3">3</option>
<option <?php if ((isset($_GET['size']) AND ($_GET['size'] == 4)) OR (!isset($_GET['size']) OR empty($_GET['size']))) {echo 'selected="" ';} ?>value="4">4 - par défaut</option>
<option <?php if ((isset($_GET['size']) AND ($_GET['size'] == 4)) OR (!isset($_GET['size']) OR empty($_GET['size']))) {echo 'selected="" ';} ?>value="4">4 - <?= $loc['value_default'] ?></option>
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 5)) {echo 'selected="" ';} ?>value="5">5</option>
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 6)) {echo 'selected="" ';} ?>value="6">6</option>
<option <?php if (isset($_GET['size']) AND ($_GET['size'] == 8)) {echo 'selected="" ';} ?>value="8">8</option>
@ -237,22 +228,22 @@ if (badQuery()) {
<div id="colors">
<div class="param">
<label for="bgColor">Couleur de fond</label>
<label for="bgColor"><?= $loc['label_bgColor'] ?></label>
<div class="conteneurInputColor">
<input type="color" name="bgColor" id="bgColor" value="<?php if (!empty($_GET['bgColor'])) {echo htmlspecialchars($_GET['bgColor']);} else {echo "#FFFFFF";} ?>">
</div>
</div>
<div class="param">
<label for="mainColor">Couleur de premier plan</label>
<label for="mainColor"><?= $loc['label_mainColor'] ?></label>
<div class="conteneurInputColor">
<input type="color" name="mainColor" id="mainColor" value="<?php if (!empty($_GET['mainColor'])) {echo htmlspecialchars($_GET['mainColor']);} else {echo "#000000";} ?>">
</div>
</div>
</div>
<div class="centrer">
<input class="bouton" type="submit" value="Générer" />
<div class="centered">
<input class="bouton" type="submit" value="<?= $loc['button_create'] ?>" />
</div>
</form>
@ -267,31 +258,36 @@ if (badQuery()) {
$cheminImage = "temp/" . generateRandomString($fileNameLenght) . ".png";
QRcode::png($_GET['txt'], $cheminImage, $_GET['redondancy'], $_GET['size'], $_GET['margin'], false, hexdec($_GET['bgColor']), hexdec($_GET['mainColor']));
?>
<div class="centrer">
<a href="<?php echo $cheminImage; ?>" class="bouton" download="<?php echo htmlspecialchars($_GET['txt']); ?>.png">Télécharger ce code QR</a>
<div class="centered">
<a href="<?php echo $cheminImage; ?>" class="bouton" download="<?php echo htmlspecialchars($_GET['txt']); ?>.png"><?= $loc['button_download'] ?></a>
</div>
<div class="centrer" id="showOnlyQR">
<a title="Cliquez pour afficher uniquement ce code QR" href="<?php echo $cheminImage; ?>"><img alt='Un code QR contenant "<?php echo htmlspecialchars($_GET['txt']); ?>"' id="qrCode" src="<?php echo $cheminImage; ?>"/></a>
<div class="centered" id="showOnlyQR">
<a title="<?= $loc['title_showOnlyQR'] ?>" href="<?php echo $cheminImage; ?>"><img alt='Un code QR contenant "<?php echo htmlspecialchars($_GET['txt']); ?>"' id="qrCode" src="<?php echo $cheminImage; ?>"/></a>
</div>
<?php
}
}
?>
</div>
</main>
<div id="metaTexts">
<section id="info" class="metaText">
<h3>Qu'est-ce qu'un code QR ?</h3>
Un code QR est un code-barres en 2 dimensions dans lequel est inscrit en binaire du texte. Il peut être décodé avec un appareil muni d'un capteur photo et d'un logiciel adéquat.
<a href="https://fr.wikipedia.org/wiki/Code_QR">Code QR sur Wikipédia</a>
<?= $loc['metaText_qr'] ?>
</section>
<footer class="metaText">
LibreQR 1.2.0 est un logiciel libre dont le <a href="https://code.antopie.org/miraty/libreqr/">code source</a> est disponible
selon les termes de l'<abbr title="GNU Affero General Public License version 3 ou toute version ultérieure"><a href="LICENSE.html">AGPLv3</a>+</abbr>.
<p>
<?= $loc['metaText_legal'] ?>
</p>
<?php if (isset($additionalText)) { ?>
<br>
<p>
<?= $additionalText ?>
</p>
<?php } ?>
</footer>
</div>

5
lessphp/LICENSE → lesserphp/LICENSE Executable file → Normal file
View File

@ -1,4 +1,4 @@
For ease of distribution, lessphp is under a dual license.
For ease of distribution, lessphp 0.5.1 is under a dual license.
You are free to pick which one suits your needs.
@ -9,7 +9,8 @@ MIT LICENSE
Copyright (c) 2014 Leaf Corcoran, http://leafo.net/lessphp
Copyright (c) 2013 - 2015 Leaf Corcoran, http://leafo.net/lessphp
Copyright (c) 2016 - Marcus Schwarz, https://www.maswaba.de
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

13
lessphp/README.md → lesserphp/README.md Executable file → Normal file
View File

@ -1,9 +1,10 @@
[![Build Status](https://travis-ci.org/leafo/lessphp.svg?branch=master)](https://travis-ci.org/leafo/lessphp)
[![Build Status](https://travis-ci.org/MarcusSchwarz/lesserphp.svg)](https://travis-ci.org/MarcusSchwarz/lesserphp)
# lessphp v0.5.0
### <http://leafo.net/lessphp>
# lesserphp v0.5.4
### <http://github.com/MarcusSchwarz/lesserphp>
`lessphp` is a compiler for LESS written in PHP. The documentation is great,
`lesserphp` is a compiler for LESS written in PHP. It is based on lessphp bei leafo.
The documentation is great,
so check it out: <http://leafo.net/lessphp/docs/>.
Here's a quick tutorial:
@ -12,7 +13,7 @@ Here's a quick tutorial:
The only file required is `lessc.inc.php`, so copy that to your include directory.
The typical flow of **lessphp** is to create a new instance of `lessc`,
The typical flow of **lesserphp** is to create a new instance of `lessc`,
configure it how you like, then tell it to compile something using one built in
compile methods.
@ -48,7 +49,7 @@ If there any problem compiling your code, an exception is thrown with a helpful
<?php
try {
$less->compile("invalid LESS } {");
} catch (exception $e) {
} catch (\Exception $e) {
echo "fatal error: " . $e->getMessage();
}
```

1400
lesserphp/docs/docs.md Normal file

File diff suppressed because it is too large Load Diff

4019
lesserphp/lessc.inc.php Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

47
locales/en.php Normal file
View File

@ -0,0 +1,47 @@
<?php
$loc = array(
'subtitle' => "QR codes generator",
'description' => "Generate QR codes freely. Choose content, size, colors...",
'label_content' => "Text to encode",
'label_redondancy' => "Redondancy rate",
'label_margin' => "Margin size",
'label_size' => "Image size",
'label_bgColor' => "Background color",
'label_mainColor' => "Foreground color",
'placeholder' => "Enter the text to encode in the QR code",
'value_default' => "default",
'help_content' => "
You can encode what you want as text.<br>
Softwares which decodes these QR codes could suggest to open them with dedicated software, depending on their <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes'>URI scheme</a>.<br><br>
For instance, to open a webpage:<br>
https://www.domain.tld/<br><br>
To send an email:<br>
mailto:contact@domain.tld<br><br>
To share geographic coordinates:<br>
geo:48.867564,2.364057<br><br>
To call a phone number:<br>
tel:+33639981871
",
'help_redondancy' => "Redundancy is the duplication of information in the QR code to correct errors during decoding. A higher rate will produce a bigger QR code, but will have a better chance of being decoded correctly.",
'help_margin' => "Number of pixels in the white bands around the QR code.",
'help_size' => "By how much will the dimensions of the image be multiplied?",
'button_create' => "Generate",
'button_download' => "Download this QR code",
'title_showOnlyQR' => "Show only this QR code",
'metaText_qr' => "
<h3>What's a QR code ?</h3>
A QR code is a 2 dimensions barcode in which is written in binary text. It can be decoded with a device equipped with a photo sensor and an adequate software.
<a href='https://en.wikipedia.org/wiki/QR_code'>QR code on Wikipedia</a>
",
'metaText_legal' => "LibreQR 1.2.0 is a free software whose <a href='https://code.antopie.org/miraty/libreqr/''>source code</a> is available under the terms of the <abbr title='GNU Affero General Public License version 3 ou toute version ultérieure'><a href='LICENSE.html'>AGPLv3</a>+</abbr>.",
'opensearch_description' => "Generate QR codes from your search or address bar",
'opensearch_actionName' => "Generate QR codes from your search or address bar",
);

47
locales/fr.php Normal file
View File

@ -0,0 +1,47 @@
<?php
$loc = array(
'subtitle' => "Générateur de codes QR",
'description' => "Générez des codes QR librement. Choisissez le contenu, la taille, les couleurs...",
'label_content' => "Texte à encoder",
'label_redondancy' => "Taux de redondance",
'label_margin' => "Taille de la marge",
'label_size' => "Taille de l'image",
'label_bgColor' => "Couleur de fond",
'label_mainColor' => "Couleur de premier plan",
'placeholder' => "Entrez le texte à encoder dans le code QR",
'value_default' => "par défaut",
'help_content' => "
Vous pouvez encoder ce que vous voulez sous forme de texte.<br>
Les logiciels qui décodent ces codes QR pourraient proposer de les ouvrir avec un logiciel dédié, en fonction de leur <a href='https://fr.wikipedia.org/wiki/Sch%C3%A9ma_d%27URI'>schéma d'URI</a>.<br><br>
Par exemple, pour ouvrir une page Web :<br>
https://www.domaine.tld/<br><br>
Pour envoyer un mail :<br>
mailto:contact@domaine.tld<br><br>
Pour partager des coordonnées géographique :<br>
geo:48.867564,2.364057<br><br>
Pour appeler un numéro de téléphone :<br>
tel:+33639981871
",
'help_redondancy' => "La redondance est la duplication des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.",
'help_margin' => "Nombre de pixels des bandes blanches autour du code QR.",
'help_size' => "Par combien les dimensions de l'image seront-elles multipliées ?",
'button_create' => "Générer",
'button_download' => "Télécharger ce code QR",
'title_showOnlyQR' => "Afficher uniquement ce code QR",
'metaText_qr' => "
<h3>Qu'est-ce qu'un code QR ?</h3>
Un code QR est un code-barres en 2 dimensions dans lequel est inscrit en binaire du texte. Il peut être décodé avec un appareil muni d'un capteur photo et d'un logiciel adéquat.
<a href='https://fr.wikipedia.org/wiki/Code_QR'>Code QR sur Wikipédia</a>
",
'metaText_legal' => "LibreQR 1.2.0 est un logiciel libre dont le <a href='https://code.antopie.org/miraty/libreqr/''>code source</a> est disponible selon les termes de l'<abbr title='GNU Affero General Public License version 3 ou toute version ultérieure'><a href='LICENSE.html'>AGPLv3</a>+</abbr>.",
'opensearch_description' => "Générez des codes QR depuis votre barre de recherche ou d'adresse",
'opensearch_actionName' => "Generate QR codes from your search or address bar",
);

27
locales/template.php Normal file
View File

@ -0,0 +1,27 @@
<?php
$loc = array(
'subtitle' => "subtitle",
'label_content' => "label_content",
'label_redondancy' => "label_redondancy",
'label_margin' => "label_margin",
'label_size' => "label_size",
'label_bgColor' => "label_bgColor",
'label_mainColor' => "label_mainColor",
'placeholder' => "placeholder",
'value_default' => "value_default",
'help_content' => "help_content",
'help_redondancy' => "help_redondancy",
'help_margin' => "help_margin",
'help_size' => "help_size",
'button_create' => "button_create",
'button_download' => "button_download",
'title_showOnlyQR' => "title_showOnlyQR",
'metaText_qr' => "metaText_qr",
'metaText_legal' => "metaText_legal",
);

View File

@ -1,28 +1,28 @@
<?php require "config.inc.php"; ?>
<?php require "inc.php"; ?>
{
"dir": "ltr",
"lang": "fr",
"lang": "<?= $locale ?>",
"name": "LibreQR",
"short_name": "LibreQR",
"description": "Générer un code QR",
"start_url": "<?php echo $instPath; ?>",
"scope": "<?php echo $instPath; ?>",
"description": "<?= $loc['subtitle'] ?>",
"start_url": "<?= $instPath; ?>",
"scope": "<?= $instPath; ?>",
"display": "standalone",
"theme_color": "<?php echo $variablesTheme["bg"]; ?>",
"background_color": "<?php echo $variablesTheme["bg"]; ?>",
"orientation": "portrait",
"theme_color": "<?= $variablesTheme["bg"]; ?>",
"background_color": "<?= $variablesTheme["bg"]; ?>",
"orientation": "portrait",
"icons":
[
<?php for ($i = 0; $i < (count($themeDimensionsIcons) - 1); $i++) { ?>
{
"src": "themes/<?php echo $theme; ?>/icons/<?php echo $themeDimensionsIcons[$i]; ?>.png",
"sizes": "<?php echo $themeDimensionsIcons[$i]; ?>x<?php echo $themeDimensionsIcons[$i]; ?>",
"src": "themes/<?= $theme; ?>/icons/<?= $themeDimensionsIcons[$i]; ?>.png",
"sizes": "<?= $themeDimensionsIcons[$i]; ?>x<?= $themeDimensionsIcons[$i]; ?>",
"type": "image/png"
},
<?php } ?>
{
"src": "themes/<?php echo $theme; ?>/icons/<?php echo $themeDimensionsIcons[$i]; ?>.png",
"sizes": "<?php echo $themeDimensionsIcons[$i]; ?>x<?php echo $themeDimensionsIcons[$i]; ?>",
"src": "themes/<?= $theme; ?>/icons/<?= $themeDimensionsIcons[$i]; ?>.png",
"sizes": "<?= $themeDimensionsIcons[$i]; ?>x<?= $themeDimensionsIcons[$i]; ?>",
"type": "image/png"
}
]

View File

@ -1,8 +1,8 @@
<?php require "config.inc.php"; ?>
<?php require "inc.php"; ?>
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Générer un code QR</ShortName>
<Description>Générez des codes QR depuis votre barre de recherche ou d'adresse</Description>
<ShortName>LibreQR</ShortName>
<Description><?= $loc['opensearch_actionName'] ?></Description>
<?php
foreach($themeDimensionsIcons as $dimIcon) {
echo ' <Image height="' . $dimIcon . '" width="' . $dimIcon . '" type="image/png">' . $instPath . 'themes/' . $theme . '/icons/' . $dimIcon . '.png</Image>' . "\n";

View File

@ -33,6 +33,10 @@ a {
}
}
p {
margin: 0px;
}
#firstWrapper {
display: flex;
flex-direction: row;
@ -47,7 +51,7 @@ a {
max-width: 480px;
}
.centrer {
.centered {
text-align: center;
}
@ -61,7 +65,7 @@ form {
margin-bottom: 30px;
}
.center {
main {
display: flex;
flex-direction: column;
justify-content: center;
@ -360,7 +364,7 @@ input[type=color] {
margin-right: auto;
}
.center {
main {
width: auto;
}

2
style.min.css vendored
View File

@ -1 +1 @@
*{font-family:"Ubuntu", sans-serif;scrollbar-color:white #2a2a2a;scrollbar-width:auto;}a{color:white;text-decoration:underline;}a:hover{text-decoration:none;}#firstWrapper{display:flex;flex-direction:row;}#menusDeroulants{text-align:center;margin-left:20px;}#qrCode{max-width:480px;}.centrer{text-align:center;}.bouton{padding:3px 10px 3px 10px;text-decoration:none;}form{display:block;margin-bottom:30px;}.center{display:flex;flex-direction:column;justify-content:center;margin-left:auto;margin-right:auto;width:814px;}body{margin:18px;background-color:#2a2a2a;color:white;font-weight:normal;font-size:20px;}body h1{color:white;text-decoration:none;}label{font-size:20px;}header{text-align:center;padding:0px;margin:0px;height:64px;}#logo{width:64px;height:64px;}#titres{margin-left:20px;}h1,h2,h3,h4,h5,h6{margin:0px;font-weight:normal;}h1{font-size:33px;}h2{font-size:22px;}#lienTitres{text-align:left;justify-content:center;text-decoration:none;display:flex;flex-direction:row;}#showOnlyQR{margin-top:30px;}#titre{text-align:center;justify-content:center;}.param{padding:10px;padding-left:0px;margin-left:0px;padding-right:0px;margin-right:0px;}.conteneurInputColor{display:flex;flex-direction:row;justify-content:center;}::selection{color:#2a2a2a;background-color:white;}label[for=txt]{padding-left:22px;}#colors{display:flex;flex-direction:row;justify-content:space-between;text-align:center;}#colors .param{text-align:center;display:flex;justify-content:center;flex-direction:column;width:100%;}.metaText{color:#868686;text-align:left;transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);position:fixed;width:400px;}.metaText a:link{transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);color:#868686;text-decoration:underline;}.metaText:hover,.metaText:hover a:link{color:white;}footer{font-size:14px;bottom:20px;left:20px;}#info{font-size:16px;bottom:20px;right:20px;margin:0px;}#info h3{font-size:20px;font-weight:normal;padding-bottom:10px;}#redondancy,#margin,#txt,#size,input[type=color],input[type=submit],.bouton{border:2px #5f5f5f solid;border-radius:10px;font-size:20px;padding-left:10px;font-weight:normal;color:white;transition:border 0.1s linear;background-color:#31363b;margin-top:8px;}#redondancy:hover,#margin:hover,#txt:hover,#size:hover,input[type=color]:hover,input[type=submit]:hover,.bouton:hover{border:2px #808080 solid;}#redondancy:focus,#margin:focus,#txt:focus,#size:focus,input[type=color]:focus,input[type=submit]:focus,.bouton:focus{border:2px white solid;outline:none;}#redondancy,#size,#margin{background-color:#31363b;width:250px;height:40px;}#txt{background-color:#232629;color:white;padding:10px;margin:10px;width:500px;scrollbar-color:white #232629;scrollbar-width:auto;}input[type=submit]{font-size:28px;padding:10px;padding-left:14px;padding-right:14px;}#txt::placeholder{color:#868686;opacity:1;font-family:"Ubuntu", sans-serif;font-weight:normal;font-size:1em;}input[type=color]{height:60px;width:84px;padding:5px;border:2px #5f5f5f solid;}#helpImg{width:20px;height:20px;margin-bottom:-3px;margin-left:5px;}.boutonAide{height:0px;width:0px;color:#868686;cursor:help;font-size:0.8em;}.conteneurAide .contenuAide{position:absolute;transform:scale(0) rotate(-12deg);color:white;background:#151616;padding:15px;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,0.5);margin-top:23px;margin-left:-35px;transition:all .25s;opacity:0;max-width:500px;font-size:20px;text-align:left;}@media (max-width: 500px){.conteneurAide .contenuAide{position:fixed;margin:5px;left:0px;top:0px;}}.conteneurAide:hover .contenuAide,.conteneurAide:focus-within .contenuAide{transform:scale(1) rotate(0);opacity:1;}@media (max-width: 1400px){.metaText{width:250px;}}@media (max-width: 1050px){#metaTexts{display:flex;flex-direction:row;}.metaText{width:100%;position:static;font-size:20px;}#info{color:white;margin-bottom:20px;padding-top:30px;font-size:20px;}#info a:link{color:white;}}@media (max-width: 850px){#metaTexts{flex-direction:column;width:480px;justify-content:center;margin-left:auto;margin-right:auto;}.center{width:auto;}#firstWrapper{flex-direction:column;}body{margin:10px;}#txt{width:92%;}}@media (max-width: 500px){#metaTexts{width:auto;}#colors{flex-direction:column;}h1{font-size:28px;padding-top:6px;}#txt{width:85%;}#qrCode{max-width:94%;}}@media (max-width: 415px){h1{padding:0px;}}
*{font-family:"Ubuntu", sans-serif;scrollbar-color:white #2a2a2a;scrollbar-width:auto;}a{color:white;text-decoration:underline;}a:hover{text-decoration:none;}p{margin:0px;}#firstWrapper{display:flex;flex-direction:row;}#menusDeroulants{text-align:center;margin-left:20px;}#qrCode{max-width:480px;}.centered{text-align:center;}.bouton{padding:3px 10px 3px 10px;text-decoration:none;}form{display:block;margin-bottom:30px;}main{display:flex;flex-direction:column;justify-content:center;margin-left:auto;margin-right:auto;width:814px;}body{margin:18px;background-color:#2a2a2a;color:white;font-weight:normal;font-size:20px;}body h1{color:white;text-decoration:none;}label{font-size:20px;}header{text-align:center;padding:0px;margin:0px;height:64px;}#logo{width:64px;height:64px;}#titres{margin-left:20px;}h1,h2,h3,h4,h5,h6{margin:0px;font-weight:normal;}h1{font-size:33px;}h2{font-size:22px;}#lienTitres{text-align:left;justify-content:center;text-decoration:none;display:flex;flex-direction:row;}#showOnlyQR{margin-top:30px;}#titre{text-align:center;justify-content:center;}.param{padding:10px;padding-left:0px;margin-left:0px;padding-right:0px;margin-right:0px;}.conteneurInputColor{display:flex;flex-direction:row;justify-content:center;}::selection{color:#2a2a2a;background-color:white;}label[for=txt]{padding-left:22px;}#colors{display:flex;flex-direction:row;justify-content:space-between;text-align:center;}#colors .param{text-align:center;display:flex;justify-content:center;flex-direction:column;width:100%;}.metaText{color:#868686;text-align:left;transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);position:fixed;width:400px;}.metaText a:link{transition:color 0.12s cubic-bezier(0.42,0.0,1.0,1.0);color:#868686;text-decoration:underline;}.metaText:hover,.metaText:hover a:link{color:white;}footer{font-size:14px;bottom:20px;left:20px;}#info{font-size:16px;bottom:20px;right:20px;margin:0px;}#info h3{font-size:20px;font-weight:normal;padding-bottom:10px;}#redondancy,#margin,#txt,#size,input[type=color],input[type=submit],.bouton{border:2px #5f5f5f solid;border-radius:10px;font-size:20px;padding-left:10px;font-weight:normal;color:white;transition:border 0.1s linear;background-color:#31363b;margin-top:8px;}#redondancy:hover,#margin:hover,#txt:hover,#size:hover,input[type=color]:hover,input[type=submit]:hover,.bouton:hover{border:2px #808080 solid;}#redondancy:focus,#margin:focus,#txt:focus,#size:focus,input[type=color]:focus,input[type=submit]:focus,.bouton:focus{border:2px white solid;outline:none;}#redondancy,#size,#margin{background-color:#31363b;width:250px;height:40px;}#txt{background-color:#232629;color:white;padding:10px;margin:10px;width:500px;scrollbar-color:white #232629;scrollbar-width:auto;}input[type=submit]{font-size:28px;padding:10px;padding-left:14px;padding-right:14px;}#txt::placeholder{color:#868686;opacity:1;font-family:"Ubuntu", sans-serif;font-weight:normal;font-size:1em;}input[type=color]{height:60px;width:84px;padding:5px;border:2px #5f5f5f solid;}#helpImg{width:20px;height:20px;margin-bottom:-3px;margin-left:5px;}.boutonAide{height:0px;width:0px;color:#868686;cursor:help;font-size:0.8em;}.conteneurAide .contenuAide{position:absolute;transform:scale(0) rotate(-12deg);color:white;background:#151616;padding:15px;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,0.5);margin-top:23px;margin-left:-35px;transition:all .25s;opacity:0;max-width:500px;font-size:20px;text-align:left;}@media (max-width: 500px){.conteneurAide .contenuAide{position:fixed;margin:5px;left:0px;top:0px;}}.conteneurAide:hover .contenuAide,.conteneurAide:focus-within .contenuAide{transform:scale(1) rotate(0);opacity:1;}@media (max-width: 1400px){.metaText{width:250px;}}@media (max-width: 1050px){#metaTexts{display:flex;flex-direction:row;}.metaText{width:100%;position:static;font-size:20px;}#info{color:white;margin-bottom:20px;padding-top:30px;font-size:20px;}#info a:link{color:white;}}@media (max-width: 850px){#metaTexts{flex-direction:column;width:480px;justify-content:center;margin-left:auto;margin-right:auto;}main{width:auto;}#firstWrapper{flex-direction:column;}body{margin:10px;}#txt{width:92%;}}@media (max-width: 500px){#metaTexts{width:auto;}#colors{flex-direction:column;}h1{font-size:28px;padding-top:6px;}#txt{width:85%;}#qrCode{max-width:94%;}}@media (max-width: 415px){h1{padding:0px;}}