From aeb0c481fd86f2084318fbd9a55db03a0fe5255d Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sat, 23 Dec 2017 12:27:04 +0100 Subject: [PATCH] Begin work on 0.9 compatibility --- QRcodes.php | 2 +- _define.php | 17 +- _routes.php | 137 +++++++++++++++ lang/Makefile | 92 +++++----- lang/en_US.po | 149 ----------------- lang/en_US/LC_MESSAGES/galette_admintools.mo | Bin 3849 -> 0 bytes lang/en_US/LC_MESSAGES/qrcodes.mo | Bin 0 -> 519 bytes lang/en_US/LC_MESSAGES/qrcodes_routes.mo | Bin 0 -> 503 bytes lang/fr_FR.utf8.po | 157 ------------------ .../LC_MESSAGES/galette_admintools.mo | Bin 4252 -> 0 bytes lang/fr_FR.utf8/LC_MESSAGES/qrcodes.mo | Bin 0 -> 530 bytes lang/fr_FR.utf8/LC_MESSAGES/qrcodes_routes.mo | Bin 0 -> 508 bytes lang/lang_english.php | 90 ---------- lang/lang_french.php | 114 ------------- lang/messages.po | 112 ------------- lang/qrcodes.pot | 16 ++ lang/qrcodes_en_US.php | 17 ++ lang/qrcodes_en_US.po | 28 ++++ lang/qrcodes_fr_FR.utf8.php | 17 ++ lang/qrcodes_fr_FR.utf8.po | 28 ++++ lang/qrcodes_routes.pot | 20 +++ lang/qrcodes_routes_en_US.php | 20 +++ lang/qrcodes_routes_en_US.po | 32 ++++ lang/qrcodes_routes_fr_FR.utf8.php | 20 +++ lang/qrcodes_routes_fr_FR.utf8.po | 32 ++++ lang/xgettext.py | 94 ++++++----- lib/GaletteQRCodes/Picture.php | 7 +- picture.php | 81 --------- templates/default/adh_fiche_action.tpl | 14 +- templates/default/headers.tpl | 4 +- templates/default/menu.tpl | 10 +- .../default => webroot}/galette_QRcodes.css | 0 .../default => webroot}/images/coucou.png | Bin .../default => webroot}/images/empty.png | Bin 34 files changed, 491 insertions(+), 819 deletions(-) create mode 100644 _routes.php delete mode 100644 lang/en_US.po delete mode 100644 lang/en_US/LC_MESSAGES/galette_admintools.mo create mode 100644 lang/en_US/LC_MESSAGES/qrcodes.mo create mode 100644 lang/en_US/LC_MESSAGES/qrcodes_routes.mo delete mode 100644 lang/fr_FR.utf8.po delete mode 100644 lang/fr_FR.utf8/LC_MESSAGES/galette_admintools.mo create mode 100644 lang/fr_FR.utf8/LC_MESSAGES/qrcodes.mo create mode 100644 lang/fr_FR.utf8/LC_MESSAGES/qrcodes_routes.mo delete mode 100644 lang/lang_english.php delete mode 100644 lang/lang_french.php delete mode 100644 lang/messages.po create mode 100644 lang/qrcodes.pot create mode 100644 lang/qrcodes_en_US.php create mode 100644 lang/qrcodes_en_US.po create mode 100644 lang/qrcodes_fr_FR.utf8.php create mode 100644 lang/qrcodes_fr_FR.utf8.po create mode 100644 lang/qrcodes_routes.pot create mode 100644 lang/qrcodes_routes_en_US.php create mode 100644 lang/qrcodes_routes_en_US.po create mode 100644 lang/qrcodes_routes_fr_FR.utf8.php create mode 100644 lang/qrcodes_routes_fr_FR.utf8.po mode change 100644 => 100755 lang/xgettext.py delete mode 100644 picture.php rename {templates/default => webroot}/galette_QRcodes.css (100%) rename {templates/default => webroot}/images/coucou.png (100%) rename {templates/default => webroot}/images/empty.png (100%) diff --git a/QRcodes.php b/QRcodes.php index 9530cd0..73a476c 100644 --- a/QRcodes.php +++ b/QRcodes.php @@ -141,7 +141,7 @@ $id_m = $member->id; //Créer QRcode PassagesDeGrades - if (!file_exists(PLUGIN_QRCODE_DATA_PATH . "$id_adh.png")){ + if (file_exists(PLUGIN_QRCODE_DATA_PATH . "$id_adh.png")){ unlink(PLUGIN_QRCODE_DATA_PATH . "$id_adh.png"); if (defined('PASSAGESDEGRADES_PREFIX')) { QRcode::png(PASSAGESDEGRADES_PREFIX . "PassagesDeGrades.php?id_adh=$id_adh", PLUGIN_QRCODE_DATA_PATH . "$id_adh.png", "L", 4, 4); diff --git a/_define.php b/_define.php index 57c9622..c7fc647 100644 --- a/_define.php +++ b/_define.php @@ -36,11 +36,14 @@ */ $this->register( - 'Galette QRCodes', //Name - 'Génération de QRcodes', //Short description - 'Frédéric LASSAVE', //Author - '1.2.1', //Version - '0.8.2.3', //Galette compatible version - '2017-03-29', //Release date - null //Permissions needed - not yet implemented + 'Galette QRCodes', //Name + 'Génération de QRcodes', //Short description + 'Frédéric LASSAVE', //Author + '1.3.0dev', //Version + '0.9', //Galette compatible version + 'qrcodes', //routing name and translation domain + '2017-12-23', //Release date + [ //Permissions needed + 'generate_qrcode_member' => 'groupmanager' //FIXME original code does not set access restrictions + ] ); diff --git a/_routes.php b/_routes.php new file mode 100644 index 0000000..92a98e7 --- /dev/null +++ b/_routes.php @@ -0,0 +1,137 @@ +. + * + * @category Plugins + * @package GaletteMaps + * + * @author Johan Cwiklinski + * @copyright 2016 The Galette Team + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version + * @version SVN: $Id$ + * @link http://galette.tuxfamily.org + * @since 0.9dev 2016-03-02 + */ + +use Galette\Entity\Adherent; + +//Constants and classes from plugin +require_once $module['root'] . '/_config.inc.php'; + +$this->get( + __('/member', 'qrcodes_routes') . __('/qrcode', 'qrcodes_routes') . '/{id:\d+}', + function ($request, $response, $args) use ($module, $module_id) { + $id = $args['id']; + include_once __DIR__ . '/includes/t0k4rt-phpqrcode-d213c48/qrlib.php'; + + $deps = array( + 'picture' => false, + 'groups' => false, + 'dues' => false, + 'parent' => true, + ); + $member = new Adherent($this->zdb, (int)$id, $deps); + + //generate phone QR code + $phone = $member->phone; + if (file_exists(PLUGIN_QRCODE_DATA_PATH . "$id.tel.png")) { + unlink(PLUGIN_QRCODE_DATA_PATH . "$id.tel.png"); + } + + //if member phone is missing but there is a parent, + //take the parent phone + if (empty($phone) && $member->hasParent()) { + $phone = $member->parent->phone; + } + + if (!empty($phone)) { + QRcode::png("tel:$phone", PLUGIN_QRCODE_DATA_PATH . "$id.tel.png", "L", 4, 4); + } + + //generate mail QR code + //Créer QRcode Mail + $email = $member->getEmail(); + if (file_exists(PLUGIN_QRCODE_DATA_PATH . "$id.mail.png")) { + unlink(PLUGIN_QRCODE_DATA_PATH . "$id.mail.png"); + } + + if (!empty($email)) { + QRcode::png("mailto:$email", PLUGIN_QRCODE_DATA_PATH . "$id.mail.png", "L", 4, 4); + } + + return $response + ->withStatus(301) + ->withHeader('Location', $this->router->pathFor('member', ['id' => $member->id])); + } +)->setName('generate_qrcode_member')->add($authenticate); + +$this->get( + __('/show', 'qrcodes_routes') . '/{type:' . __('phone', 'qrcodes_routes') . '|' + . __('email', 'qrcodes_routes') . '}/{id:\d+}', + function ($request, $response, $args) { + $id_adh = (int)$args['id']; + $deps = array( + 'picture' => false, + 'groups' => false, + 'dues' => false + ); + + //if loggedin user is a group manager, we have to check + //he manages a group requested member belongs to. + if ($this->login->isGroupManager() && $this->login->id != $id_adh) { + $deps['groups'] = true; + } + + $adh = new Galette\Entity\Adherent($this->zdb, $id_adh, $deps); + + $is_manager = false; + if (!$this->login->isAdmin() + && !$this->login->isStaff() + && $this->login->id != $id_adh + && $this->login->isGroupManager() + ) { + $groups = $adh->groups; + foreach ($groups as $group) { + if ($this->login->isGroupManager($group->getId())) { + $is_manager = true; + break; + } + } + } + + $picture = null; + if ($this->login->isAdmin() + || $this->login->isStaff() + || $adh->appearsInMembersList() + || $this->login->login == $adh->login + || $is_manager + ) { + $picture = new GaletteQRCodes\Picture($this->plugins, $id_adh, $args['type']); + } else { + $picture = new GaletteQRCodes\Picture(); + } + $picture->display(); + } +)->setName('show_qrcode'); diff --git a/lang/Makefile b/lang/Makefile index e9451bc..4f29011 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -1,68 +1,60 @@ -.SUFFIXES = .mo .po INSTALLDIR = . LANGUAGES = en_US fr_FR.utf8 -PACKAGE = galette_admintools +DOMAINS = qrcodes qrcodes_routes MKLANG = ../../../lang/make_lang_l12n.py PHP_SOURCES = $(shell find ../ -maxdepth 1 -name \*.php) \ + $(shell find ../lib/GaletteQRCodes/ -name \*.php) \ $(shell find ../templates -name \*.tpl) -all : messages.po lang - @echo "Génération des fichiers *.po :" +all : messages.po lang check + @echo "Generating PO files:" @for l in ${LANGUAGES}; do \ - echo -n " Mise à jour de $$l.po"; \ - msgmerge -U $$l.po messages.po >/dev/null ; \ - mkdir -p ${INSTALLDIR}/$$l/LC_MESSAGES; \ - echo " formatage de ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo."; \ - msgfmt $$l.po -o ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo.new; \ - if diff -qI 'PO-Revision-Date:.*' ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo.new ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo > /dev/null; then \ - echo " ${PACKAGE}.mo non mis à jour."; \ - rm ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo.new; \ - else \ - echo " ${PACKAGE}.mo mis à jour."; \ - mv ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo.new ${INSTALLDIR}/$$l/LC_MESSAGES/${PACKAGE}.mo; \ - fi; \ + for d in ${DOMAINS}; do \ + if [ -f $${d}_$${l}.po ]; then \ + echo -n " Updating $${d}_$${l}.po"; \ + msgmerge -U $${d}_$${l}.po $$d.pot >/dev/null ; \ + else \ + echo " Creating of $${d}_$${l}.po"; \ + msginit -o $${d}_$${l}.po -i $$d.pot >/dev/null ; \ + fi; \ + mkdir -p ${INSTALLDIR}/$${l}/LC_MESSAGES; \ + echo " formatting ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo."; \ + msgfmt $${d}_$${l}.po -o ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new; \ + if diff -qI 'PO-Revision-Date:.*' ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo > /dev/null; then \ + echo " $${d}.mo NOT updated."; \ + rm ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new; \ + else \ + echo " $${d}.mo UPDATED."; \ + mv ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo; \ + fi; \ + done \ done lang : - @echo "Génération des fichiers lang_*.php" - @echo " Mise à jour de lang_english.php" - @echo " extraction des chaines..." - @${MKLANG} en_US.po lang_english.php.new - @if diff -qI 'This file was automatically generated.*' lang_english.php lang_english.php.new > /dev/null; then \ - echo " lang_english.php non mis à jour."; \ - rm lang_english.php.new; \ - else \ - echo " lang_english.php mis à jour."; \ - mv lang_english.php.new lang_english.php; \ - fi; - - @echo " Mise à jour de lang_french.php" - @echo " extraction des chaines..." - @${MKLANG} fr_FR.utf8.po lang_french.php.new - @if diff -qI 'This file was automatically generated.*' lang_french.php lang_french.php.new > /dev/null; then \ - echo " lang_french.php non mis à jour."; \ - rm lang_french.php.new; \ - else \ - echo " lang_french.php mis à jour."; \ - mv lang_french.php.new lang_french.php; \ - fi; + @echo "Generating PHP lang files:" + @for l in ${LANGUAGES}; do \ + for d in ${DOMAINS}; do \ + echo " extracting $${d} $${l} strings..."; \ + if [ ! -f $${d}_$${l}.php ]; then \ + touch $${d}_$${l}.php; \ + fi; \ + ${MKLANG} $${d}_$${l}.po $${d}_$${l}.php.new $${d}; \ + if diff -qI 'This file was automatically generated.*' $${d}_$${l}.php $${d}_$${l}.php.new > /dev/null; then \ + echo " $${d}_$${l}.php NOT updated."; \ + rm $${d}_$${l}.php.new; \ + else \ + echo " $${d}_$${l}.php UPDATED."; \ + mv $${d}_$${l}.php.new $${d}_$${l}.php; \ + fi; \ + done \ + done messages.po : ${PHP_SOURCES} Makefile xgettext.py ./xgettext.py ${PHP_SOURCES} check: - @for FILE in ${PHP_SOURCES}; do \ - test -f $$FILE || echo "Not found $$FILE"; \ - done - @for NFILE in ../*.php ../includes/*.php \ - ../templates/default/*.tpl; do \ - for OFILE in ${PHP_SOURCES}; do \ - if [ "$$NFILE" = "$$OFILE" ]; then \ - unset NFILE; \ - break; \ - fi; \ - done; \ - test -z "$$NFILE" || echo "Missing $$NFILE"; \ + @for NFILE in ./*.php; do \ + php -l $$NFILE; \ done diff --git a/lang/en_US.po b/lang/en_US.po deleted file mode 100644 index d33f799..0000000 --- a/lang/en_US.po +++ /dev/null @@ -1,149 +0,0 @@ -# Header entry was created by Lokalize. -# -# , 2013. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"PO-Revision-Date: 2013-07-16 07:33+0200\n" -"Last-Translator: \n" -"Language-Team: French \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.5\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: ../admintools.php:87 -msgid "An error occured reinitializing fields configuration :(" -msgstr "An error occured reinitializing fields configuration :(" - -#: ../templates/default/admintools.tpl:36 -msgid "" -"You should use that function if you can see strange characters in your " -"datas; after a manual import, or if you've not used Galette's update scripts." -msgstr "" -"You should use that function if you can see strange characters in your " -"datas; after a manual import, or if you've not used Galette's update scripts." - -#: ../admintools.php:85 -msgid "Fields configuration has been successfully reinitialized." -msgstr "Fields configuration has been successfully reinitialized." - -#: ../admintools.php:65 -msgid "Database should have been successfully converted to UTF-8!" -msgstr "Database should have been successfully converted to UTF-8!" - -#: ../templates/default/admintools.tpl:6 -#: ../templates/default/admintools.tpl:30 -msgid "" -"Make sure you've done a backup of the database before using any of the " -"following tools!" -msgstr "" -"Make sure you've done a backup of the database before using any of the " -"following tools!" - -#: ../templates/default/menu.tpl:4 -msgid "Various administrative tools" -msgstr "Various administrative tools" - -#: ../templates/default/admintools.tpl:22 -msgid "Check PHP modules" -msgstr "Check PHP modules" - -#: ../templates/default/admintools.tpl:48 -msgid "Modules report" -msgstr "Modules report" - -#: ../templates/default/admintools.tpl:10 -msgid "Reinitialize emails contents" -msgstr "Reinitialize emails contents" - -#: ../templates/default/admintools.tpl:4 -msgid "Content tools" -msgstr "Content tools" - -#: ../admintools.php:75 -msgid "An error occured reinitializing texts :(" -msgstr "An error occured reinitializing texts :(" - -#: ../templates/default/admintools.tpl:35 -msgid "" -"Converts the whole database data to UTF-8, do not change anything on the " -"tables, just proceed data conversion." -msgstr "" -"Converts the whole database data to UTF-8, do not change anything on the " -"tables, just proceed data conversion." - -#: ../templates/default/admintools.tpl:28 -msgid "Database tools" -msgstr "Database tools" - -#: ../admintools.php:111 -msgid "Logins and passwords has been successfully filled (%i processed)." -msgstr "Logins and passwords has been successfully filled (%i processed)." - -#: ../templates/default/admintools.tpl:34 -msgid "That function is available for MySQL installations only!" -msgstr "That function is available for MySQL installations only!" - -#: ../templates/default/admintools.tpl:40 -msgid "Convert encoding" -msgstr "Convert encoding" - -#: ../admintools.php:122 -msgid "" -"Some PHP modules are missing. Please install them or contact your support." -"
More informations on required modules may be found in the documentation." -msgstr "" -"Some PHP modules are missing. Please install them or contact your support." -"
More informations on required modules may be found in the documentation." - -#: ../templates/default/admintools.tpl:17 -msgid "Generate values for empty logins and passwords" -msgstr "Generate values for empty logins and passwords" - -#: ../admintools.php:98 -msgid "An error occured reinitializing PDF models :(" -msgstr "An error occured reinitializing PDF models :(" - -#: ../templates/default/menu.tpl:4 -msgid "Admin tools" -msgstr "Admin tools" - -#: ../admintools.php:114 -msgid "An error occured filling empty logins and passwords :(" -msgstr "An error occured filling empty logins and passwords :(" - -#: ../admintools.php:149 -msgid "Administration tools" -msgstr "Administration tools" - -#: ../templates/default/admintools.tpl:12 -msgid "Reinitialize PDF models" -msgstr "Reinitialize PDF models" - -#: ../templates/default/menu.tpl:2 -msgid "Admin Tools" -msgstr "Admin Tools" - -#: ../templates/default/admintools.tpl:37 -msgid "" -"That conversion stuff will read your entire database, and write back each " -"non UTF-8 values after conversion; this may take a while." -msgstr "" -"That conversion stuff will read your entire database, and write back each " -"non UTF-8 values after conversion; this may take a while." - -#: ../admintools.php:73 -msgid "Texts has been successfully reinitialized." -msgstr "Texts has been successfully reinitialized." - -#: ../templates/default/admintools.tpl:11 -msgid "Reinitialize fields configuration" -msgstr "Reinitialize fields configuration" - -#: ../admintools.php:96 -msgid "PDF models has been successfully reinitialized." -msgstr "PDF models has been successfully reinitialized." - diff --git a/lang/en_US/LC_MESSAGES/galette_admintools.mo b/lang/en_US/LC_MESSAGES/galette_admintools.mo deleted file mode 100644 index f0c3f8423639d4021ff4e321ba55bbb2b5bde44c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3849 zcmeH|$!{D*6vhh(1cp7VVbik!*-6~vaUv3DoLE>+93t5;Btrt?fXdy~o{FohCSBEb zhEpU!+z?1?LPA_30XHtWazjG=1G#bIfW!^B^S$o2$2Latg_}z%{d%e8eQ&Ay^}xQ* z1lqIc&!F$SO^8F_A0W4nZx`ZT@ROQfgOB3ecid>_0Y z{2Y7;ya8J9CfEjF*eApT;5*<+(1K0yJ8%}f1zrXZ-dT;i3QpktI`{--($akKYTIy)fiybiL? zFG1FM6J(vYz{8-!=B)E8kaa$XMR@#WkaY$SGRv6odh3nHaATXf!42XObk_11`T=xq zPoZNg0oekf7LX$lLh&Fv+Y7V*)!_0nub!;`90VUnM~KP>*Ndmo5#qA3zr}2lX-i$_ zjIW==@LBti%b=a5`lBV4=PoA~$3?CZO0_ZCE|bdoVL-+$YwJncg!n z%sCsB4Yf+Vt*Shbvaw5GAOGeLo&U2T+G3C<8-C)f%>_N6@17`u^MdQ;p(P1v%a?PxxysWldFoBl(OWDI9A@L zg)xJAO27*1+m8&VR`HtO$yGh+cUWyxNL11k=af}&t)f+F3gsz9(EmHgVqvGq@4OMG z3~U~IQCA-DUL}W`Vo|Or=*txiTrmp4iL-DZEy;ML=#xuJ2X451Nx>pTg=g==&FceF zXN+6pkEI7j#9|d<%2nUxL2OF3oz2_khYQ0@Rh#luZ27J-sgb*gA!m`_`g5mr6&GEG z<%StZ5@Is#Sx%EWMsaGPmVz{fg=Yl+^ZGIl?4TU3>a(Ecsik~kW|4iNEnJe7iDQzi!pJVIHZKvDFZk%^0o3`UpJnxb3Q$gVuo?MdYMM%t1OMVitYqKlnn zQdx4B)U``6m4pBUW+cMRn5mngi}Mc>1b>6SkyWZ zO&+J#iT1H$M_NZ)t;T}%A?m_XZ)9*eW-h?$LN2SQt7O)u`5cE`k4~*5D$;+2|KL$ diff --git a/lang/en_US/LC_MESSAGES/qrcodes.mo b/lang/en_US/LC_MESSAGES/qrcodes.mo new file mode 100644 index 0000000000000000000000000000000000000000..633d3d974243eff1300450e10488e99e9ffec6bc GIT binary patch literal 519 zcmbu5y-ve06oms60oh<+V(<$%5G14!euUIksHhcfDTocZ%_Vi4+LdFVya7A_J1Zm4 zz|1Q!u`;rA94SJ~T>0~{Z;r38^RZTW@(_z)1JuA0$bgFnunr!dofm=}P%bH2!6su~iO*n}p1GCAvX2RfnL>vUPU_@gW( zMMhX{ytdIJ8d%;)_yvwitzzc4PkX#5i7l_8a*^X*x|PmRrkWzRyk~^UGgm8SCweFp ztKP|RCRIL`Y=7i3M>B3!67=cNZwi&(h?IDb!~|8#eauK*ouB!wMyvkYNEmGSRjn*3 z+;cxg8+bgua2CPe5_RN2x(6y|durts`C>c|)b<}264cy|9?Q;viJ9Z4$!X?U8gB#1*noE;$t8`2c zRmvr;j>RAo(hLOM?z_$2gjt#R9oY36T=qu12doV|$6L#DOhI0po_NiAvo5QkS4vP2zV8*^6n^5!O3r2OvTJ TwQVU#gr%V$`Qf_vkAL+8=0kh# literal 0 HcmV?d00001 diff --git a/lang/fr_FR.utf8.po b/lang/fr_FR.utf8.po deleted file mode 100644 index 886fa53..0000000 --- a/lang/fr_FR.utf8.po +++ /dev/null @@ -1,157 +0,0 @@ -# Header entry was created by Lokalize. -# -# , 2013. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"PO-Revision-Date: 2013-07-16 07:33+0200\n" -"Last-Translator: \n" -"Language-Team: French \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.5\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: ../admintools.php:87 -msgid "An error occured reinitializing fields configuration :(" -msgstr "" -"Une erreur est survenue lors de la réinitialisation de la configuration des " -"champs :(" - -#: ../templates/default/admintools.tpl:36 -msgid "" -"You should use that function if you can see strange characters in your " -"datas; after a manual import, or if you've not used Galette's update scripts." -msgstr "" -"Vous devriez utiliser cette fonctions si d'étranges caractères aparaissent " -"dans vos données ; après un import manuel, ou si vous n'avez pas utilisé les " -"scripts de mise à jour de Galette." - -#: ../admintools.php:85 -msgid "Fields configuration has been successfully reinitialized." -msgstr "La configuration des champs a été réinitialisée avec succès." - -#: ../admintools.php:65 -msgid "Database should have been successfully converted to UTF-8!" -msgstr "La base de données devrait avoir été convertie en UTF-8 !" - -#: ../templates/default/admintools.tpl:6 -#: ../templates/default/admintools.tpl:30 -msgid "" -"Make sure you've done a backup of the database before using any of the " -"following tools!" -msgstr "" -"Assurez-vous de faire une sauvegarde de votre base de données avant " -"d'utiliser l'un des outils suivants !" - -#: ../templates/default/menu.tpl:4 -msgid "Various administrative tools" -msgstr "Divers outils administratifs" - -#: ../templates/default/admintools.tpl:22 -msgid "Check PHP modules" -msgstr "Vérification des modules PHP" - -#: ../templates/default/admintools.tpl:48 -msgid "Modules report" -msgstr "Rapport sur les modules" - -#: ../templates/default/admintools.tpl:10 -msgid "Reinitialize emails contents" -msgstr "Réinitialiser les contenus des emails" - -#: ../templates/default/admintools.tpl:4 -msgid "Content tools" -msgstr "Outils de contenus" - -#: ../admintools.php:75 -msgid "An error occured reinitializing texts :(" -msgstr "Une erreur est survenue lors de la réinitialisation des textes :(" - -#: ../templates/default/admintools.tpl:35 -msgid "" -"Converts the whole database data to UTF-8, do not change anything on the " -"tables, just proceed data conversion." -msgstr "" -"Converti l'ensemble des données de la base en UTF-8, ne change rien sur les " -"tables, effectue juste la conversion." - -#: ../templates/default/admintools.tpl:28 -msgid "Database tools" -msgstr "Outils de base de données" - -#: ../admintools.php:111 -msgid "Logins and passwords has been successfully filled (%i processed)." -msgstr "Les login et mot de passe ont été correctement remplis (%i traités)." - -#: ../templates/default/admintools.tpl:34 -msgid "That function is available for MySQL installations only!" -msgstr "" -"Cette fonction n'est disponible que pour les installations sous MySQL !" - -#: ../templates/default/admintools.tpl:40 -msgid "Convert encoding" -msgstr "Conversion de l'encodage" - -#: ../admintools.php:122 -msgid "" -"Some PHP modules are missing. Please install them or contact your support." -"
More informations on required modules may be found in the documentation." -msgstr "" -"Certains modules PHP sont manquants. Veuillez les installer ou contacter " -"votre support.
Plus d'informations sur les modules requis sont " -"disponibles dans la documentation." - -#: ../templates/default/admintools.tpl:17 -msgid "Generate values for empty logins and passwords" -msgstr "Génère des valeurs pour les login et mot de passe vides" - -#: ../admintools.php:98 -msgid "An error occured reinitializing PDF models :(" -msgstr "Une erreur est survenue lors de la réinitialisation des modèles PDF :(" - -#: ../templates/default/menu.tpl:4 -msgid "Admin tools" -msgstr "Outils admin" - -#: ../admintools.php:114 -msgid "An error occured filling empty logins and passwords :(" -msgstr "" -"Une erreur est survenue lors de la création de valeurs pour les identifiants " -"vides :(" - -#: ../admintools.php:149 -msgid "Administration tools" -msgstr "Outils d'administration" - -#: ../templates/default/admintools.tpl:12 -msgid "Reinitialize PDF models" -msgstr "Réinitialiser les contenus des modèles PDF" - -#: ../templates/default/menu.tpl:2 -msgid "Admin Tools" -msgstr "Outils Admin" - -#: ../templates/default/admintools.tpl:37 -msgid "" -"That conversion stuff will read your entire database, and write back each " -"non UTF-8 values after conversion; this may take a while." -msgstr "" -"Cette conversion va lire l'intégralité de votre base de données, et ré-" -"écrire chaque valeur non UTF-8 après conversion. Cela peut prendre un " -"certain temps." - -#: ../admintools.php:73 -msgid "Texts has been successfully reinitialized." -msgstr "Les textes ont été réinitialisés avec succès." - -#: ../templates/default/admintools.tpl:11 -msgid "Reinitialize fields configuration" -msgstr "Réinitialiser la configuration des champs" - -#: ../admintools.php:96 -msgid "PDF models has been successfully reinitialized." -msgstr "Les modèles PDF ont été réinitialisés avec succès." - diff --git a/lang/fr_FR.utf8/LC_MESSAGES/galette_admintools.mo b/lang/fr_FR.utf8/LC_MESSAGES/galette_admintools.mo deleted file mode 100644 index f6bbe939800adb5cddca4efab0a7708957df36d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4252 zcmbtWO>88^6|RsCOH6=-{O~V5D+#l^anIVj3A>Eh6^nPhAlboLi~(^#oZj zci<9m>#oYrkAZ*1_@6+y8DhfwHxF~i566Zd&>+5#7u$*-;$@%sVcTJvfcpZW7I04> zgaX@!_`#hU9#9^*VLte|5ATogB1GW<_2L1%2yu8guf&CO<$i}UyP=IEX%fn%bKAB^9CeO~3;UN9N*nF9%=9j= zUb(nPJ)5ZPP_t95GVB{$lj@DKw(k(9c=fUm2P|||yh$rhuJEB{rkq%?#w+7%FEQ$? z!jm$wO<*7Y%^w{3uA=R(%@ifl%XR6hA6Q4vt}aGrXDG2`tf#mu&4vOKJHE>vGJ{x) zH8^gDu9nVIUf5WHL*9zL!4VErx5dR~Z`ZYDmQYvr6|E~}$dz%doJ-3r+o_j$?9d!P zJz84DYw;key3!r6+gM0c(iWGMQJ_{)UuLCplp^Ri53*P~DDnp%#3=)tkNs3v3^=Ef z<884lHx>LV6z$lu1&0%BKp?Hlc(csOrh&jA?du8_DJmVa3!0k=sm(IG%^w2;(_*;_ zF%>Geg%@L~cCdN-c(^jkR5g~TV&c2%NsZh^3^|M3TAfq&j##-0f(Kvm8TwI5qAPM%+8F0=t9y-==>6RuEOrRE~7vz&Tz z2Z2W@OB5)Io-;DBaoK~>VOd+Oh8j5(Gpk*RJRhblIbWtJZ6mrkStga0*cm1at7Rr= z!*-#OSR7bVGVY>aOjSNjvdPq|;BH+K^DtGrV87=yktjl)DVWPPq@{_2Mq!HVBNAL> zAz_zyp83^ML*tN`Y-d`m$wJ!_^I83Bl|#-|Rr7)^sV=<|VepfOr0f~R64j`Xu@FeE zbQFAn*r0@&*$^SlRX0zSGZNODQf8!k9JU#brw&_juCrv|sDv)dOnI+bj>;VCv433X z+`G0|DeP4h`{=18TC0SjLsKhHM^{u|vus3A4b`Djvva4T*)!4HBQ$%abNckpW>3w| zPAy62qg7byGU;uBl}oU?lp88qRkGKi#R6j2rN=fC73sONCPH33jzQZN8|R0UJCqhv z%TFy|8ksQHo}F5#@;+MK$zcJ@?8!Wn+RO)5obu;_IF9DAA*m{&OSQmu=ac}Nc9YwKqPg}jrdBfOd=@Ptzg>q+9)|ARsd=h?o;zmfJk1@SpAt`(o@+6*wPp~a z+zgV|c+jm8&q8O=)f9?KL6)IGePv38ZiZkcK&W#u*sJ;=#!y7eb(C`%Le5DioaU*P zsD0{V6uQhIw#BYZA9T(3NOPMEuJOLCRp@J9bE9DQM2}>{kf*);|Fe$+T)DV5*el?7 zJYhRGRF<|O-zbidAZ6&Ybx8+eTcN`u3!4tBDZ@9XdR)P5E}DQD?D3BfhtP4+mz!>j z$km;;(4jq60cqN-N>h{!LdpHM3gl3)+G2^D3wLl#+;U82Pf^cs%@Y5{IfdwD`d_6#V7Eo*7(Y@r3&~a$Yf zj8w9gmmuBAvadE|!PMbY>+yX*1+2x`J85x2Y6n5jTBQlz*s4Zdsd+!7H%uORxjpKw-^s zQs@KljU3{%97G zA}vg;osN#jG%&mw@Ee56Sb5CtT=_gpi7T%nb7tc`x|h}?H?>4!xUYpuBAd%&m+?p_ zR(X($upE|v>kTo@MgC#rW2L5}j54XbZs9FIp3=1`vMaGTN zK0Q?_m$W$*<4nk6Ea?8oc8+Gu$k-jgp%ZX9yx~J&A@CgkTGc*H^i{j>bUWSF!bsiS zahggRka*AC1Z^0Y8E=wtA@^vMa$SHqI1k&bvDjz*B%oPK;**6O`m`|+#<^rCAVJTK j_7udz(7M}j>$?u|c$|X9TNZ=jNg^U_mcufT!F*tUZ4!QS literal 0 HcmV?d00001 diff --git a/lang/lang_english.php b/lang/lang_english.php deleted file mode 100644 index d3af496..0000000 --- a/lang/lang_english.php +++ /dev/null @@ -1,90 +0,0 @@ -More informations on required modules may be found in the documentation.'] = 'Some PHP modules are missing. Please install them or contact your support.
More informations on required modules may be found in the documentation.'; - -// ../templates/default/admintools.tpl:22 -$lang['Check PHP modules'] = 'Check PHP modules'; - -// ../templates/default/admintools.tpl:28 -$lang['Database tools'] = 'Database tools'; - -// ../admintools.php:98 -$lang['An error occured reinitializing PDF models :('] = 'An error occured reinitializing PDF models :('; - -// ../admintools.php:73 -$lang['Texts has been successfully reinitialized.'] = 'Texts has been successfully reinitialized.'; - -// ../templates/default/admintools.tpl:4 -$lang['Content tools'] = 'Content tools'; - -// ../admintools.php:149 -$lang['Administration tools'] = 'Administration tools'; - -// ../templates/default/admintools.tpl:48 -$lang['Modules report'] = 'Modules report'; - -// ../templates/default/admintools.tpl:12 -$lang['Reinitialize PDF models'] = 'Reinitialize PDF models'; - -// ../templates/default/admintools.tpl:17 -$lang['Generate values for empty logins and passwords'] = 'Generate values for empty logins and passwords'; - -// ../templates/default/admintools.tpl:36 -$lang['You should use that function if you can see strange characters in your datas; after a manual import, or if you\'ve not used Galette\'s update scripts.'] = 'You should use that function if you can see strange characters in your datas; after a manual import, or if you\'ve not used Galette\'s update scripts.'; - -// ../templates/default/menu.tpl:4 -$lang['Various administrative tools'] = 'Various administrative tools'; - -// ../admintools.php:85 -$lang['Fields configuration has been successfully reinitialized.'] = 'Fields configuration has been successfully reinitialized.'; - -// ../templates/default/menu.tpl:2 -$lang['Admin Tools'] = 'Admin Tools'; - -// ../admintools.php:114 -$lang['An error occured filling empty logins and passwords :('] = 'An error occured filling empty logins and passwords :('; - -?> \ No newline at end of file diff --git a/lang/lang_french.php b/lang/lang_french.php deleted file mode 100644 index 1d668c7..0000000 --- a/lang/lang_french.php +++ /dev/null @@ -1,114 +0,0 @@ -More informations on required modules may be found in the documentation.'] = 'Certains modules PHP sont manquants. Veuillez les installer ou contacter votre support.
Plus d\'informations sur les modules requis sont disponibles dans la documentation.'; - -// ../templates/default/admintools.tpl:22 -$lang['Check PHP modules'] = 'Vérification des modules PHP'; - -// ../templates/default/admintools.tpl:28 -$lang['Database tools'] = 'Outils de base de données'; - -// ../admintools.php:98 -$lang['An error occured reinitializing PDF models :('] = 'Une erreur est survenue lors de la réinitialisation des modèles PDF :('; - -// ../admintools.php:73 -$lang['Texts has been successfully reinitialized.'] = 'Les textes ont été réinitialisés avec succès.'; - -// ../templates/default/admintools.tpl:4 -$lang['Content tools'] = 'Outils de contenus'; - -// ../admintools.php:149 -$lang['Administration tools'] = 'Outils d\'administration'; - -// ../templates/default/admintools.tpl:48 -$lang['Modules report'] = 'Rapport sur les modules'; - -// ../templates/default/admintools.tpl:12 -$lang['Reinitialize PDF models'] = 'Réinitialiser les contenus des modèles PDF'; - -// ../templates/default/admintools.tpl:17 -$lang['Generate values for empty logins and passwords'] = 'Génère des valeurs pour les login et mot de passe vides'; - -// ../templates/default/admintools.tpl:36 -$lang['You should use that function if you can see strange characters in your datas; after a manual import, or if you\'ve not used Galette\'s update scripts.'] = 'Vous devriez utiliser cette fonctions si d\'étranges caractères aparaissent dans vos données ; après un import manuel, ou si vous n\'avez pas utilisé les scripts de mise à jour de Galette.'; - -// ../templates/default/menu.tpl:4 -$lang['Various administrative tools'] = 'Divers outils administratifs'; - -// ../admintools.php:85 -$lang['Fields configuration has been successfully reinitialized.'] = 'La configuration des champs a été réinitialisée avec succès.'; - -// ../templates/default/menu.tpl:2 -$lang['Admin Tools'] = 'Outils Admin'; - -// ../admintools.php:114 -$lang['An error occured filling empty logins and passwords :('] = 'Une erreur est survenue lors de la création de valeurs pour les identifiants vides :('; - -$lang['Notes UVs'] = 'Notes UVs'; - -$lang['Notes Passage de Grades'] = 'Notes Passage de Grades'; - -$lang['Passages De Grades'] = 'Passages De Grades'; - -$lang[' Delete'] = ' Supprimer'; - -$lang['Moy.'] = 'Moy.'; - -$lang['Return'] = 'Retour'; - -$lang['Créer passage de grades'] = 'Créer passage de grades'; - -$lang['- '] = '- '; - -$lang['QRcodes'] = 'QRcodes'; - -$lang['QR codes'] = 'QR codes'; - -$lang['Générateur de QRcodes'] = 'Générateur de QRcodes'; - -$lang['Créer QRcodes Adhérents'] = 'Créer QRcodes Adhérents'; - -?> \ No newline at end of file diff --git a/lang/messages.po b/lang/messages.po deleted file mode 100644 index e85d092..0000000 --- a/lang/messages.po +++ /dev/null @@ -1,112 +0,0 @@ -#: ../admintools.php:87 -msgid "An error occured reinitializing fields configuration :(" -msgstr "" - -#: ../templates/default/admintools.tpl:36 -msgid "You should use that function if you can see strange characters in your datas; after a manual import, or if you've not used Galette's update scripts." -msgstr "" - -#: ../admintools.php:85 -msgid "Fields configuration has been successfully reinitialized." -msgstr "" - -#: ../admintools.php:65 -msgid "Database should have been successfully converted to UTF-8!" -msgstr "" - -#: ../templates/default/admintools.tpl:6 ../templates/default/admintools.tpl:30 -msgid "Make sure you've done a backup of the database before using any of the following tools!" -msgstr "" - -#: ../templates/default/menu.tpl:4 -msgid "Various administrative tools" -msgstr "" - -#: ../templates/default/admintools.tpl:22 -msgid "Check PHP modules" -msgstr "" - -#: ../templates/default/admintools.tpl:48 -msgid "Modules report" -msgstr "" - -#: ../templates/default/admintools.tpl:10 -msgid "Reinitialize emails contents" -msgstr "" - -#: ../templates/default/admintools.tpl:4 -msgid "Content tools" -msgstr "" - -#: ../admintools.php:75 -msgid "An error occured reinitializing texts :(" -msgstr "" - -#: ../templates/default/admintools.tpl:35 -msgid "Converts the whole database data to UTF-8, do not change anything on the tables, just proceed data conversion." -msgstr "" - -#: ../templates/default/admintools.tpl:28 -msgid "Database tools" -msgstr "" - -#: ../admintools.php:111 -msgid "Logins and passwords has been successfully filled (%i processed)." -msgstr "" - -#: ../templates/default/admintools.tpl:34 -msgid "That function is available for MySQL installations only!" -msgstr "" - -#: ../templates/default/admintools.tpl:40 -msgid "Convert encoding" -msgstr "" - -#: ../admintools.php:122 -msgid "Some PHP modules are missing. Please install them or contact your support.
More informations on required modules may be found in the documentation." -msgstr "" - -#: ../templates/default/admintools.tpl:17 -msgid "Generate values for empty logins and passwords" -msgstr "" - -#: ../admintools.php:98 -msgid "An error occured reinitializing PDF models :(" -msgstr "" - -#: ../templates/default/menu.tpl:4 -msgid "Admin tools" -msgstr "" - -#: ../admintools.php:114 -msgid "An error occured filling empty logins and passwords :(" -msgstr "" - -#: ../admintools.php:149 -msgid "Administration tools" -msgstr "" - -#: ../templates/default/admintools.tpl:12 -msgid "Reinitialize PDF models" -msgstr "" - -#: ../templates/default/menu.tpl:2 -msgid "Admin Tools" -msgstr "" - -#: ../templates/default/admintools.tpl:37 -msgid "That conversion stuff will read your entire database, and write back each non UTF-8 values after conversion; this may take a while." -msgstr "" - -#: ../admintools.php:73 -msgid "Texts has been successfully reinitialized." -msgstr "" - -#: ../templates/default/admintools.tpl:11 -msgid "Reinitialize fields configuration" -msgstr "" - -#: ../admintools.php:96 -msgid "PDF models has been successfully reinitialized." -msgstr "" - diff --git a/lang/qrcodes.pot b/lang/qrcodes.pot new file mode 100644 index 0000000..173f6ba --- /dev/null +++ b/lang/qrcodes.pot @@ -0,0 +1,16 @@ +#: ../templates/default/menu.tpl:5 +msgid "Create members QRcodes" +msgstr "" + +#: ../templates/default/menu.tpl:4 +msgid "QRcodes generator" +msgstr "" + +#: ../templates/default/menu.tpl:2 +msgid "QRcodes" +msgstr "" + +#: ../templates/default/adh_fiche_action.tpl:9 +msgid "QR codes" +msgstr "" + diff --git a/lang/qrcodes_en_US.php b/lang/qrcodes_en_US.php new file mode 100644 index 0000000..c390eff --- /dev/null +++ b/lang/qrcodes_en_US.php @@ -0,0 +1,17 @@ +\n" +"Language-Team: \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.12\n" + +#: ../templates/default/menu.tpl:5 +msgid "Create members QRcodes" +msgstr "Create members QRcodes" + +#: ../templates/default/menu.tpl:4 +msgid "QRcodes generator" +msgstr "QRcodes generator" + +#: ../templates/default/menu.tpl:2 +msgid "QRcodes" +msgstr "QRcodes" + +#: ../templates/default/adh_fiche_action.tpl:9 +msgid "QR codes" +msgstr "QR codes" diff --git a/lang/qrcodes_fr_FR.utf8.php b/lang/qrcodes_fr_FR.utf8.php new file mode 100644 index 0000000..1afe61f --- /dev/null +++ b/lang/qrcodes_fr_FR.utf8.php @@ -0,0 +1,17 @@ +\n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.12\n" + +#: ../templates/default/menu.tpl:5 +msgid "Create members QRcodes" +msgstr "Créer les QRCodes des adhérents" + +#: ../templates/default/menu.tpl:4 +msgid "QRcodes generator" +msgstr "Générateur de QRCode" + +#: ../templates/default/menu.tpl:2 +msgid "QRcodes" +msgstr "QRcodes" + +#: ../templates/default/adh_fiche_action.tpl:9 +msgid "QR codes" +msgstr "QR codes" diff --git a/lang/qrcodes_routes.pot b/lang/qrcodes_routes.pot new file mode 100644 index 0000000..f0ef7ef --- /dev/null +++ b/lang/qrcodes_routes.pot @@ -0,0 +1,20 @@ +#: ../_routes.php:92 ../templates/default/adh_fiche_action.tpl:6 +msgid "email" +msgstr "" + +#: ../_routes.php:44 +msgid "/member" +msgstr "" + +#: ../_routes.php:91 +msgid "/show" +msgstr "" + +#: ../_routes.php:44 +msgid "/qrcode" +msgstr "" + +#: ../_routes.php:91 ../templates/default/adh_fiche_action.tpl:3 +msgid "phone" +msgstr "" + diff --git a/lang/qrcodes_routes_en_US.php b/lang/qrcodes_routes_en_US.php new file mode 100644 index 0000000..1027722 --- /dev/null +++ b/lang/qrcodes_routes_en_US.php @@ -0,0 +1,20 @@ +\n" +"Language-Team: \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.12\n" + +#: ../_routes.php:92 ../templates/default/adh_fiche_action.tpl:6 +msgid "email" +msgstr "email" + +#: ../_routes.php:44 +msgid "/member" +msgstr "/member" + +#: ../_routes.php:91 +msgid "/show" +msgstr "/show" + +#: ../_routes.php:44 +msgid "/qrcode" +msgstr "/qrcode" + +#: ../_routes.php:91 ../templates/default/adh_fiche_action.tpl:3 +msgid "phone" +msgstr "phone" diff --git a/lang/qrcodes_routes_fr_FR.utf8.php b/lang/qrcodes_routes_fr_FR.utf8.php new file mode 100644 index 0000000..a50496e --- /dev/null +++ b/lang/qrcodes_routes_fr_FR.utf8.php @@ -0,0 +1,20 @@ +\n" +"Language-Team: \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.12\n" + +#: ../_routes.php:92 ../templates/default/adh_fiche_action.tpl:6 +msgid "email" +msgstr "email" + +#: ../_routes.php:44 +msgid "/member" +msgstr "/adherent" + +#: ../_routes.php:91 +msgid "/show" +msgstr "/afficher" + +#: ../_routes.php:44 +msgid "/qrcode" +msgstr "/qrcode" + +#: ../_routes.php:91 ../templates/default/adh_fiche_action.tpl:3 +msgid "phone" +msgstr "telephone" diff --git a/lang/xgettext.py b/lang/xgettext.py old mode 100644 new mode 100755 index b40d10e..6468441 --- a/lang/xgettext.py +++ b/lang/xgettext.py @@ -6,7 +6,7 @@ - generates message.po with the same symtax as regular xgettext - translatable string sort may differ from regular xgettext -Copyright © 2005-2014 The Galette Team +Copyright © 2005-2016 The Galette Team This file is part of Galette (http://galette.tuxfamily.org). @@ -30,51 +30,69 @@ import re # pattern definition -translatable= re.compile("_T\((\"[^\"]*\")\)") -tpl_translatable= re.compile("_T\ string=(\"[^\"]*\")") +translatable = re.compile("_(T|_)\((\"[^\"]*\")(, \"([^\"]*)\")?\)") +#same, with single quotes... +translatable_single = re.compile("_(T|_)\(('[^']*')(, '([^']*)')?\)") +tpl_translatable = re.compile("_(T|_)\ string=(\"[^\"]*\")( domain=\"([^\"]*)\")?") # constants string startLoc = "#: " nextLoc = " " # +domains = {} dico = {} -def location() : - return inputFileName + ":" + str(lineNum+1) +def location(): + """ + String location in file + """ + return inputFileName + ":" + str(lineNum+1) -# -for inputFileName in sys.argv[1:] : - inFile=open(inputFileName) - lines = inFile.readlines() - inFile.close() - # get line - for lineNum, line in enumerate(lines) : - # search translatable strings - matchs = translatable.findall(line) - for match in matchs: - if dico.has_key(match): - if dico[match][-1:] == "\n": - dico[match] += startLoc + location() - else : - dico[match] += nextLoc + location() + "\n" - else : - dico[match] = startLoc + location() - tpl_matchs = tpl_translatable.findall(line) - for tpl_match in tpl_matchs: - if dico.has_key(tpl_match): - if dico[tpl_match][-1:] == "\n": - dico[tpl_match] += startLoc + location() - else : - dico[tpl_match] += nextLoc + location() + "\n" - else : - dico[tpl_match] = startLoc + location() +def handleMatches(matches, repl_quotes=False): + for match in matches: + trans = match[1] + #handle single quotes + if repl_quotes == True: + trans = '"%s"' % trans[1:-1] + + #define domain + if match[3] != '' and match[3] != 'routes': + cur_domain = match[3] + else: + continue + + if not domains.has_key(cur_domain): + domains[cur_domain] = {} + + if domains[cur_domain].has_key(trans): + if domains[cur_domain][trans][-1:] == "\n": + domains[cur_domain][trans] += startLoc + location() + else: + domains[cur_domain][trans] += nextLoc + location() + "\n" + else: + domains[cur_domain][trans] = startLoc + location() # -outFile = open("messages.po",'w') -for k, v in dico.iteritems(): - outFile.write(v) - if v[-1:] != "\n" : - outFile.write("\n") - outFile.write("msgid " + k + "\nmsgstr \"\"\n\n") -outFile.close() +for inputFileName in sys.argv[1:]: + inFile = open(inputFileName) + lines = inFile.readlines() + inFile.close() + # get line + for lineNum, line in enumerate(lines): + # search translatable strings + matches = translatable.findall(line) + handleMatches(matches) + matches = translatable_single.findall(line) + handleMatches(matches, True) + matches = tpl_translatable.findall(line) + handleMatches(matches) + +for domain, strings in domains.iteritems(): + outFile = open("%s.pot" % domain, 'w') + for k, v in strings.iteritems(): + outFile.write(v) + if v[-1:] != "\n": + outFile.write("\n") + outFile.write("msgid " + k + "\nmsgstr \"\"\n\n") + outFile.close() diff --git a/lib/GaletteQRCodes/Picture.php b/lib/GaletteQRCodes/Picture.php index 324c400..f755da4 100644 --- a/lib/GaletteQRCodes/Picture.php +++ b/lib/GaletteQRCodes/Picture.php @@ -104,9 +104,10 @@ public function __construct(Plugins $plugins, $id_adh = '', $code = 'phone') */ protected function getDefaultPicture() { - global $plugins; - $this->file_path = $this->plugins->getTemplatesPathFromName('Galette QRCodes') . - '/images/empty.png'; + $this->file_path = realpath( + $this->plugins->getTemplatesPathFromName('Galette QRCodes') . + '/../../webroot/images/empty.png' + ); $this->format = 'png'; $this->mime = 'image/png'; $this->has_picture = false; diff --git a/picture.php b/picture.php deleted file mode 100644 index c2a5216..0000000 --- a/picture.php +++ /dev/null @@ -1,81 +0,0 @@ -. - * - * @category Main - * @package Galette - * - * @author Frédéric Jaqcuot - * @author Johan Cwiklinski - * @copyright 2004-2014 The Galette Team - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version - * @version SVN: $Id: picture.php 877 2011-06-01 06:08:18Z trashy $ - * @link http://galette.tuxfamily.org - * @since Available since 0.62 - */ - -define('GALETTE_BASE_PATH', '../../'); -/** @ignore */ -require_once GALETTE_BASE_PATH . 'includes/galette.inc.php'; -require_once '_config.inc.php'; - -$id_adh = (int)$_GET['id_adh']; -$deps = array( - 'picture' => true, - 'groups' => false, - 'dues' => false -); - -//if loggedin user is a group manager, we have to check -//he manages a group requested member belongs to. -if ( $login->isGroupManager() ) { - $deps['groups'] = true; -} - -$adh = new Galette\Entity\Adherent($id_adh, $deps); - -$is_manager = false; -if ( !$login->isAdmin() && !$login->isStaff() && $login->isGroupManager() ) { - $groups = $adh->groups; - foreach ( $groups as $group ) { - if ( $login->isGroupManager($group->getId()) ) { - $is_manager = true; - break; - } - } -} - -$picture = null; -if ( $login->isAdmin() - || $login->isStaff() - || $adh->appearsInMembersList() - || $login->login == $adh->login - || $is_manager -) { - $picture = new GaletteQRCodes\Picture($plugins, $id_adh, $_GET['code']); -} else { - $picture = new GaletteQRCodes\Picture(); -} -$picture->display(); diff --git a/templates/default/adh_fiche_action.tpl b/templates/default/adh_fiche_action.tpl index a401f62..38a5adc 100644 --- a/templates/default/adh_fiche_action.tpl +++ b/templates/default/adh_fiche_action.tpl @@ -1,15 +1,11 @@ -
  • {if $login->isAdmin() or $login->isStaff()} - Tel. -{/if} +
  • + {_T string="phone" domain="qrcodes_routes"}, "id" => $member->id]}?rand={$time}" class="picture" alt=""/> Tel.
  • -{if $login->isAdmin() or $login->isStaff()} - Mail -{/if} + {_T string="email" domain="qrcodes_routes"}, "id" => $member->id]}?rand={$time}" class="picture" alt=""/> Mail
  • -{if $login->isAdmin() or $login->isStaff()} - {_T string="QR codes"} -{/if} + $member->id]}" id="btn_plugins_QRcodes">{_T string="QR codes" domain="qrcodes"}
  • +{/if} diff --git a/templates/default/headers.tpl b/templates/default/headers.tpl index f1da61c..2335397 100644 --- a/templates/default/headers.tpl +++ b/templates/default/headers.tpl @@ -1,3 +1 @@ - - - + $module_id, "path" => "galette_QRcodes.css"]}"/> diff --git a/templates/default/menu.tpl b/templates/default/menu.tpl index 22f4fac..5ce35da 100644 --- a/templates/default/menu.tpl +++ b/templates/default/menu.tpl @@ -1,7 +1,7 @@ {if $login->isAdmin()} -

    {_T string="QRcodes"}

    - +

    {_T string="QRcodes" domain="qrcodes"}

    + {/if} diff --git a/templates/default/galette_QRcodes.css b/webroot/galette_QRcodes.css similarity index 100% rename from templates/default/galette_QRcodes.css rename to webroot/galette_QRcodes.css diff --git a/templates/default/images/coucou.png b/webroot/images/coucou.png similarity index 100% rename from templates/default/images/coucou.png rename to webroot/images/coucou.png diff --git a/templates/default/images/empty.png b/webroot/images/empty.png similarity index 100% rename from templates/default/images/empty.png rename to webroot/images/empty.png