I18n: Split translated messages of core and app in discting gettext domains

This commit is contained in:
Benjamin Renard 2023-02-14 01:21:52 +01:00
parent 9213ae076f
commit 73dc860972
35 changed files with 1550 additions and 1077 deletions

View file

@ -30,5 +30,8 @@
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.9" "phpstan/phpstan": "^1.9"
} },
"bin": [
"eesyphp"
]
} }

9
eesyphp Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/php
<?php
use EesyPHP\App;
use EesyPHP\Cli;
require __DIR__."/vendor/autoload.php";
App::init(null, null, __DIR__);
Cli :: handle_args();

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2023-02-13 02:58+0100\n" "POT-Creation-Date: 2023-02-14 00:22+0100\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n" "Last-Translator: Benjamin Renard <brenard@zionetrix.net>\n"
"Language-Team: \n" "Language-Team: \n"
@ -12,377 +12,6 @@ msgstr ""
"X-Generator: Poedit 2.4.2\n" "X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: Cli.php:34
#, php-format
msgid "The CLI command '%s' already exists."
msgstr "La commande CLI '%s' n'existe pas."
#: Cli.php:39
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr "La fonction implémentant la commande CLI '%s' n'est pas exécutable !"
#: Cli.php:71
#, php-format
msgid "Usage: %s [-h] [-qd] command\n"
msgstr "Utilisation: %s [-h] [-qd] commande\n"
#: Cli.php:72
msgid " -h Show this message\n"
msgstr " -h Affiche ce message\n"
#: Cli.php:73
msgid " -q / -d Quiet/Debug mode\n"
msgstr " -q / -d Mode silencieux/debug\n"
#: Cli.php:74
msgid " --trace Trace mode (the most verbose)\n"
msgstr " --trace Mode trace (le plus verbeux)\n"
#: Cli.php:75
msgid " command Command to run\n"
msgstr " command La commande à exécuter\n"
#: Cli.php:77
msgid "Available commands:\n"
msgstr "Commandes disponibles:\n"
#: Cli.php:125
msgid "Only one command could be executed !"
msgstr "Une seul commande peut-être exécutée !"
#: Cli.php:153
#, php-format
msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
"Paramètre \"%s\" invalide.\n"
"Note : Les paramètres/arguments de la requête doivent être placés après "
"celle-ci."
#: Cli.php:178
#, php-format
msgid "An exception occured running command %s"
msgstr "Une exception est survenue en exécutant la commande %s"
#: Db.php:74
msgid "Unable to connect to the database."
msgstr "Impossible de se connecter à la base de données."
#: Email.php:141
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgstr "</hr><p><small>Email initialement destiné à %s.</small></p>"
#: Email.php:142
#, php-format
msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
msgstr ""
"\n"
"\n"
"\n"
"Mail originalement destiné à %s."
#: Email.php:178
#, php-format
msgid "<p><small>%s: %s</small></p>"
msgstr "<p><small>%s: %s</small></p>"
#: Email.php:179
#, php-format
msgid ""
"\n"
"%s: %s"
msgstr ""
"\n"
"%s: %s"
#: Tpl.php:339
msgid "No template specified."
msgstr "Aucun template spécifié."
#: Tpl.php:370
msgid "An error occurred while displaying this page."
msgstr "Une erreur est survenue en affichant cette page."
#: Url.php:141
msgid "Bad request"
msgstr "Mauvaise requête"
#: Url.php:142
msgid "Invalid request."
msgstr "Requête invalide."
#: Url.php:145
msgid "Authentication required"
msgstr "Authentification requise"
#: Url.php:146
msgid "You have to be authenticated to access to this page."
msgstr "Vous devez être authentifié pour accéder à cette page."
#: Url.php:149
msgid "Access denied"
msgstr "Accès interdit"
#: Url.php:150
msgid ""
"You do not have access to this application. If you think this is an error, "
"please contact support."
msgstr ""
"Vous n'avez pas accès à cette application. Si vous pensez qu'il s'agit d'une "
"erreur, merci de prendre contact avec le support."
#: Url.php:153
msgid "Whoops ! Page not found"
msgstr "Oups ! Page introuvable"
#: Url.php:154
msgid "The requested page can not be found."
msgstr "La page demandée est introuvable."
#: Url.php:162
msgid "Error"
msgstr "Erreur"
#: Url.php:163
msgid "An unknown error occurred. If problem persist, please contact support."
msgstr ""
"Une erreur inconnue est survenue. Si le problème persiste, merci de prendre "
"contact avec le support."
#: Url.php:226
msgid ""
"Unable to determine the requested page. If the problem persists, please "
"contact support."
msgstr ""
"Impossible de déterminer la page demandée. Si le problème persiste, merci de "
"prendre contact avec le support."
#: Url.php:376
msgid ""
"Unable to determine the requested page (loop detected). If the problem "
"persists, please contact support."
msgstr ""
"Impossible de déterminer la page demandée (boucle détectée). Si le problème "
"persiste, merci de prendre contact avec le support."
#: Url.php:407
msgid "This request cannot be processed."
msgstr "Cette requête ne peut être traitée."
#: Url.php:420
msgid ""
"Authentication required but force_authentication function is not defined."
msgstr ""
"Authentification requise mais la fonction force_authentication n'est pas "
"définie."
#: Url.php:429
msgid "This request could not be processed correctly."
msgstr "Cette requête n'a put être traitée correctement."
#: I18n.php:114 App.php:120
msgid "Hello world !"
msgstr "Bonjour tout le monde !"
#: I18n.php:130
msgid "Extract messages that need to be translated"
msgstr "Extraire les messages devant être traduit"
#: I18n.php:132
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
"Cette commande peut-être utilisée pour générer/mettre à jour le fichier "
"locales/messages.pot."
#: I18n.php:138
msgid "Update messages in translation PO lang files"
msgstr ""
"Mettre à jour les messages dans les fichiers de traduction PO existants"
#: I18n.php:140
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
"Cette commande peut-être utilisée pour initialiser/mettre à jour les "
"fichiers PO dans les dossiers locales/*/LC_MESSAGES."
#: I18n.php:147
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
"Compiler les messages depuis les fichiers PO de traduction existants vers "
"les fichiers MO et les catalogues JS correspondant"
#: I18n.php:152
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
"Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
"dossiers locales/*/LC_MESSAGES and les catalogues JS dans le dossier locales."
#: I18n.php:277
msgid "Fail to list EesyPHP PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP d'EesyPHP."
#: I18n.php:297
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers PHP "
"d'EesyPHP en utilisant xgettext."
#: I18n.php:309
msgid "Fail to list application PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP de l'application."
#: I18n.php:329
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
"Impossible d'extraire les messages depuis les fichiers PHP en utilisant "
"xgettext."
#: I18n.php:342
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
"Une erreur est survenue en listant les fichiers JS dans le dossier des "
"fichiers statiques '%s'."
#: I18n.php:364
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers JS du "
"dossier des fichiers statiques '%s' en utilisant xgettext."
#: I18n.php:384
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
"Impossible d'extraire les messages depuis le dossier de templates '%s' en "
"utilisant le script tsmarty2c.php."
#: I18n.php:420
msgid "Fail to merge messages using msgcat."
msgstr "Impossible de fusionner les messages en utilisant msgcat."
#: I18n.php:434
#, php-format
msgid "Compendium file %s not found."
msgstr "Fichier compendium %s introuvable."
#: I18n.php:441
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
"Fichier POT introuvable (%s). Merci de lancer la commande extract_messages "
"pour commencer."
#: I18n.php:453 I18n.php:561
#, php-format
msgid "Lang directory '%s' found"
msgstr "Dossier de langue '%s' trouvé"
#: I18n.php:459 I18n.php:567
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
"Le dossier LC_MESSAGES est introuvable dans le dossier de langue '%s', on "
"l'ignore."
#: I18n.php:474
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
"Impossible d'initialiser les messages dans le fichier PO %s en utilisant "
"msginit (%s)."
#: I18n.php:492
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
"Impossible de mettre à jour les messages dans les fichiers PO %s en "
"utilisant msgmerge (%s)."
#: I18n.php:498 I18n.php:575
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
"Le fichier PO est introuvable dans le dossier de langue '%s', on l'ignore."
#: I18n.php:505 I18n.php:615
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr "Impossible d'ouvrir le dossier racine des langues (%s)."
#: I18n.php:531
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s"
#: I18n.php:538
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "Lien symbolique de catalogue JS pour %s -> %s créé (%s)"
#: I18n.php:542
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
"Impossible de créer le lien symbolique de catalogue JS pour %s -> %s (%s)"
#: I18n.php:548
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "Le lien symbolique du catalogue JS pour %s -> %s existe déjà (%s)"
#: I18n.php:553
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
"Le catalogue JS pour %s existe, mais il ne s'agit par d'un lien symbolique "
"vers %s (%s)"
#: I18n.php:588
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
"Impossible de compiler les messages depuis le fichier PO %s en tant que "
"fichier MO en utilisant msgfmt (%s)."
#: I18n.php:598
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "Impossible d'ouvrir le catalogue JS %s en mode écriture (%s)."
#: I18n.php:603
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr "Impossible d'écrire le fichier du catalogue JS %s (%s)."
#: I18n.php:608
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr "Catalogue JS %s créé (%s)."
#: App.php:122
msgid "Hello world!"
msgstr "Salut tout le monde !"
#: includes/cli.php:23 #: includes/cli.php:23
#, php-format #, php-format
msgid "Item #%s:\n" msgid "Item #%s:\n"
@ -654,47 +283,6 @@ msgstr "L'élément '%s' a bien été supprimé."
msgid "An error occurred while deleting this item." msgid "An error occurred while deleting this item."
msgstr "Une erreur est survenue en supprimant cet élément." msgstr "Une erreur est survenue en supprimant cet élément."
#: static/js/myconfirm.js:4 static/js/myconfirm.js:171
#: static/js/myconfirm.js:200
msgid "Confirmation"
msgstr "Confirmation"
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr "Confirmez-vous ?"
#: static/js/myconfirm.js:11 static/js/myconfirm.js:108
msgid "Cancel"
msgstr "Annuler"
#: static/js/myconfirm.js:17 static/js/myconfirm.js:114
msgid "Validate"
msgstr "Valider"
#: static/js/myconfirm.js:52
msgid "OK"
msgstr "OK"
#: static/js/myconfirm.js:91
msgid "Question"
msgstr "Question"
#: static/js/myconfirm.js:92
msgid "Please enter your answer below:"
msgstr "Merci de saisir vos réponses ci-dessous :"
#: static/js/myconfirm.js:143
msgid "Please wait"
msgstr "Merci de patienter"
#: static/js/myconfirm.js:144
msgid "Please wait while your request is being processed."
msgstr "Merci de patienter pendant le traitement de votre requête."
#: static/js/myconfirm.js:172 static/js/myconfirm.js:201
msgid "Are you sure?"
msgstr "Êtes-vous sure ?"
#: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7 #: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -800,114 +388,3 @@ msgstr "Page de recherche"
#: templates/form.tpl:36 #: templates/form.tpl:36
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
#: templates/fatal_error.tpl:5
msgid ""
"A fatal error has occurred and it is preventing this application from "
"working properly. Please try again later or contact support."
msgstr ""
"Une erreur fatale est survenue et celle-ci empêche cette application de "
"fonctionner correctement. Merci de réessayer ultérieurement ou de prendre "
"contact avec le service support."
#: templates/fatal_error.tpl:7
msgid "Error: %1"
msgstr "Erreur : %1"
#: templates/homepage.tpl:6
msgid ""
"This is the default page of a new app using EesyPHP framework. Register your "
"own templates directory and create a <em>homepage.tpl</em> file to overwrite "
"it. You could also overwrite the URL handler for the root of the web "
"application."
msgstr ""
"Il s'agit de la page par défaut d'une nouvelle application utilisant le "
"framework EesyPHP. Configurez votre propre dossier de templates et créer le "
"fichier <em>homepage.tpl</em> pour l'écraser. Vous pouvez également écraser "
"le gestionnaire de l'URL racine de l'application web."
#~ msgid ""
#~ "This command could be used to generate/update lang/messages.pot file."
#~ msgstr ""
#~ "Cette commande peut-être utilisée pour générer/mettre à jour le fichier "
#~ "lang/messages.pot."
#~ msgid ""
#~ "This command could be used to init/update PO files in lang/*/LC_MESSAGES "
#~ "directories."
#~ msgstr ""
#~ "Cette commande peut-être utilisée pour initialiser/mettre à jour les "
#~ "fichiers PO les dossiers lang/*/LC_MESSAGES."
#~ msgid ""
#~ "This command could be used to compile PO files in lang/*/LC_MESSAGES "
#~ "directories to MO files and as JS catalogs in public_html/translations."
#~ msgstr ""
#~ "Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
#~ "dossiers lang/*/LC_MESSAGES en fichiers MO and en tant que catalogues JS "
#~ "dans public_html/translations."
#, php-format
#~ msgid "Fail to list JS files in '%s' static directory."
#~ msgstr ""
#~ "Une erreur est survenue en listant les fichiers JS dans le dossier des "
#~ "fichiers statiques '%s'."
#, php-format
#~ msgid ""
#~ "Fail to extract messages from JS files in '%s' static directory using "
#~ "xgettext."
#~ msgstr ""
#~ "Impossible d'extraire les messages depuis les fichiers JS dans le dossier "
#~ "des fichiers statiques '%s' en utilisant xgettext."
#~ msgid "Smarty version not supported."
#~ msgstr "Une erreur est survenue en affichant cette page."
#~ msgid "An error occurred while viewing this page."
#~ msgstr "Une erreur est survenue en affichant cette page."
#~ msgid "Fail to list PHP files."
#~ msgstr "Impossible de lister les fichiers PHP."
#~ msgid "Fail to list JS files."
#~ msgstr "Impossible de lister les fichiers JS."
#~ msgid "Fail to extract messages from JS files using xgettext."
#~ msgstr ""
#~ "Impossible d'extraire les messages depuis les fichiers JS en utilisant "
#~ "xgettext."
#~ msgid ""
#~ "Fail to extract messages from template files using tsmarty2c.php script."
#~ msgstr ""
#~ "Impossible d'extraire les messages depuis les fichiers template en "
#~ "utilisant le script tsmarty2c.php."
#~ msgid "Update messages in existing translation PO lang files"
#~ msgstr ""
#~ "Mettre à jour les messages dans les fichiers de traduction PO existants"
#~ msgid ""
#~ "This command could be used to update PO files in lang/*/LC_MESSAGES "
#~ "directories."
#~ msgstr ""
#~ "Cette commande peut-être utilisée pour mettre à jour les fichiers PO les "
#~ "dossiers lang/*/LC_MESSAGES."
#~ msgid ""
#~ "Compile messages from existing translation PO lang files to corresponding "
#~ "MO files"
#~ msgstr ""
#~ "Compiler les messages depuis les fichiers PO de traduction existants vers "
#~ "les fichiers MO correspondant"
#~ msgid ""
#~ "This command could be used to compile PO files in lang/*/LC_MESSAGES "
#~ "directories to MO files."
#~ msgstr ""
#~ "Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
#~ "dossiers lang/*/LC_MESSAGES en fichiers MO."
#~ msgid "Element(s) %1 to %2 on %3"
#~ msgstr "Élément(s) %1 à %2 sur %3"

View file

@ -1,7 +1,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"POT-Creation-Date: 2023-02-13 03:00+0100\n" "POT-Creation-Date: 2023-02-14 01:18+0100\n"
"PO-Revision-Date: 2023-02-13 03:00+0100\n" "PO-Revision-Date: 2023-02-14 01:18+0100\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"

View file

@ -1,330 +1,11 @@
msgid "" msgid ""
msgstr "" msgstr ""
"POT-Creation-Date: 2023-02-13 03:00+0100\n" "POT-Creation-Date: 2023-02-14 01:18+0100\n"
"PO-Revision-Date: 2023-02-13 03:00+0100\n" "PO-Revision-Date: 2023-02-14 01:18+0100\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: Cli.php:34
#, php-format
msgid "The CLI command '%s' already exists."
msgstr ""
#: Cli.php:39
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr ""
#: Cli.php:71
#, php-format
msgid "Usage: %s [-h] [-qd] command\n"
msgstr ""
#: Cli.php:72
msgid " -h Show this message\n"
msgstr ""
#: Cli.php:73
msgid " -q / -d Quiet/Debug mode\n"
msgstr ""
#: Cli.php:74
msgid " --trace Trace mode (the most verbose)\n"
msgstr ""
#: Cli.php:75
msgid " command Command to run\n"
msgstr ""
#: Cli.php:77
msgid "Available commands:\n"
msgstr ""
#: Cli.php:125
msgid "Only one command could be executed !"
msgstr ""
#: Cli.php:153
#, php-format
msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
#: Cli.php:178
#, php-format
msgid "An exception occured running command %s"
msgstr ""
#: Db.php:74
msgid "Unable to connect to the database."
msgstr ""
#: Email.php:141
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgstr ""
#: Email.php:142
#, php-format
msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
msgstr ""
#: Email.php:178
#, php-format
msgid "<p><small>%s: %s</small></p>"
msgstr ""
#: Email.php:179
#, php-format
msgid ""
"\n"
"%s: %s"
msgstr ""
#: Tpl.php:339
msgid "No template specified."
msgstr ""
#: Tpl.php:370
msgid "An error occurred while displaying this page."
msgstr ""
#: Url.php:141
msgid "Bad request"
msgstr ""
#: Url.php:142
msgid "Invalid request."
msgstr ""
#: Url.php:145
msgid "Authentication required"
msgstr ""
#: Url.php:146
msgid "You have to be authenticated to access to this page."
msgstr ""
#: Url.php:149
msgid "Access denied"
msgstr ""
#: Url.php:150
msgid ""
"You do not have access to this application. If you think this is an error, "
"please contact support."
msgstr ""
#: Url.php:153
msgid "Whoops ! Page not found"
msgstr ""
#: Url.php:154
msgid "The requested page can not be found."
msgstr ""
#: Url.php:162
msgid "Error"
msgstr ""
#: Url.php:163
msgid "An unknown error occurred. If problem persist, please contact support."
msgstr ""
#: Url.php:226
msgid ""
"Unable to determine the requested page. If the problem persists, please "
"contact support."
msgstr ""
#: Url.php:376
msgid ""
"Unable to determine the requested page (loop detected). If the problem "
"persists, please contact support."
msgstr ""
#: Url.php:407
msgid "This request cannot be processed."
msgstr ""
#: Url.php:420
msgid ""
"Authentication required but force_authentication function is not defined."
msgstr ""
#: Url.php:429
msgid "This request could not be processed correctly."
msgstr ""
#: I18n.php:114 App.php:120
msgid "Hello world !"
msgstr ""
#: I18n.php:130
msgid "Extract messages that need to be translated"
msgstr ""
#: I18n.php:132
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
#: I18n.php:138
msgid "Update messages in translation PO lang files"
msgstr ""
#: I18n.php:140
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
#: I18n.php:147
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
#: I18n.php:152
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
#: I18n.php:277
msgid "Fail to list EesyPHP PHP files."
msgstr ""
#: I18n.php:297
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
#: I18n.php:309
msgid "Fail to list application PHP files."
msgstr ""
#: I18n.php:329
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
#: I18n.php:342
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
#: I18n.php:364
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
#: I18n.php:384
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
#: I18n.php:420
msgid "Fail to merge messages using msgcat."
msgstr ""
#: I18n.php:434
#, php-format
msgid "Compendium file %s not found."
msgstr ""
#: I18n.php:441
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
#: I18n.php:453 I18n.php:561
#, php-format
msgid "Lang directory '%s' found"
msgstr ""
#: I18n.php:459 I18n.php:567
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:474
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
#: I18n.php:492
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
#: I18n.php:498 I18n.php:575
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:505 I18n.php:615
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr ""
#: I18n.php:531
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr ""
#: I18n.php:538
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr ""
#: I18n.php:542
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
#: I18n.php:548
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr ""
#: I18n.php:553
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
#: I18n.php:588
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
#: I18n.php:598
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr ""
#: I18n.php:603
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr ""
#: I18n.php:608
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr ""
#: App.php:122
msgid "Hello world!"
msgstr ""
#: includes/cli.php:23 #: includes/cli.php:23
#, php-format #, php-format
msgid "Item #%s:\n" msgid "Item #%s:\n"
@ -585,47 +266,6 @@ msgstr ""
msgid "An error occurred while deleting this item." msgid "An error occurred while deleting this item."
msgstr "" msgstr ""
#: static/js/myconfirm.js:4 static/js/myconfirm.js:171
#: static/js/myconfirm.js:200
msgid "Confirmation"
msgstr ""
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr ""
#: static/js/myconfirm.js:11 static/js/myconfirm.js:108
msgid "Cancel"
msgstr ""
#: static/js/myconfirm.js:17 static/js/myconfirm.js:114
msgid "Validate"
msgstr ""
#: static/js/myconfirm.js:52
msgid "OK"
msgstr ""
#: static/js/myconfirm.js:91
msgid "Question"
msgstr ""
#: static/js/myconfirm.js:92
msgid "Please enter your answer below:"
msgstr ""
#: static/js/myconfirm.js:143
msgid "Please wait"
msgstr ""
#: static/js/myconfirm.js:144
msgid "Please wait while your request is being processed."
msgstr ""
#: static/js/myconfirm.js:172 static/js/myconfirm.js:201
msgid "Are you sure?"
msgstr ""
#: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7 #: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7
msgid "Name" msgid "Name"
msgstr "" msgstr ""
@ -729,21 +369,3 @@ msgstr ""
#: templates/form.tpl:36 #: templates/form.tpl:36
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: templates/fatal_error.tpl:5
msgid ""
"A fatal error has occurred and it is preventing this application from "
"working properly. Please try again later or contact support."
msgstr ""
#: templates/fatal_error.tpl:7
msgid "Error: %1"
msgstr ""
#: templates/homepage.tpl:6
msgid ""
"This is the default page of a new app using EesyPHP framework. Register your "
"own templates directory and create a <em>homepage.tpl</em> file to overwrite "
"it. You could also overwrite the URL handler for the root of the web "
"application."
msgstr ""

1
locales/fr Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8

1
locales/fr.js Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8.js

1
locales/fr_FR Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8

1
locales/fr_FR.UTF-8 Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8

1
locales/fr_FR.UTF-8.js Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8.js

1
locales/fr_FR.UTF8.js Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -0,0 +1,462 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2023-02-14 01:17+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Benjamin Renard <brenard@zionetrix.net>\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 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: Cli.php:34
#, php-format
msgid "The CLI command '%s' already exists."
msgstr "La commande CLI '%s' n'existe pas."
#: Cli.php:39
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr "La fonction implémentant la commande CLI '%s' n'est pas exécutable !"
#: Cli.php:71
#, php-format
msgid "Usage: %s [-h] [-qd] command\n"
msgstr "Utilisation: %s [-h] [-qd] commande\n"
#: Cli.php:72
msgid " -h Show this message\n"
msgstr " -h Affiche ce message\n"
#: Cli.php:73
msgid " -q / -d Quiet/Debug mode\n"
msgstr " -q / -d Mode silencieux/debug\n"
#: Cli.php:74
msgid " --trace Trace mode (the most verbose)\n"
msgstr " --trace Mode trace (le plus verbeux)\n"
#: Cli.php:75
msgid " command Command to run\n"
msgstr " command La commande à exécuter\n"
#: Cli.php:77
msgid "Available commands:\n"
msgstr "Commandes disponibles:\n"
#: Cli.php:125
msgid "Only one command could be executed !"
msgstr "Une seul commande peut-être exécutée !"
#: Cli.php:153
#, php-format
msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
"Paramètre \"%s\" invalide.\n"
"Note : Les paramètres/arguments de la requête doivent être placés après "
"celle-ci."
#: Cli.php:178
#, php-format
msgid "An exception occured running command %s"
msgstr "Une exception est survenue en exécutant la commande %s"
#: Db.php:74
msgid "Unable to connect to the database."
msgstr "Impossible de se connecter à la base de données."
#: Email.php:141
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgstr "</hr><p><small>Email initialement destiné à %s.</small></p>"
#: Email.php:142
#, php-format
msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
msgstr ""
"\n"
"\n"
"\n"
"Mail originalement destiné à %s."
#: Email.php:178
#, php-format
msgid "<p><small>%s: %s</small></p>"
msgstr "<p><small>%s: %s</small></p>"
#: Email.php:179
#, php-format
msgid ""
"\n"
"%s: %s"
msgstr ""
"\n"
"%s: %s"
#: Tpl.php:355
msgid "No template specified."
msgstr "Aucun template spécifié."
#: Tpl.php:386
msgid "An error occurred while displaying this page."
msgstr "Une erreur est survenue en affichant cette page."
#: Url.php:141
msgid "Bad request"
msgstr "Mauvaise requête"
#: Url.php:142
msgid "Invalid request."
msgstr "Requête invalide."
#: Url.php:145
msgid "Authentication required"
msgstr "Authentification requise"
#: Url.php:146
msgid "You have to be authenticated to access to this page."
msgstr "Vous devez être authentifié pour accéder à cette page."
#: Url.php:149
msgid "Access denied"
msgstr "Accès interdit"
#: Url.php:150
msgid ""
"You do not have access to this application. If you think this is an error, "
"please contact support."
msgstr ""
"Vous n'avez pas accès à cette application. Si vous pensez qu'il s'agit d'une "
"erreur, merci de prendre contact avec le support."
#: Url.php:153
msgid "Whoops ! Page not found"
msgstr "Oups ! Page introuvable"
#: Url.php:154
msgid "The requested page can not be found."
msgstr "La page demandée est introuvable."
#: Url.php:162
msgid "Error"
msgstr "Erreur"
#: Url.php:163
msgid "An unknown error occurred. If problem persist, please contact support."
msgstr ""
"Une erreur inconnue est survenue. Si le problème persiste, merci de prendre "
"contact avec le support."
#: Url.php:226
msgid ""
"Unable to determine the requested page. If the problem persists, please "
"contact support."
msgstr ""
"Impossible de déterminer la page demandée. Si le problème persiste, merci de "
"prendre contact avec le support."
#: Url.php:376
msgid ""
"Unable to determine the requested page (loop detected). If the problem "
"persists, please contact support."
msgstr ""
"Impossible de déterminer la page demandée (boucle détectée). Si le problème "
"persiste, merci de prendre contact avec le support."
#: Url.php:407
msgid "This request cannot be processed."
msgstr "Cette requête ne peut être traitée."
#: Url.php:420
msgid ""
"Authentication required but force_authentication function is not defined."
msgstr ""
"Authentification requise mais la fonction force_authentication n'est pas "
"définie."
#: Url.php:429
msgid "This request could not be processed correctly."
msgstr "Cette requête n'a put être traitée correctement."
#: I18n.php:122 App.php:120
msgid "Hello world !"
msgstr "Bonjour tout le monde !"
#: I18n.php:142
msgid "Extract messages that need to be translated"
msgstr "Extraire les messages devant être traduit"
#: I18n.php:144
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
"Cette commande peut-être utilisée pour générer/mettre à jour le fichier "
"locales/messages.pot."
#: I18n.php:150
msgid "Update messages in translation PO lang files"
msgstr ""
"Mettre à jour les messages dans les fichiers de traduction PO existants"
#: I18n.php:152
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
"Cette commande peut-être utilisée pour initialiser/mettre à jour les "
"fichiers PO dans les dossiers locales/*/LC_MESSAGES."
#: I18n.php:159
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
"Compiler les messages depuis les fichiers PO de traduction existants vers "
"les fichiers MO et les catalogues JS correspondant"
#: I18n.php:164
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
"Cette commande peut-être utilisée pour compiler les fichiers PO dans les "
"dossiers locales/*/LC_MESSAGES and les catalogues JS dans le dossier locales."
#: I18n.php:336
msgid "Fail to list EesyPHP PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP d'EesyPHP."
#: I18n.php:356
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers PHP "
"d'EesyPHP en utilisant xgettext."
#: I18n.php:369
msgid "Fail to list application PHP files."
msgstr "Une erreur est survenue en listant les fichiers PHP de l'application."
#: I18n.php:389
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
"Impossible d'extraire les messages depuis les fichiers PHP en utilisant "
"xgettext."
#: I18n.php:405
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
"Une erreur est survenue en listant les fichiers JS dans le dossier des "
"fichiers statiques '%s'."
#: I18n.php:427
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
"Une erreur est survenue en extrayant les messages depuis les fichiers JS du "
"dossier des fichiers statiques '%s' en utilisant xgettext."
#: I18n.php:449
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
"Impossible d'extraire les messages depuis le dossier de templates '%s' en "
"utilisant le script tsmarty2c.php."
#: I18n.php:485
msgid "Fail to merge messages using msgcat."
msgstr "Impossible de fusionner les messages en utilisant msgcat."
#: I18n.php:502
#, php-format
msgid "Compendium file %s not found."
msgstr "Fichier compendium %s introuvable."
#: I18n.php:513
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
"Fichier POT introuvable (%s). Merci de lancer la commande extract_messages "
"pour commencer."
#: I18n.php:525 I18n.php:636
#, php-format
msgid "Lang directory '%s' found"
msgstr "Dossier de langue '%s' trouvé"
#: I18n.php:531 I18n.php:642
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
"Le dossier LC_MESSAGES est introuvable dans le dossier de langue '%s', on "
"l'ignore."
#: I18n.php:546
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
"Impossible d'initialiser les messages dans le fichier PO %s en utilisant "
"msginit (%s)."
#: I18n.php:564
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
"Impossible de mettre à jour les messages dans les fichiers PO %s en "
"utilisant msgmerge (%s)."
#: I18n.php:570 I18n.php:650
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
"Le fichier PO est introuvable dans le dossier de langue '%s', on l'ignore."
#: I18n.php:577 I18n.php:690
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr "Impossible d'ouvrir le dossier racine des langues (%s)."
#: I18n.php:606
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s"
#: I18n.php:613
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr "Lien symbolique de catalogue JS pour %s -> %s créé (%s)"
#: I18n.php:617
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
"Impossible de créer le lien symbolique de catalogue JS pour %s -> %s (%s)"
#: I18n.php:623
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr "Le lien symbolique du catalogue JS pour %s -> %s existe déjà (%s)"
#: I18n.php:628
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
"Le catalogue JS pour %s existe, mais il ne s'agit par d'un lien symbolique "
"vers %s (%s)"
#: I18n.php:663
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
"Impossible de compiler les messages depuis le fichier PO %s en tant que "
"fichier MO en utilisant msgfmt (%s)."
#: I18n.php:673
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr "Impossible d'ouvrir le catalogue JS %s en mode écriture (%s)."
#: I18n.php:678
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr "Impossible d'écrire le fichier du catalogue JS %s (%s)."
#: I18n.php:683
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr "Catalogue JS %s créé (%s)."
#: App.php:122
msgid "Hello world!"
msgstr "Salut tout le monde !"
#: static/js/myconfirm.js:4 static/js/myconfirm.js:171
#: static/js/myconfirm.js:200
msgid "Confirmation"
msgstr "Confirmation"
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr "Confirmez-vous ?"
#: static/js/myconfirm.js:11 static/js/myconfirm.js:108
msgid "Cancel"
msgstr "Annuler"
#: static/js/myconfirm.js:17 static/js/myconfirm.js:114
msgid "Validate"
msgstr "Valider"
#: static/js/myconfirm.js:52
msgid "OK"
msgstr "OK"
#: static/js/myconfirm.js:91
msgid "Question"
msgstr "Question"
#: static/js/myconfirm.js:92
msgid "Please enter your answer below:"
msgstr "Merci de saisir vos réponses ci-dessous :"
#: static/js/myconfirm.js:143
msgid "Please wait"
msgstr "Merci de patienter"
#: static/js/myconfirm.js:144
msgid "Please wait while your request is being processed."
msgstr "Merci de patienter pendant le traitement de votre requête."
#: static/js/myconfirm.js:172 static/js/myconfirm.js:201
msgid "Are you sure?"
msgstr "Êtes-vous sure ?"
#: templates/fatal_error.tpl:3
msgid "Oops..."
msgstr "Oups..."
#: templates/fatal_error.tpl:5
msgid ""
"A fatal error has occurred and it is preventing this application from "
"working properly. Please try again later or contact support."
msgstr ""
"Une erreur fatale est survenue et celle-ci empêche cette application de "
"fonctionner correctement. Merci de réessayer ultérieurement ou de prendre "
"contact avec le service support."
#: templates/fatal_error.tpl:7
msgid "Error: %1"
msgstr "Erreur : %1"
#: templates/fatal_error.tpl:9
msgid "Back"
msgstr "Retour"
#: templates/homepage.tpl:5
msgid "Hello, world!"
msgstr "Bonjour tout le monde !"
#: templates/homepage.tpl:6
msgid ""
"This is the default page of a new app using EesyPHP framework. Register your "
"own templates directory and create a <em>homepage.tpl</em> file to overwrite "
"it. You could also overwrite the URL handler for the root of the web "
"application."
msgstr ""
"Il s'agit de la page par défaut d'une nouvelle application utilisant le "
"framework EesyPHP. Configurez votre propre dossier de templates et créer le "
"fichier <em>homepage.tpl</em> pour l'écraser. Vous pouvez également écraser "
"le gestionnaire de l'URL racine de l'application web."

1
locales/fr_FR.js Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8.js

1
locales/fr_FR.utf-8 Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8

1
locales/fr_FR.utf-8.js Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8.js

1
locales/fr_FR.utf8 Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8

1
locales/fr_FR.utf8.js Symbolic link
View file

@ -0,0 +1 @@
fr_FR.UTF8.js

7
locales/headers.pot Normal file
View file

@ -0,0 +1,7 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-02-14 01:17+0100\n"
"PO-Revision-Date: 2023-02-14 01:17+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

44
locales/js-0-messages.pot Normal file
View file

@ -0,0 +1,44 @@
#: static/js/myconfirm.js:4 static/js/myconfirm.js:171
#: static/js/myconfirm.js:200
msgid "Confirmation"
msgstr ""
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr ""
#: static/js/myconfirm.js:11 static/js/myconfirm.js:108
msgid "Cancel"
msgstr ""
#: static/js/myconfirm.js:17 static/js/myconfirm.js:114
msgid "Validate"
msgstr ""
#: static/js/myconfirm.js:44
msgid "Error"
msgstr ""
#: static/js/myconfirm.js:52
msgid "OK"
msgstr ""
#: static/js/myconfirm.js:91
msgid "Question"
msgstr ""
#: static/js/myconfirm.js:92
msgid "Please enter your answer below:"
msgstr ""
#: static/js/myconfirm.js:143
msgid "Please wait"
msgstr ""
#: static/js/myconfirm.js:144
msgid "Please wait while your request is being processed."
msgstr ""
#: static/js/myconfirm.js:172 static/js/myconfirm.js:201
msgid "Are you sure?"
msgstr ""

397
locales/messages.pot Normal file
View file

@ -0,0 +1,397 @@
msgid ""
msgstr ""
"POT-Creation-Date: 2023-02-14 01:17+0100\n"
"PO-Revision-Date: 2023-02-14 01:17+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: Cli.php:34
#, php-format
msgid "The CLI command '%s' already exists."
msgstr ""
#: Cli.php:39
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr ""
#: Cli.php:71
#, php-format
msgid "Usage: %s [-h] [-qd] command\n"
msgstr ""
#: Cli.php:72
msgid " -h Show this message\n"
msgstr ""
#: Cli.php:73
msgid " -q / -d Quiet/Debug mode\n"
msgstr ""
#: Cli.php:74
msgid " --trace Trace mode (the most verbose)\n"
msgstr ""
#: Cli.php:75
msgid " command Command to run\n"
msgstr ""
#: Cli.php:77
msgid "Available commands:\n"
msgstr ""
#: Cli.php:125
msgid "Only one command could be executed !"
msgstr ""
#: Cli.php:153
#, php-format
msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
#: Cli.php:178
#, php-format
msgid "An exception occured running command %s"
msgstr ""
#: Db.php:74
msgid "Unable to connect to the database."
msgstr ""
#: Email.php:141
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgstr ""
#: Email.php:142
#, php-format
msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
msgstr ""
#: Email.php:178
#, php-format
msgid "<p><small>%s: %s</small></p>"
msgstr ""
#: Email.php:179
#, php-format
msgid ""
"\n"
"%s: %s"
msgstr ""
#: Tpl.php:355
msgid "No template specified."
msgstr ""
#: Tpl.php:386
msgid "An error occurred while displaying this page."
msgstr ""
#: Url.php:141
msgid "Bad request"
msgstr ""
#: Url.php:142
msgid "Invalid request."
msgstr ""
#: Url.php:145
msgid "Authentication required"
msgstr ""
#: Url.php:146
msgid "You have to be authenticated to access to this page."
msgstr ""
#: Url.php:149
msgid "Access denied"
msgstr ""
#: Url.php:150
msgid ""
"You do not have access to this application. If you think this is an error, "
"please contact support."
msgstr ""
#: Url.php:153
msgid "Whoops ! Page not found"
msgstr ""
#: Url.php:154
msgid "The requested page can not be found."
msgstr ""
#: Url.php:162
msgid "Error"
msgstr ""
#: Url.php:163
msgid "An unknown error occurred. If problem persist, please contact support."
msgstr ""
#: Url.php:226
msgid ""
"Unable to determine the requested page. If the problem persists, please "
"contact support."
msgstr ""
#: Url.php:376
msgid ""
"Unable to determine the requested page (loop detected). If the problem "
"persists, please contact support."
msgstr ""
#: Url.php:407
msgid "This request cannot be processed."
msgstr ""
#: Url.php:420
msgid ""
"Authentication required but force_authentication function is not defined."
msgstr ""
#: Url.php:429
msgid "This request could not be processed correctly."
msgstr ""
#: I18n.php:122 App.php:120
msgid "Hello world !"
msgstr ""
#: I18n.php:142
msgid "Extract messages that need to be translated"
msgstr ""
#: I18n.php:144
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
#: I18n.php:150
msgid "Update messages in translation PO lang files"
msgstr ""
#: I18n.php:152
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
#: I18n.php:159
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
#: I18n.php:164
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
#: I18n.php:336
msgid "Fail to list EesyPHP PHP files."
msgstr ""
#: I18n.php:356
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
#: I18n.php:369
msgid "Fail to list application PHP files."
msgstr ""
#: I18n.php:389
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
#: I18n.php:405
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
#: I18n.php:427
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
#: I18n.php:449
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
#: I18n.php:485
msgid "Fail to merge messages using msgcat."
msgstr ""
#: I18n.php:502
#, php-format
msgid "Compendium file %s not found."
msgstr ""
#: I18n.php:513
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
#: I18n.php:525 I18n.php:636
#, php-format
msgid "Lang directory '%s' found"
msgstr ""
#: I18n.php:531 I18n.php:642
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:546
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
#: I18n.php:564
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
#: I18n.php:570 I18n.php:650
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:577 I18n.php:690
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr ""
#: I18n.php:606
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr ""
#: I18n.php:613
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr ""
#: I18n.php:617
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
#: I18n.php:623
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr ""
#: I18n.php:628
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
#: I18n.php:663
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
#: I18n.php:673
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr ""
#: I18n.php:678
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr ""
#: I18n.php:683
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr ""
#: App.php:122
msgid "Hello world!"
msgstr ""
#: static/js/myconfirm.js:4 static/js/myconfirm.js:171
#: static/js/myconfirm.js:200
msgid "Confirmation"
msgstr ""
#: static/js/myconfirm.js:5
msgid "Do you confirm?"
msgstr ""
#: static/js/myconfirm.js:11 static/js/myconfirm.js:108
msgid "Cancel"
msgstr ""
#: static/js/myconfirm.js:17 static/js/myconfirm.js:114
msgid "Validate"
msgstr ""
#: static/js/myconfirm.js:52
msgid "OK"
msgstr ""
#: static/js/myconfirm.js:91
msgid "Question"
msgstr ""
#: static/js/myconfirm.js:92
msgid "Please enter your answer below:"
msgstr ""
#: static/js/myconfirm.js:143
msgid "Please wait"
msgstr ""
#: static/js/myconfirm.js:144
msgid "Please wait while your request is being processed."
msgstr ""
#: static/js/myconfirm.js:172 static/js/myconfirm.js:201
msgid "Are you sure?"
msgstr ""
#: templates/fatal_error.tpl:3
msgid "Oops..."
msgstr ""
#: templates/fatal_error.tpl:5
msgid ""
"A fatal error has occurred and it is preventing this application from "
"working properly. Please try again later or contact support."
msgstr ""
#: templates/fatal_error.tpl:7
msgid "Error: %1"
msgstr ""
#: templates/fatal_error.tpl:9
msgid "Back"
msgstr ""
#: templates/homepage.tpl:5
msgid "Hello, world!"
msgstr ""
#: templates/homepage.tpl:6
msgid ""
"This is the default page of a new app using EesyPHP framework. Register your "
"own templates directory and create a <em>homepage.tpl</em> file to overwrite "
"it. You could also overwrite the URL handler for the root of the web "
"application."
msgstr ""

318
locales/php-messages.pot Normal file
View file

@ -0,0 +1,318 @@
#: Cli.php:34
#, php-format
msgid "The CLI command '%s' already exists."
msgstr ""
#: Cli.php:39
#, php-format
msgid "The CLI command '%s' handler is not callable !"
msgstr ""
#: Cli.php:71
#, php-format
msgid "Usage: %s [-h] [-qd] command\n"
msgstr ""
#: Cli.php:72
msgid " -h Show this message\n"
msgstr ""
#: Cli.php:73
msgid " -q / -d Quiet/Debug mode\n"
msgstr ""
#: Cli.php:74
msgid " --trace Trace mode (the most verbose)\n"
msgstr ""
#: Cli.php:75
msgid " command Command to run\n"
msgstr ""
#: Cli.php:77
msgid "Available commands:\n"
msgstr ""
#: Cli.php:125
msgid "Only one command could be executed !"
msgstr ""
#: Cli.php:153
#, php-format
msgid ""
"Invalid parameter \"%s\".\n"
"Note: Command's parameter/argument must be place after the command."
msgstr ""
#: Cli.php:178
#, php-format
msgid "An exception occured running command %s"
msgstr ""
#: Db.php:74
msgid "Unable to connect to the database."
msgstr ""
#: Email.php:141
#, php-format
msgid "</hr><p><small>Mail initialy intended for %s.</small></p>"
msgstr ""
#: Email.php:142
#, php-format
msgid ""
"\n"
"\n"
"\n"
"Mail initialy intended for %s."
msgstr ""
#: Email.php:178
#, php-format
msgid "<p><small>%s: %s</small></p>"
msgstr ""
#: Email.php:179
#, php-format
msgid ""
"\n"
"%s: %s"
msgstr ""
#: Tpl.php:355
msgid "No template specified."
msgstr ""
#: Tpl.php:386
msgid "An error occurred while displaying this page."
msgstr ""
#: Url.php:141
msgid "Bad request"
msgstr ""
#: Url.php:142
msgid "Invalid request."
msgstr ""
#: Url.php:145
msgid "Authentication required"
msgstr ""
#: Url.php:146
msgid "You have to be authenticated to access to this page."
msgstr ""
#: Url.php:149
msgid "Access denied"
msgstr ""
#: Url.php:150
msgid ""
"You do not have access to this application. If you think this is an error, "
"please contact support."
msgstr ""
#: Url.php:153
msgid "Whoops ! Page not found"
msgstr ""
#: Url.php:154
msgid "The requested page can not be found."
msgstr ""
#: Url.php:162
msgid "Error"
msgstr ""
#: Url.php:163
msgid "An unknown error occurred. If problem persist, please contact support."
msgstr ""
#: Url.php:226
msgid ""
"Unable to determine the requested page. If the problem persists, please "
"contact support."
msgstr ""
#: Url.php:376
msgid ""
"Unable to determine the requested page (loop detected). If the problem "
"persists, please contact support."
msgstr ""
#: Url.php:407
msgid "This request cannot be processed."
msgstr ""
#: Url.php:420
msgid ""
"Authentication required but force_authentication function is not defined."
msgstr ""
#: Url.php:429
msgid "This request could not be processed correctly."
msgstr ""
#: I18n.php:122 App.php:120
msgid "Hello world !"
msgstr ""
#: I18n.php:142
msgid "Extract messages that need to be translated"
msgstr ""
#: I18n.php:144
msgid ""
"This command could be used to generate/update locales/messages.pot file."
msgstr ""
#: I18n.php:150
msgid "Update messages in translation PO lang files"
msgstr ""
#: I18n.php:152
msgid ""
"This command could be used to init/update PO files in locales/*/LC_MESSAGES "
"directories."
msgstr ""
#: I18n.php:159
msgid ""
"Compile messages from existing translation PO lang files to corresponding MO "
"files and JS catalogs"
msgstr ""
#: I18n.php:164
msgid ""
"This command could be used to compile PO files in locales/*/LC_MESSAGES "
"directories to MO files and as JS catalogs in locales directory."
msgstr ""
#: I18n.php:336
msgid "Fail to list EesyPHP PHP files."
msgstr ""
#: I18n.php:356
msgid "Fail to extract messages from EesyPHP PHP files using xgettext."
msgstr ""
#: I18n.php:369
msgid "Fail to list application PHP files."
msgstr ""
#: I18n.php:389
msgid "Fail to extract messages from PHP files using xgettext."
msgstr ""
#: I18n.php:405
#, php-format
msgid "Fail to list JS files in the directory of static files '%s'."
msgstr ""
#: I18n.php:427
#, php-format
msgid ""
"Fail to extract messages from JS files in the directory of static files '%s' "
"using xgettext."
msgstr ""
#: I18n.php:449
#, php-format
msgid ""
"Fail to extract messages from templates directory '%s' using tsmarty2c.php "
"script."
msgstr ""
#: I18n.php:485
msgid "Fail to merge messages using msgcat."
msgstr ""
#: I18n.php:502
#, php-format
msgid "Compendium file %s not found."
msgstr ""
#: I18n.php:513
#, php-format
msgid "POT file not found (%s). Please run extract_messages first."
msgstr ""
#: I18n.php:525 I18n.php:636
#, php-format
msgid "Lang directory '%s' found"
msgstr ""
#: I18n.php:531 I18n.php:642
#, php-format
msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:546
#, php-format
msgid "Fail to init messages in %s PO file using msginit (%s)."
msgstr ""
#: I18n.php:564
#, php-format
msgid "Fail to update messages in %s PO file using msgmerge (%s)."
msgstr ""
#: I18n.php:570 I18n.php:650
#, php-format
msgid "PO file not found in lang '%s' directory, ignore it."
msgstr ""
#: I18n.php:577 I18n.php:690
#, php-format
msgid "Fail to open root lang directory (%s)."
msgstr ""
#: I18n.php:606
#, php-format
msgid "Lang alias symlink found: %s -> %s"
msgstr ""
#: I18n.php:613
#, php-format
msgid "JS catalog symlink for %s -> %s created (%s)"
msgstr ""
#: I18n.php:617
#, php-format
msgid "Fail to create JS catalog symlink for %s -> %s (%s)"
msgstr ""
#: I18n.php:623
#, php-format
msgid "JS catalog symlink for %s -> %s already exist (%s)"
msgstr ""
#: I18n.php:628
#, php-format
msgid "JS catalog file for %s already exist, but it's not a symlink to %s (%s)"
msgstr ""
#: I18n.php:663
#, php-format
msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)."
msgstr ""
#: I18n.php:673
#, php-format
msgid "Fail to open %s JS catalog file in write mode (%s)."
msgstr ""
#: I18n.php:678
#, php-format
msgid "Fail to write %s JS catalog in file (%s)."
msgstr ""
#: I18n.php:683
#, php-format
msgid "%s JS catalog writed (%s)."
msgstr ""
#: App.php:122
msgid "Hello world!"
msgstr ""

View file

@ -0,0 +1,32 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
#: templates/fatal_error.tpl:3
msgid "Oops..."
msgstr ""
#: templates/fatal_error.tpl:5
msgid ""
"A fatal error has occurred and it is preventing this application from "
"working properly. Please try again later or contact support."
msgstr ""
#: templates/fatal_error.tpl:7
msgid "Error: %1"
msgstr ""
#: templates/fatal_error.tpl:9
msgid "Back"
msgstr ""
#: templates/homepage.tpl:5
msgid "Hello, world!"
msgstr ""
#: templates/homepage.tpl:6
msgid ""
"This is the default page of a new app using EesyPHP framework. Register your "
"own templates directory and create a <em>homepage.tpl</em> file to overwrite "
"it. You could also overwrite the URL handler for the root of the web "
"application."
msgstr ""

View file

@ -34,7 +34,7 @@ class App {
Config::register_extra_variable('root_directory_path', $root_directory_path); Config::register_extra_variable('root_directory_path', $root_directory_path);
$config_file = Config::replace_variables($config_file); $config_file = Config::replace_variables($config_file);
if (!Config::load($config_file)) { if ($config_file && !Config::load($config_file)) {
Log::fatal('Fail to load configuration file (%s)', $config_file); Log::fatal('Fail to load configuration file (%s)', $config_file);
exit(1); exit(1);
} }
@ -117,9 +117,9 @@ class App {
*/ */
public static function handle_homepage($request) { public static function handle_homepage($request) {
if (Tpl::initialized()) if (Tpl::initialized())
Tpl :: display("homepage.tpl", _("Hello world !")); Tpl :: display("homepage.tpl", I18n::_("Hello world !"));
else else
echo "<h1>"._("Hello world!")."</h1>"; echo "<h1>".I18n::_("Hello world!")."</h1>";
} }
} }

View file

@ -31,12 +31,12 @@ class Cli {
public static function add_command($command, $handler, $short_desc, $usage_args=null, $long_desc=null, public static function add_command($command, $handler, $short_desc, $usage_args=null, $long_desc=null,
$override=false) { $override=false) {
if (array_key_exists($command, self :: $commands) && !$override) { if (array_key_exists($command, self :: $commands) && !$override) {
Log :: error(_("The CLI command '%s' already exists."), $command); Log :: error(I18n::_("The CLI command '%s' already exists."), $command);
return False; return False;
} }
if (!is_callable($handler)) { if (!is_callable($handler)) {
Log :: error(_("The CLI command '%s' handler is not callable !"), $command); Log :: error(I18n::_("The CLI command '%s' handler is not callable !"), $command);
return False; return False;
} }
@ -68,13 +68,13 @@ class Cli {
if ($error) if ($error)
echo "$error\n\n"; echo "$error\n\n";
printf(_("Usage: %s [-h] [-qd] command\n"), basename($argv[0])); echo(I18n::_("Usage: %s [-h] [-qd] command\n", basename($argv[0])));
echo _(" -h Show this message\n"); echo I18n::_(" -h Show this message\n");
echo _(" -q / -d Quiet/Debug mode\n"); echo I18n::_(" -q / -d Quiet/Debug mode\n");
echo _(" --trace Trace mode (the most verbose)\n"); echo I18n::_(" --trace Trace mode (the most verbose)\n");
echo _(" command Command to run\n"); echo I18n::_(" command Command to run\n");
echo "\n"; echo "\n";
echo _("Available commands:\n"); echo I18n::_("Available commands:\n");
foreach (self :: $commands as $command => $info) { foreach (self :: $commands as $command => $info) {
if (self :: $command && $command != self :: $command) if (self :: $command && $command != self :: $command)
@ -82,21 +82,21 @@ class Cli {
echo ( echo (
" ".str_replace( " ".str_replace(
"\n", "\n ", "\n", "\n ",
wordwrap("$command : "._($info['short_desc']))) wordwrap("$command : ".I18n::_($info['short_desc'])))
."\n\n"); ."\n\n");
echo ( echo (
" ".basename($argv[0])." $command ". " ".basename($argv[0])." $command ".
($info['usage_args']?_($info['usage_args']):''). ($info['usage_args']?I18n::_($info['usage_args']):'').
"\n"); "\n");
if ($info['long_desc']) { if ($info['long_desc']) {
if (is_array($info['long_desc'])) { if (is_array($info['long_desc'])) {
$lines = array(); $lines = array();
foreach ($info['long_desc'] as $line) foreach ($info['long_desc'] as $line)
$lines[] = _($line); $lines[] = I18n::_($line);
$info['long_desc'] = implode("\n", $lines); $info['long_desc'] = implode("\n", $lines);
} }
else else
$info['long_desc'] = _($info['long_desc']); $info['long_desc'] = I18n::_($info['long_desc']);
echo "\n ".str_replace("\n", "\n ", wordwrap($info['long_desc']))."\n"; echo "\n ".str_replace("\n", "\n ", wordwrap($info['long_desc']))."\n";
} }
@ -122,7 +122,7 @@ class Cli {
if (!self :: $command) if (!self :: $command)
self :: $command = $args[$i]; self :: $command = $args[$i];
else else
self :: usage(_("Only one command could be executed !")); self :: usage(I18n::_("Only one command could be executed !"));
} }
else { else {
switch($args[$i]) { switch($args[$i]) {
@ -149,7 +149,7 @@ class Cli {
$command_args[] = $args[$i]; $command_args[] = $args[$i];
else else
self :: usage( self :: usage(
_( I18n::_(
"Invalid parameter \"%s\".\nNote: Command's parameter/argument must be place ". "Invalid parameter \"%s\".\nNote: Command's parameter/argument must be place ".
"after the command." "after the command."
), $args[$i] ), $args[$i]
@ -175,7 +175,7 @@ class Cli {
exit($result?0:1); exit($result?0:1);
} }
catch(Exception $e) { catch(Exception $e) {
Log :: exception($e, _("An exception occured running command %s"), self :: $command); Log :: exception($e, I18n::_("An exception occured running command %s"), self :: $command);
exit(1); exit(1);
} }
} }

View file

@ -71,7 +71,7 @@ class Db {
} }
catch(Exception $e) { catch(Exception $e) {
Log :: error("Fail to connect to DB (DSN : '%s') : %s", $dsn, $e->getMessage()); Log :: error("Fail to connect to DB (DSN : '%s') : %s", $dsn, $e->getMessage());
Log :: fatal(_('Unable to connect to the database.')); Log :: fatal(I18n::_('Unable to connect to the database.'));
} }
} }

View file

@ -138,8 +138,8 @@ class Email {
$msg .= sprintf( $msg .= sprintf(
( (
$html? $html?
_("</hr><p><small>Mail initialy intended for %s.</small></p>"): I18n::_("</hr><p><small>Mail initialy intended for %s.</small></p>"):
_("\n\n\nMail initialy intended for %s.") I18n::_("\n\n\nMail initialy intended for %s.")
), ),
(is_array($to)?implode(',', $to):$to)); (is_array($to)?implode(',', $to):$to));
$headers["X-Orig-To"] = $to; $headers["X-Orig-To"] = $to;
@ -175,8 +175,8 @@ class Email {
$msg .= sprintf( $msg .= sprintf(
( (
$html? $html?
_("<p><small>%s: %s</small></p>"): I18n::_("<p><small>%s: %s</small></p>"):
_("\n%s: %s") I18n::_("\n%s: %s")
), ),
strtoupper($header), strtoupper($header),
(is_array($headers[$header])?implode(',', $headers[$header]):$headers[$header])); (is_array($headers[$header])?implode(',', $headers[$header]):$headers[$header]));

View file

@ -5,9 +5,18 @@ namespace EesyPHP;
use Locale; use Locale;
class I18n { class I18n {
// Gettext text domain // Gettext application text domain
public const TEXT_DOMAIN = 'DEFAULT'; public const TEXT_DOMAIN = 'DEFAULT';
// Gettext core text domain
public const CORE_TEXT_DOMAIN = 'EESYPHP';
/**
* The core root directory path of translation files
* @var string
*/
protected static string $core_root_path = __DIR__.'/../locales';
/** /**
* The root directory path of translation files * The root directory path of translation files
* @var string * @var string
@ -42,7 +51,7 @@ class I18n {
self :: $root_path = $root_path; self :: $root_path = $root_path;
if (is_null($default_locale)) if (is_null($default_locale))
self :: $default_locale = App::get('i18n.default_locale', null, 'string'); $default_locale = App::get('i18n.default_locale', null, 'string');
if (!is_null($default_locale)) if (!is_null($default_locale))
self :: $default_locale = $default_locale; self :: $default_locale = $default_locale;
@ -108,10 +117,13 @@ class I18n {
Log :: error("An error occured setting locale to '$locale'"); Log :: error("An error occured setting locale to '$locale'");
// Configure and set the text domain // Configure and set the text domain
$fullpath = bindtextdomain(self :: CORE_TEXT_DOMAIN, self :: $core_root_path);
Log :: trace("Core text domain %s fullpath is '%s'.", self :: CORE_TEXT_DOMAIN, $fullpath);
Log :: trace("Test: ".self::_('Hello world !'));
$fullpath = bindtextdomain(self :: TEXT_DOMAIN, self :: $root_path); $fullpath = bindtextdomain(self :: TEXT_DOMAIN, self :: $root_path);
Log :: trace("Text domain fullpath is '$fullpath'."); Log :: trace("Default text domain %s fullpath is '%s'.", self :: TEXT_DOMAIN, $fullpath);
Log :: trace("Text domain is '".textdomain(self :: TEXT_DOMAIN)."'."); Log :: trace("Default text domain is '".textdomain(self :: TEXT_DOMAIN)."'.");
Log :: trace("Test: "._('Hello world !'));
// JS translation file // JS translation file
if ( if (
@ -207,11 +219,54 @@ class I18n {
return $default; return $default;
} }
/*
********************************************************************
* Translations helpers *
********************************************************************
*/
/** /**
* Helper function: just mark message for translation * Translate a message using gettext
* * @param string $message The string to translate
* @param array $extra_args Extra arguments used to compute the message using sprintf
* @return string The translated and computed message
*/
public static function _(string $message, ...$extra_args) {
$return = dgettext(self :: CORE_TEXT_DOMAIN, $message);
// If extra arguments passed, format message using sprintf
if ($extra_args) {
$return = call_user_func_array(
'sprintf',
array_merge(array($return), $extra_args)
);
}
return $return;
}
/**
* Translate a message with singular and plural forms using gettext
* @param string $singular The singular message to translate
* @param string $plural The plural message to translate
* @param int $count The item count to determine if the singular or the plural forms must to be
* used
* @param array $extra_args Extra arguments used to compute the message using sprintf
* @return string The translated and computed message
*/
public static function ngettext(string $singular, string $plural, int $count, ...$extra_args) {
$return = dngettext(self :: CORE_TEXT_DOMAIN, $singular, $plural, $count);
// If extra arguments passed, format message using sprintf
if ($extra_args) {
$return = call_user_func_array(
'sprintf',
array_merge(array($return), $extra_args)
);
}
return $return;
}
/**
* Just mark message for translation
* @param string $msg The message to translate * @param string $msg The message to translate
*
* @return string The message without transformation * @return string The message without transformation
*/ */
public static function ___($msg) { public static function ___($msg) {
@ -263,74 +318,82 @@ class I18n {
* @return void * @return void
*/ */
public static function cli_extract_messages($command_args) { public static function cli_extract_messages($command_args) {
$core_mode = in_array('--core', $command_args);
$root_path = $core_mode?self::$core_root_path:self::$root_path;
// Store list of generated POT files // Store list of generated POT files
$pot_files = array(); $pot_files = array();
// List EesyPHP PHP files to parse if ($core_mode) {
$eesyphp_php_files = run_external_command( // List EesyPHP PHP files to parse
array('find', '-name', "'*.php'"), $eesyphp_php_files = run_external_command(
null, // no STDIN data array('find', '-name', "'*.php'"),
false, // do not escape command args (already done) null, // no STDIN data
__DIR__ // Run from EesyPHP src directory false, // do not escape command args (already done)
); __DIR__ // Run from EesyPHP src directory
if (!is_array($eesyphp_php_files) || $eesyphp_php_files[0] != 0) { );
Log :: fatal(_("Fail to list EesyPHP PHP files.")); if (!is_array($eesyphp_php_files) || $eesyphp_php_files[0] != 0) {
Log :: fatal(self::_("Fail to list EesyPHP PHP files."));
}
// Extract messages from EesyPHP PHP files using xgettext
$pot_file = "$root_path/php-messages.pot";
$result = run_external_command(
array(
"xgettext",
"--from-code utf-8",
"--language=PHP",
"-o", $pot_file, // Output
"--omit-header", // No POT header
"--keyword=___", // Handle custom ___() translation function
"--files=-" // Read files to parse from STDIN
),
$eesyphp_php_files[1], // Pass PHP files list via STDIN
true, // Escape parameters
__DIR__ // Run from EesyPHP src directory
);
if (!is_array($result) || $result[0] != 0)
Log :: fatal(self::_("Fail to extract messages from EesyPHP PHP files using xgettext."));
if (is_file($pot_file))
$pot_files[] = $pot_file;
} }
else {
// List application PHP files to parse
$php_files = run_external_command(
array('find', '-name', "'*.php'"),
null, // no STDIN data
false, // do not escape command args (already done)
App :: root_directory_path() // Run from Application root directory
);
if (!is_array($php_files) || $php_files[0] != 0) {
Log :: fatal(self::_("Fail to list application PHP files."));
}
// Extract messages from EesyPHP PHP files using xgettext // Extract messages from PHP files using xgettext
$pot_file = self :: $root_path."/eesyphp-messages.pot"; $pot_file = "$root_path/php-messages.pot";
$result = run_external_command( $result = run_external_command(
array( array(
"xgettext", "xgettext",
"--from-code utf-8", "--from-code utf-8",
"--language=PHP", "--language=PHP",
"-o", $pot_file, // Output "-o", $pot_file, // Output
"--omit-header", // No POT header "--omit-header", // No POT header
"--keyword=___", // Handle custom ___() translation function "--keyword=___", // Handle custom ___() translation function
"--files=-" // Read files to parse from STDIN "--files=-" // Read files to parse from STDIN
), ),
$eesyphp_php_files[1], // Pass PHP files list via STDIN $php_files[1], // Pass PHP files list via STDIN
true, // Escape parameters true, // Escape parameters
__DIR__ // Run from EesyPHP src directory App :: root_directory_path() // Run from EesyPHP src directory
); );
if (!is_array($result) || $result[0] != 0) if (!is_array($result) || $result[0] != 0)
Log :: fatal(_("Fail to extract messages from EesyPHP PHP files using xgettext.")); Log :: fatal(self::_("Fail to extract messages from PHP files using xgettext."));
if (is_file($pot_file)) $pot_files[] = "$root_path/php-messages.pot";
$pot_files[] = $pot_file;
// List application PHP files to parse
$php_files = run_external_command(
array('find', '-name', "'*.php'"),
null, // no STDIN data
false, // do not escape command args (already done)
App :: root_directory_path() // Run from Application root directory
);
if (!is_array($php_files) || $php_files[0] != 0) {
Log :: fatal(_("Fail to list application PHP files."));
} }
// Extract messages from PHP files using xgettext
$pot_file = self :: $root_path."/php-messages.pot";
$result = run_external_command(
array(
"xgettext",
"--from-code utf-8",
"--language=PHP",
"-o", $pot_file, // Output
"--omit-header", // No POT header
"--keyword=___", // Handle custom ___() translation function
"--files=-" // Read files to parse from STDIN
),
$php_files[1], // Pass PHP files list via STDIN
true, // Escape parameters
App :: root_directory_path() // Run from EesyPHP src directory
);
if (!is_array($result) || $result[0] != 0)
Log :: fatal(_("Fail to extract messages from PHP files using xgettext."));
$pot_files[] = self :: $root_path."/php-messages.pot";
// Extract messages from JS files using xgettext in each registered static directories // Extract messages from JS files using xgettext in each registered static directories
foreach(Tpl::static_directories() as $idx => $static_directory) { foreach(Tpl::static_directories() as $idx => $static_directory) {
if ($core_mode && $static_directory != Tpl::$core_static_directory) continue;
if (!$core_mode && $static_directory == Tpl::$core_static_directory) continue;
// List JS files to parse // List JS files to parse
$result = run_external_command( $result = run_external_command(
array('find', escapeshellarg(basename($static_directory)), '-name', "'*.js'"), array('find', escapeshellarg(basename($static_directory)), '-name', "'*.js'"),
@ -339,12 +402,12 @@ class I18n {
dirname($static_directory) // Run from parent directory dirname($static_directory) // Run from parent directory
); );
if (!is_array($result) || $result[0] != 0) { if (!is_array($result) || $result[0] != 0) {
Log :: fatal(_("Fail to list JS files in the directory of static files '%s'."), $static_directory); Log :: fatal(self::_("Fail to list JS files in the directory of static files '%s'."), $static_directory);
return; return;
} }
// Extract messages from JS files using xgettext // Extract messages from JS files using xgettext
$pot_file = self :: $root_path."/js-$idx-messages.pot"; $pot_file = "$root_path/js-$idx-messages.pot";
$result = run_external_command( $result = run_external_command(
array( array(
"xgettext", "xgettext",
@ -361,7 +424,7 @@ class I18n {
); );
if (!is_array($result) || $result[0] != 0) if (!is_array($result) || $result[0] != 0)
Log :: fatal( Log :: fatal(
_("Fail to extract messages from JS files in the directory of static files '%s' using xgettext."), self::_("Fail to extract messages from JS files in the directory of static files '%s' using xgettext."),
$static_directory); $static_directory);
if (is_file($pot_file)) if (is_file($pot_file))
$pot_files[] = $pot_file; $pot_files[] = $pot_file;
@ -369,6 +432,8 @@ class I18n {
if (Tpl :: initialized()) { if (Tpl :: initialized()) {
foreach (Tpl :: templates_directories() as $idx => $templates_directory) { foreach (Tpl :: templates_directories() as $idx => $templates_directory) {
if ($core_mode && $templates_directory != Tpl::$core_templates_directory) continue;
if (!$core_mode && $templates_directory == Tpl::$core_templates_directory) continue;
// Extract messages from templates files using tsmarty2c.php // Extract messages from templates files using tsmarty2c.php
$result = run_external_command( $result = run_external_command(
array( array(
@ -381,11 +446,11 @@ class I18n {
); );
if (!is_array($result) || $result[0] != 0) if (!is_array($result) || $result[0] != 0)
Log :: fatal( Log :: fatal(
_("Fail to extract messages from templates directory '%s' using tsmarty2c.php script."), self::_("Fail to extract messages from templates directory '%s' using tsmarty2c.php script."),
$templates_directory $templates_directory
); );
if (!$result[1]) continue; if (!$result[1]) continue;
$pot_file = self :: $root_path."/templates-$idx-messages.pot"; $pot_file = "$root_path/templates-$idx-messages.pot";
$fd = fopen($pot_file, 'w'); $fd = fopen($pot_file, 'w');
fwrite($fd, $result[1]); fwrite($fd, $result[1]);
fclose($fd); fclose($fd);
@ -393,7 +458,7 @@ class I18n {
} }
} }
$fd = fopen(self :: $root_path."/headers.pot", 'w'); $fd = fopen("$root_path/headers.pot", 'w');
$headers = array( $headers = array(
'msgid ""', 'msgid ""',
'msgstr ""', 'msgstr ""',
@ -411,13 +476,13 @@ class I18n {
array( array(
'msgcat', 'msgcat',
"-t", "utf-8", "--use-first", "-t", "utf-8", "--use-first",
"-o", self :: $root_path."/messages.pot", "-o", "$root_path/messages.pot",
self :: $root_path."/headers.pot", "$root_path/headers.pot",
), ),
$pot_files $pot_files
)); ));
if (!is_array($result) || $result[0] != 0) if (!is_array($result) || $result[0] != 0)
Log :: fatal(_("Fail to merge messages using msgcat.")); Log :: fatal(self::_("Fail to merge messages using msgcat."));
} }
/** /**
@ -428,40 +493,47 @@ class I18n {
* @return bool * @return bool
*/ */
public static function cli_update_messages($command_args) { public static function cli_update_messages($command_args) {
$core_mode = false;
$compendium_args = array(); $compendium_args = array();
foreach ($command_args as $path) { foreach ($command_args as $arg) {
if (!file_exists($path)) if ($arg == '--core')
Log :: fatal(_("Compendium file %s not found."), $path); $core_mode = true;
$compendium_args[] = '-C'; else if (!file_exists($arg))
$compendium_args[] = $path; Log :: fatal(self::_("Compendium file %s not found."), $arg);
else {
$compendium_args[] = '-C';
$compendium_args[] = $arg;
}
} }
$domain = $core_mode?self::CORE_TEXT_DOMAIN:self::TEXT_DOMAIN;
$root_path = $core_mode?self::$core_root_path:self::$root_path;
$pot_file = self :: $root_path."/messages.pot"; $pot_file = "$root_path/messages.pot";
if (!is_file($pot_file)) if (!is_file($pot_file))
Log :: fatal(_("POT file not found (%s). Please run extract_messages first."), $pot_file); Log :: fatal(self::_("POT file not found (%s). Please run extract_messages first."), $pot_file);
if ($dh = opendir(self :: $root_path)) { if ($dh = opendir($root_path)) {
$error = False; $error = False;
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if ( if (
!is_dir(self :: $root_path . '/' . $file) || !is_dir("$root_path/$file") ||
in_array($file, array('.', '..')) || in_array($file, array('.', '..')) ||
is_link(self :: $root_path . '/' . $file) is_link("$root_path/$file")
) )
continue; continue;
Log :: debug(_("Lang directory '%s' found"), $file); Log :: debug(self::_("Lang directory '%s' found"), $file);
// Check LC_MESSAGES directory exists // Check LC_MESSAGES directory exists
$lang = $file; $lang = $file;
$lang_dir = self :: $root_path . '/' . $file . '/LC_MESSAGES' ; $lang_dir = "$root_path/$file/LC_MESSAGES" ;
if (!is_dir($lang_dir)) { if (!is_dir($lang_dir)) {
Log :: debug(_("LC_MESSAGES directory not found in lang '%s' directory, ignore it."), Log :: debug(self::_("LC_MESSAGES directory not found in lang '%s' directory, ignore it."),
$lang); $lang);
continue; continue;
} }
$po_file = $lang_dir . '/' . self :: TEXT_DOMAIN . '.po'; $po_file = "$lang_dir/$domain.po";
$created = false; $created = false;
if (!is_file($po_file)) { if (!is_file($po_file)) {
// Init PO file from POT file using msginit // Init PO file from POT file using msginit
@ -471,7 +543,7 @@ class I18n {
if (is_array($result) && $result[0] == 0) { if (is_array($result) && $result[0] == 0) {
$created = true; $created = true;
} else { } else {
Log :: error(_("Fail to init messages in %s PO file using msginit (%s)."), Log :: error(self::_("Fail to init messages in %s PO file using msginit (%s)."),
$lang, $po_file); $lang, $po_file);
$error = True; $error = True;
} }
@ -489,20 +561,20 @@ class I18n {
) )
); );
if (!is_array($result) || $result[0] != 0) { if (!is_array($result) || $result[0] != 0) {
Log :: error(_("Fail to update messages in %s PO file using msgmerge (%s)."), Log :: error(self::_("Fail to update messages in %s PO file using msgmerge (%s)."),
$lang, $po_file); $lang, $po_file);
$error = True; $error = True;
} }
} }
elseif (!$created) { elseif (!$created) {
Log :: debug(_("PO file not found in lang '%s' directory, ignore it."), $lang); Log :: debug(self::_("PO file not found in lang '%s' directory, ignore it."), $lang);
} }
} }
closedir($dh); closedir($dh);
return !$error; return !$error;
} }
Log :: fatal(_("Fail to open root lang directory (%s)."), App :: root_directory_path()); Log :: fatal(self::_("Fail to open root lang directory (%s)."), App :: root_directory_path());
return false; return false;
} }
@ -514,43 +586,46 @@ class I18n {
* @return bool * @return bool
*/ */
public static function cli_compile_messages($command_args) { public static function cli_compile_messages($command_args) {
if ($dh = opendir(self :: $root_path)) { $core_mode = in_array('--core', $command_args);
$domain = $core_mode?self::CORE_TEXT_DOMAIN:self::TEXT_DOMAIN;
$root_path = $core_mode?self::$core_root_path:self::$root_path;
if ($dh = opendir($root_path)) {
$error = False; $error = False;
while (($file = readdir($dh)) !== false) { while (($file = readdir($dh)) !== false) {
if ( if (
!is_dir(self :: $root_path . '/' . $file) || !is_dir("$root_path/$file") ||
in_array($file, array('.', '..')) in_array($file, array('.', '..'))
) )
continue; continue;
if (is_link(self :: $root_path . '/' . $file)) { if (is_link("$root_path/$file")) {
$real_lang_dir = readlink(self :: $root_path . '/' . $file); $real_lang_dir = readlink("$root_path/$file");
if (dirname($real_lang_dir) != '.' || !is_dir(self :: $root_path . '/' . $real_lang_dir)) if (dirname($real_lang_dir) != '.' || !is_dir("$root_path/$real_lang_dir"))
continue; continue;
$lang = $file; $lang = $file;
Log :: debug(_("Lang alias symlink found: %s -> %s"), $lang, $real_lang_dir); Log :: debug(self::_("Lang alias symlink found: %s -> %s"), $lang, $real_lang_dir);
// Create JS catalog symlink (if not exists) // Create JS catalog symlink (if not exists)
$js_link = self :: $root_path."/$lang.js"; $js_link = "$root_path/$lang.js";
$link_target = "$real_lang_dir.js"; $link_target = "$real_lang_dir.js";
if (!file_exists($js_link)) { if (!file_exists($js_link)) {
if (symlink($link_target, $js_link)) { if (symlink($link_target, $js_link)) {
Log :: info(_("JS catalog symlink for %s -> %s created (%s)"), Log :: info(self::_("JS catalog symlink for %s -> %s created (%s)"),
$lang, $real_lang_dir, $js_link); $lang, $real_lang_dir, $js_link);
} }
else { else {
Log :: error(_("Fail to create JS catalog symlink for %s -> %s (%s)"), Log :: error(self::_("Fail to create JS catalog symlink for %s -> %s (%s)"),
$lang, $real_lang_dir, $js_link); $lang, $real_lang_dir, $js_link);
$error = True; $error = True;
} }
} }
elseif (readlink($js_link) == $link_target) { elseif (readlink($js_link) == $link_target) {
Log :: debug(_("JS catalog symlink for %s -> %s already exist (%s)"), Log :: debug(self::_("JS catalog symlink for %s -> %s already exist (%s)"),
$lang, $real_lang_dir, $js_link); $lang, $real_lang_dir, $js_link);
} }
else { else {
Log :: warning( Log :: warning(
_("JS catalog file for %s already exist, but it's not a symlink to %s (%s)"), self::_("JS catalog file for %s already exist, but it's not a symlink to %s (%s)"),
$lang, $real_lang_dir, $js_link $lang, $real_lang_dir, $js_link
); );
$error = True; $error = True;
@ -558,21 +633,21 @@ class I18n {
continue; continue;
} }
Log :: debug(_("Lang directory '%s' found"), $file); Log :: debug(self::_("Lang directory '%s' found"), $file);
// Check LC_MESSAGES directory exists // Check LC_MESSAGES directory exists
$lang = $file; $lang = $file;
$lang_dir = self :: $root_path . '/' . $file . '/LC_MESSAGES' ; $lang_dir = "$root_path/$file/LC_MESSAGES" ;
if (!is_dir($lang_dir)) { if (!is_dir($lang_dir)) {
Log :: debug(_("LC_MESSAGES directory not found in lang '%s' directory, ignore it."), Log :: debug(self::_("LC_MESSAGES directory not found in lang '%s' directory, ignore it."),
$lang); $lang);
continue; continue;
} }
// Test .PO file is present // Test .PO file is present
$po_file = $lang_dir . '/' . self :: TEXT_DOMAIN . '.po'; $po_file = "$lang_dir/$domain.po";
if (!is_file($po_file)) { if (!is_file($po_file)) {
Log :: debug(_("PO file not found in lang '%s' directory, ignore it."), Log :: debug(self::_("PO file not found in lang '%s' directory, ignore it."),
$lang); $lang);
continue; continue;
} }
@ -585,7 +660,7 @@ class I18n {
); );
if (!is_array($result) || $result[0] != 0) { if (!is_array($result) || $result[0] != 0) {
Log :: error( Log :: error(
_("Fail to compile messages from %s PO file as MO file using msgfmt (%s)."), self::_("Fail to compile messages from %s PO file as MO file using msgfmt (%s)."),
$lang, $po_file $lang, $po_file
); );
$error = True; $error = True;
@ -593,26 +668,26 @@ class I18n {
// Compile messages from PO file to JS catalog file // Compile messages from PO file to JS catalog file
$js_catalog = self :: po2json($lang, $po_file); $js_catalog = self :: po2json($lang, $po_file);
$js_file = self :: $root_path."/$lang.js"; $js_file = "$root_path/$lang.js";
if(!$fd = fopen($js_file, 'w')) { if(!$fd = fopen($js_file, 'w')) {
Log :: error(_("Fail to open %s JS catalog file in write mode (%s)."), Log :: error(self::_("Fail to open %s JS catalog file in write mode (%s)."),
$lang, $js_file); $lang, $js_file);
$error = True; $error = True;
} }
elseif (fwrite($fd, sprintf("translations_data = %s;", $js_catalog)) === false) { elseif (fwrite($fd, sprintf("translations_data = %s;", $js_catalog)) === false) {
Log :: error(_("Fail to write %s JS catalog in file (%s)."), Log :: error(self::_("Fail to write %s JS catalog in file (%s)."),
$lang, $js_file); $lang, $js_file);
$error = True; $error = True;
} }
else { else {
Log :: info(_("%s JS catalog writed (%s)."), $lang, $js_file); Log :: info(self::_("%s JS catalog writed (%s)."), $lang, $js_file);
} }
} }
closedir($dh); closedir($dh);
return !$error; return !$error;
} }
Log :: fatal(_("Fail to open root lang directory (%s)."), App :: root_directory_path()); Log :: fatal(self::_("Fail to open root lang directory (%s)."), App :: root_directory_path());
return false; return false;
} }

View file

@ -52,7 +52,7 @@ class SentryIntegration {
'id' => isset($auth_user) && $auth_user?$auth_user['uid']:null, 'id' => isset($auth_user) && $auth_user?$auth_user['uid']:null,
'email' => isset($auth_user) && $auth_user?$auth_user['mail']:null, 'email' => isset($auth_user) && $auth_user?$auth_user['mail']:null,
'segment' => isset($auth_user) && $auth_user?$auth_user['type']:null, 'segment' => isset($auth_user) && $auth_user?$auth_user['type']:null,
'ip_address' => $_SERVER['REMOTE_ADDR'], 'ip_address' => php_sapi_name()=='cli'?null:$_SERVER['REMOTE_ADDR'],
]); ]);
}); });

View file

@ -21,6 +21,12 @@ class Tpl {
*/ */
public static $smarty_security_policy = null; public static $smarty_security_policy = null;
/**
* Core Smarty templates directory
* @var string
*/
public static string $core_templates_directory;
/** /**
* Smarty templates directories path with their priority * Smarty templates directories path with their priority
* @var array<string,int> * @var array<string,int>
@ -39,6 +45,12 @@ class Tpl {
*/ */
public static bool $_debug_ajax; public static bool $_debug_ajax;
/**
* Core static directory
* @var string|null
*/
public static $core_static_directory = null;
/** /**
* Static directories path with their priority * Static directories path with their priority
* @var array<string,array> * @var array<string,array>
@ -86,8 +98,8 @@ class Tpl {
public static function init($templates_dir=null, $templates_c_dir=null, $debug_ajax=null, public static function init($templates_dir=null, $templates_c_dir=null, $debug_ajax=null,
$static_root_url=null) { $static_root_url=null) {
// Handle templates directories // Handle templates directories
$default_templates_directory = realpath(__DIR__."/../templates"); self :: $core_templates_directory = realpath(__DIR__."/../templates");
self :: register_templates_directory($default_templates_directory); self :: register_templates_directory(self :: $core_templates_directory);
if (is_null($templates_dir)) if (is_null($templates_dir))
$templates_dir = App::get('templates.directory', null, 'string'); $templates_dir = App::get('templates.directory', null, 'string');
if ($templates_dir) { if ($templates_dir) {
@ -127,7 +139,7 @@ class Tpl {
if (substr($unique_name, -1) == '/') if (substr($unique_name, -1) == '/')
$unique_name = substr($unique_name, 0, -1); $unique_name = substr($unique_name, 0, -1);
} }
$templates_c_dir = sys_get_temp_dir().str_replace( $templates_c_dir = sys_get_temp_dir().'/'.str_replace(
'/', '_', "eesyphp_templates_cache_$unique_name" '/', '_', "eesyphp_templates_cache_$unique_name"
); );
if (!is_dir($templates_c_dir) && !mkdir($templates_c_dir)) { if (!is_dir($templates_c_dir) && !mkdir($templates_c_dir)) {
@ -138,7 +150,7 @@ class Tpl {
} }
} }
self :: $smarty = new Smarty(); self :: $smarty = new Smarty();
self :: $smarty->setTemplateDir($default_templates_directory); self :: $smarty->setTemplateDir(self :: $core_templates_directory);
self :: $smarty->setCompileDir($templates_c_dir); self :: $smarty->setCompileDir($templates_c_dir);
self :: $smarty->registerResource('Tpl', new TplSmartyResource()); self :: $smarty->registerResource('Tpl', new TplSmartyResource());
if (is_null($debug_ajax)) if (is_null($debug_ajax))
@ -154,8 +166,8 @@ class Tpl {
if (substr($static_root_url, -1) != '/') if (substr($static_root_url, -1) != '/')
$static_root_url = "$static_root_url/"; $static_root_url = "$static_root_url/";
self :: $static_root_url = $static_root_url; self :: $static_root_url = $static_root_url;
$default_static_directory = realpath(__DIR__."/../static"); self :: $core_static_directory = realpath(__DIR__."/../static");
self :: register_static_directory($default_static_directory, 100); self :: register_static_directory(self :: $core_static_directory, 100);
self :: register_function('static_url', array('EesyPHP\\Tpl', 'smarty_static_url')); self :: register_function('static_url', array('EesyPHP\\Tpl', 'smarty_static_url'));
foreach(App :: get('templates.static_directories', array(), 'array') as $path) foreach(App :: get('templates.static_directories', array(), 'array') as $path)
@ -322,6 +334,10 @@ class Tpl {
self :: assign('css', self :: $css_files); self :: assign('css', self :: $css_files);
self :: assign('js', self :: $js_files); self :: assign('js', self :: $js_files);
// I18n text domains
self :: assign('CORE_TEXT_DOMAIN', I18n :: CORE_TEXT_DOMAIN);
self :: assign('TEXT_DOMAIN', I18n :: TEXT_DOMAIN);
// Authenticated user info // Authenticated user info
if (isset($auth_user)) if (isset($auth_user))
self :: assign('auth_user', $auth_user); self :: assign('auth_user', $auth_user);
@ -336,7 +352,7 @@ class Tpl {
*/ */
public static function display($template, $pagetitle=null, ...$extra_args) { public static function display($template, $pagetitle=null, ...$extra_args) {
if (!$template) { if (!$template) {
Log :: fatal(_("No template specified.")); Log :: fatal(I18n::_("No template specified."));
return; return;
} }
@ -367,7 +383,7 @@ class Tpl {
catch (Exception $e) { catch (Exception $e) {
Log :: exception($e, "Smarty - An exception occured displaying template '$template'"); Log :: exception($e, "Smarty - An exception occured displaying template '$template'");
if ($template != 'fatal_error.tpl') if ($template != 'fatal_error.tpl')
Log :: fatal(_("An error occurred while displaying this page.")); Log :: fatal(I18n::_("An error occurred while displaying this page."));
return; return;
} }
unset($_SESSION['errors']); unset($_SESSION['errors']);

View file

@ -138,20 +138,20 @@ class Url {
public static function error_page($request=null, $error_code=null) { public static function error_page($request=null, $error_code=null) {
$http_errors = array( $http_errors = array(
400 => array( 400 => array(
'pagetitle' => _("Bad request"), 'pagetitle' => I18n::_("Bad request"),
'message' => _("Invalid request."), 'message' => I18n::_("Invalid request."),
), ),
401 => array( 401 => array(
'pagetitle' => _("Authentication required"), 'pagetitle' => I18n::_("Authentication required"),
'message' => _("You have to be authenticated to access to this page."), 'message' => I18n::_("You have to be authenticated to access to this page."),
), ),
403 => array( 403 => array(
'pagetitle' => _("Access denied"), 'pagetitle' => I18n::_("Access denied"),
'message' => _("You do not have access to this application. If you think this is an error, please contact support."), 'message' => I18n::_("You do not have access to this application. If you think this is an error, please contact support."),
), ),
404 => array( 404 => array(
'pagetitle' => _("Whoops ! Page not found"), 'pagetitle' => I18n::_("Whoops ! Page not found"),
'message' => _("The requested page can not be found."), 'message' => I18n::_("The requested page can not be found."),
), ),
); );
$error_code = ($error_code?intval($error_code):400); $error_code = ($error_code?intval($error_code):400);
@ -159,8 +159,8 @@ class Url {
$error = $http_errors[intval($error_code)]; $error = $http_errors[intval($error_code)];
else else
$error = array( $error = array(
'pagetitle' => _('Error'), 'pagetitle' => I18n::_('Error'),
'message' => _('An unknown error occurred. If problem persist, please contact support.'), 'message' => I18n::_('An unknown error occurred. If problem persist, please contact support.'),
); );
http_response_code($error_code); http_response_code($error_code);
@ -223,7 +223,7 @@ class Url {
$current_url = self :: get_current_url(); $current_url = self :: get_current_url();
if ($current_url === false) { if ($current_url === false) {
Log :: fatal( Log :: fatal(
_('Unable to determine the requested page. '. I18n::_('Unable to determine the requested page. '.
'If the problem persists, please contact support.') 'If the problem persists, please contact support.')
); );
exit(); exit();
@ -373,7 +373,7 @@ class Url {
// Prevent loop // Prevent loop
if (isset($_SESSION['last_redirect']) && $_SESSION['last_redirect'] == $url) if (isset($_SESSION['last_redirect']) && $_SESSION['last_redirect'] == $url)
Log :: fatal( Log :: fatal(
_('Unable to determine the requested page (loop detected). '. I18n::_('Unable to determine the requested page (loop detected). '.
'If the problem persists, please contact support.')); 'If the problem persists, please contact support.'));
else else
$_SESSION['last_redirect'] = $url; $_SESSION['last_redirect'] = $url;
@ -404,7 +404,7 @@ class Url {
Log :: error( Log :: error(
"URL handler function %s does not exists !", "URL handler function %s does not exists !",
format_callable($request -> handler)); format_callable($request -> handler));
Log :: fatal(_("This request cannot be processed.")); Log :: fatal(I18n::_("This request cannot be processed."));
} }
if ($request -> api_mode) if ($request -> api_mode)
@ -417,7 +417,7 @@ class Url {
if (function_exists('force_authentication')) if (function_exists('force_authentication'))
force_authentication(); force_authentication();
else else
Log :: fatal(_("Authentication required but force_authentication function is not defined.")); Log :: fatal(I18n::_("Authentication required but force_authentication function is not defined."));
try { try {
call_user_func($request -> handler, $request); call_user_func($request -> handler, $request);
@ -426,7 +426,7 @@ class Url {
Log :: exception( Log :: exception(
$e, "An exception occured running URL handler function %s()", $e, "An exception occured running URL handler function %s()",
format_callable($request -> handler)); format_callable($request -> handler));
Log :: fatal(_("This request could not be processed correctly.")); Log :: fatal(I18n::_("This request could not be processed correctly."));
} }
$sentry_span->finish(); $sentry_span->finish();
} }

View file

@ -1,10 +1,10 @@
{extends file='Tpl:empty.tpl'} {extends file='Tpl:empty.tpl'}
{block name="content"} {block name="content"}
<h1 class="center">Oops ...</h1> <h1 class="center">{t domain=$CORE_TEXT_DOMAIN}Oops...{/t}</h1>
<p class="center">{t}A fatal error has occurred and it is preventing this application from working properly. Please try again later or contact support.{/t}</p> <p class="center">{t domain=$CORE_TEXT_DOMAIN}A fatal error has occurred and it is preventing this application from working properly. Please try again later or contact support.{/t}</p>
<p class='fatal_error_msg'>{t 1=$fatal_error}Error: %1{/t}</p> <p class='fatal_error_msg'>{t 1=$fatal_error domain=$CORE_TEXT_DOMAIN}Error: %1{/t}</p>
<div class="center"><a href="javascript:history.back()" class="btn btn-primary"><i class="fa fa-undo"></i> {t}Back{/t}</a></div> <div class="center"><a href="javascript:history.back()" class="btn btn-primary"><i class="fa fa-undo"></i> {t domain=$CORE_TEXT_DOMAIN}Back{/t}</a></div>
{/block} {/block}

View file

@ -2,7 +2,7 @@
{block name="pagetitle"}{/block} {block name="pagetitle"}{/block}
{block name="content"} {block name="content"}
<div class="jumbotron"> <div class="jumbotron">
<h1 class="display-4">{t}Hello, world!{/t}</h1> <h1 class="display-4">{t domain=$CORE_TEXT_DOMAIN}Hello, world!{/t}</h1>
<p class="lead">{t escape=off}This is the default page of a new app using EesyPHP framework. Register your own templates directory and create a <em>homepage.tpl</em> file to overwrite it. You could also overwrite the URL handler for the root of the web application.{/t}</p> <p class="lead">{t escape=off domain=$CORE_TEXT_DOMAIN}This is the default page of a new app using EesyPHP framework. Register your own templates directory and create a <em>homepage.tpl</em> file to overwrite it. You could also overwrite the URL handler for the root of the web application.{/t}</p>
</div> </div>
{/block} {/block}