Skip to content

Commit

Permalink
Add French translation
Browse files Browse the repository at this point in the history
  • Loading branch information
romaincazier committed Nov 29, 2021
1 parent 264b3b8 commit 9e2c913
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
23 changes: 14 additions & 9 deletions FieldtypeQRCode.module
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace ProcessWire;

/**
* Fieldtype generating a QR Code from the public URL of the page (and more)
* Fieldtype generating a QR code from the public URL of the page (and more)
*
* Copyright (c) 2021 Romain Cazier
* Licensed under MIT License, see LICENSE
Expand Down Expand Up @@ -40,8 +40,8 @@ class FieldtypeQRCode extends Fieldtype {
return [
"title" => "QR Code",
"author" => "Romain Cazier",
"version" => "1.0.8",
"summary" => "Generates a QR Code from the public URL of the page (and more)",
"version" => "1.0.9",
"summary" => "Generates a QR code from the public URL of the page (and more)",
"href" => "https://github.com/romaincazier/FieldtypeQRCode",
"icon" => "qrcode",
];
Expand Down Expand Up @@ -326,7 +326,12 @@ class FieldtypeQRCode extends Fieldtype {
if(!is_array($value)) {
return $value;
} elseif(!count($value)) {
return "<p>No QR code to output.<br>Please check your <a href=\"{$field->editUrl()}#fieldtypeConfig\" target=\"_blank\">source(s)</a>.</p>";
$out = "<p>";
$out .= $this->_("No QR code to output");
$out .= ".<br>";
$out .= sprintf($this->_('Please check your %1$ssource(s)%2$s'), "<a href=\"{$field->editUrl()}#fieldtypeConfig\" target=\"_blank\">", "</a>");
$out .= ".</p>";
return $out;
} else {
$out = "";
if(count($value) > 1) {
Expand Down Expand Up @@ -381,7 +386,7 @@ class FieldtypeQRCode extends Fieldtype {
$f = $this->modules->get("InputfieldRadios");
$f->attr("name", "format");
$f->columnWidth = 50;
$f->description = $this->_("Allows to select the image format of the QR Code.");
$f->description = $this->_("Allows to select the image format of the QR code");
$f->label = $this->_("Format");
$f->optionColumns = 1;
$f->value = $field->get("format");
Expand Down Expand Up @@ -417,9 +422,9 @@ class FieldtypeQRCode extends Fieldtype {
}

public function getInputfield(Page $page, Field $field) {
$url = $this->wire()->config->urls->{$this->className};
$this->wire()->config->styles->add("{$url}{$this->className}.css");
$this->wire()->config->scripts->add("{$url}{$this->className}.js");
$config = $this->wire()->config;
$config->styles->add($config->urls->{$this} . "{$this}.css");
$config->scripts->add($config->urls->{$this} . "{$this}.js");

/** @var InputfieldMarkup $inputfield */
$inputfield = $this->wire()->modules("InputfieldMarkup");
Expand Down Expand Up @@ -453,7 +458,7 @@ class FieldtypeQRCode extends Fieldtype {
}

public function getMatchQuery($query, $table, $subfield, $operator, $value) {
throw new WireException("Field '{$query->field->name}' is runtime and not queryable");
throw new WireException(sprintf($this->_('Field "%s" is runtime only and not queryable'), $query->field->name));
}

public function getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query) {
Expand Down
11 changes: 11 additions & 0 deletions languages/fr.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
en,fr,description,file,hash
"No QR code to output","Aucun QR code à afficher",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,7c275c4a6198b020579a8fa7a63d8d8f
"Please check your %1$ssource(s)%2$s","Merci de vérifier vos %1$ssources%2$s",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,3c0e5609b4d0c36bc8702ff1cbc0b1cc
"Allows to select the image format of the QR code","Permet de choisir le format d'image du QR code",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,e79bbedd9046977da6d8063ae9a4d53f
Format,=,,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,520d0db389f362bf79ef56ca0af3dcab
"Allows to render the SVG markup directly, instead of a base64 image","Si activé, le code SVG sera généré directement au lieu d'une image en base64",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,7cc1d5ae466fb637d16563c0f2d89632
"Render SVG Markup ?","Générer le code SVG ?",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,c1ccbe2dcb8b4358706afafca390a659
Yes,Oui,,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,93cba07454f06a4a960172bbd6e2a435
"Define which source(s) you want the QR code(s) to be generated from. You can either use ""httpUrl"" (""url"" will behave the same) and/or ""editUrl"" and/or the name of any text/URL/file/image field. You can also specify multiple sources by separating them with a comma. Default: ""httpUrl""","Définissez à partir de quelle(s) source(s) vous souhaitez générer le(s) QR code(s). Vous pouvez soit utiliser ""httpUrl"" (""url"" se comportera de la même manière) et/ou ""editUrl"" et/ou le nom de n'importe quel champ texte/URL/fichier/image. Vous pouvez également spécifier plusieurs sources en les séparant par une virgule. Par défaut: ""httpUrl""",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,5e420d217e62fdb4ea2a34565962cd00
"QR code source(s)","Source(s) de(s) QR code(s)",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,11f778cc26c0c11a32b831044ac03bc2
"Field ""%s"" is runtime only and not queryable","Le champ ""%s"" n'accepte pas de requête, étant hors de la base de données",,site/modules/FieldtypeQRCode/FieldtypeQRCode.module,737650f6c9cf4e52fef009fc61e316d4

0 comments on commit 9e2c913

Please sign in to comment.