diff --git a/composer.json b/composer.json index e1c55c5..3fc8247 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,6 @@ "brenard/php-unidecode": "dev-master", "smarty/smarty": "3.1.34", "smarty-gettext/smarty-gettext": "^1.6", - "smarty-gettext/tsmarty2c": "^0.2.1", "sepia/po-parser": "^6.0", "sentry/sdk": "^3.3", "ext-pdo": "^7.3", diff --git a/example/locales/eesyphp-messages.pot b/example/locales/eesyphp-messages.pot index ad93693..7bd55b3 100644 --- a/example/locales/eesyphp-messages.pot +++ b/example/locales/eesyphp-messages.pot @@ -188,114 +188,127 @@ msgid "" "directories to MO files and as JSON catalogs in public_html/translations." msgstr "" -#: I18n.php:277 I18n.php:307 -msgid "Fail to list PHP files." +#: I18n.php:277 +msgid "Fail to list EesyPHP PHP files." msgstr "" -#: I18n.php:296 I18n.php:326 +#: 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:338 +#: I18n.php:342 #, php-format -msgid "Fail to list JS files in '%s' static directory." +msgid "Fail to list JS files in the directory of static files '%s'." msgstr "" -#: I18n.php:358 -msgid "Fail to extract messages from JS files using xgettext." -msgstr "" - -#: I18n.php:374 +#: I18n.php:364 +#, php-format msgid "" -"Fail to extract messages from template files using tsmarty2c.php script." +"Fail to extract messages from JS files in the directory of static files '%s' " +"using xgettext." msgstr "" -#: I18n.php:402 +#: 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:416 +#: I18n.php:434 #, php-format msgid "Compendium file %s not found." msgstr "" -#: I18n.php:423 +#: I18n.php:441 #, php-format msgid "POT file not found (%s). Please run extract_messages first." msgstr "" -#: I18n.php:435 I18n.php:543 +#: I18n.php:453 I18n.php:561 #, php-format msgid "Lang directory '%s' found" msgstr "" -#: I18n.php:441 I18n.php:549 +#: I18n.php:459 I18n.php:567 #, php-format msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it." msgstr "" -#: I18n.php:456 +#: I18n.php:474 #, php-format msgid "Fail to init messages in %s PO file using msginit (%s)." msgstr "" -#: I18n.php:474 +#: I18n.php:492 #, php-format msgid "Fail to update messages in %s PO file using msgmerge (%s)." msgstr "" -#: I18n.php:480 I18n.php:557 +#: I18n.php:498 I18n.php:575 #, php-format msgid "PO file not found in lang '%s' directory, ignore it." msgstr "" -#: I18n.php:487 I18n.php:597 +#: I18n.php:505 I18n.php:615 #, php-format msgid "Fail to open root lang directory (%s)." msgstr "" -#: I18n.php:513 +#: I18n.php:531 #, php-format msgid "Lang alias symlink found: %s -> %s" msgstr "" -#: I18n.php:520 +#: I18n.php:538 #, php-format msgid "JSON catalog symlink for %s -> %s created (%s)" msgstr "" -#: I18n.php:524 +#: I18n.php:542 #, php-format msgid "Fail to create JSON catalog symlink for %s -> %s (%s)" msgstr "" -#: I18n.php:530 +#: I18n.php:548 #, php-format msgid "JSON catalog symlink for %s -> %s already exist (%s)" msgstr "" -#: I18n.php:535 +#: I18n.php:553 #, php-format msgid "" "JSON catalog file for %s already exist, but it's not a symlink to %s (%s)" msgstr "" -#: I18n.php:570 +#: I18n.php:588 #, php-format msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)." msgstr "" -#: I18n.php:580 +#: I18n.php:598 #, php-format msgid "Fail to open %s JSON catalog file in write mode (%s)." msgstr "" -#: I18n.php:585 +#: I18n.php:603 #, php-format msgid "Fail to write %s JSON catalog in file (%s)." msgstr "" -#: I18n.php:590 +#: I18n.php:608 #, php-format msgid "%s JSON catalog writed (%s)." msgstr "" diff --git a/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo b/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo index 0c676c8..f1fcb67 100644 Binary files a/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo and b/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo differ diff --git a/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po b/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po index ad867fb..46f3e28 100644 --- a/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po +++ b/example/locales/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po @@ -1,9 +1,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2022-04-25 18:40+0200\n" +"POT-Creation-Date: 2023-02-13 02:32+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Benjamin Renard \n" +"Last-Translator: Benjamin Renard \n" "Language-Team: \n" "Language: fr_FR\n" "MIME-Version: 1.0\n" @@ -12,333 +12,70 @@ msgstr "" "X-Generator: Poedit 2.4.2\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: /home/brenard/dev/eesyphp/includes/url-helpers.php:5 -msgid "Invalid element identifier." -msgstr "Identifiant d'élément invalide." - -#: /home/brenard/dev/eesyphp/includes/url-helpers.php:9 -#: /home/brenard/dev/eesyphp/includes/url-public.php:222 -#: /home/brenard/dev/eesyphp/includes/url-public.php:246 +#: Cli.php:34 #, php-format -msgid "Item #% s not found." -msgstr "L'élément #%s est introuvable." +msgid "The CLI command '%s' already exists." +msgstr "La commande CLI '%s' n'existe pas." -#: /home/brenard/dev/eesyphp/includes/smarty.php:61 -msgid "Smarty version not supported." -msgstr "Une erreur est survenue en affichant cette page." +#: 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 !" -#: /home/brenard/dev/eesyphp/includes/smarty.php:148 -msgid "No template specified." -msgstr "Aucun template spécifié." +#: Cli.php:71 +#, php-format +msgid "Usage: %s [-h] [-qd] command\n" +msgstr "Utilisation: %s [-h] [-qd] commande\n" -#: /home/brenard/dev/eesyphp/includes/smarty.php:166 -msgid "An error occurred while viewing this page." -msgstr "Une erreur est survenue en affichant cette page." +#: Cli.php:72 +msgid " -h Show this message\n" +msgstr " -h Affiche ce message\n" -#: /home/brenard/dev/eesyphp/includes/url-public.php:7 -#: /home/brenard/dev/eesyphp/includes/translation.php:140 -msgid "Hello world !" -msgstr "Bonjour tout le monde !" +#: Cli.php:73 +msgid " -q / -d Quiet/Debug mode\n" +msgstr " -q / -d Mode silencieux/debug\n" -#: /home/brenard/dev/eesyphp/includes/url-public.php:31 -msgid "Any" -msgstr "Peu importe" +#: Cli.php:74 +msgid " --trace Trace mode (the most verbose)\n" +msgstr " --trace Mode trace (le plus verbeux)\n" -#: /home/brenard/dev/eesyphp/includes/url-public.php:89 +#: 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 "" -"An error occurred while listing the items. If the problem persists, please " -"contact support." +"Invalid parameter \"%s\".\n" +"Note: Command's parameter/argument must be place after the command." msgstr "" -"Une erreur est survenue en listant les éléments. Si le problème persiste, " -"merci de prendre contact avec le support." +"Paramètre \"%s\" invalide.\n" +"Note : Les paramètres/arguments de la requête doivent être placés après " +"celle-ci." -#: /home/brenard/dev/eesyphp/includes/url-public.php:104 -msgid "Search" -msgstr "Rechercher" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:128 +#: Cli.php:178 #, php-format -msgid "Element %s" -msgstr "Élément %s" +msgid "An exception occured running command %s" +msgstr "Une exception est survenue en exécutant la commande %s" -#: /home/brenard/dev/eesyphp/includes/url-public.php:142 -#, php-format -msgid "The element '% s' has been created." -msgstr "L'élément '%s' a bien été créé." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:146 -msgid "An error occurred while saving this item." -msgstr "Une erreur est survenue en enregistrant cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:153 -msgid "" -"There are errors preventing this item from being saved. Please correct them " -"before attempting to add this item." -msgstr "" -"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger " -"avant de tenter d'ajouter cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:160 -msgid "New" -msgstr "Nouveau" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:170 -msgid "You cannot edit this item." -msgstr "Vous ne pouvez pas modifier cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:183 -#, php-format -msgid "You have not made any changes to element '% s'." -msgstr "Vous n'avez apporté aucune modification à l'élément '%s'." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:187 -#, php-format -msgid "The element '% s' has been updated successfully." -msgstr "L'élément '%s' a bien été mise à jour." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:191 -msgid "An error occurred while updating this item." -msgstr "Une erreur est survenue en mettant à jour cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:199 -msgid "" -"There are errors preventing this item from being saved. Please correct them " -"before attempting to save your changes." -msgstr "" -"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger " -"avant de tenter d'enregistrer vos modifications." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:211 -#, php-format -msgid "Element %s: Modification" -msgstr "Élément %s : Modification" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:226 -msgid "This item is already archived." -msgstr "Cet élément est déjà archivé." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:229 -msgid "You cannot archive this item." -msgstr "Vous ne pouvez pas archiver cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:232 -#, php-format -msgid "The element '% s' has been archived successfully." -msgstr "L'élément '%s' a bien été archivé." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:235 -msgid "An error occurred while archiving this item." -msgstr "Une erreur est survenue en archivant cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:249 -msgid "You cannot delete this item." -msgstr "Vous ne pouvez pas supprimer cet élément." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:252 -#, php-format -msgid "The element '% s' has been deleted successfully." -msgstr "L'élément '%s' a bien été supprimé." - -#: /home/brenard/dev/eesyphp/includes/url-public.php:255 -msgid "An error occurred while deleting this item." -msgstr "Une erreur est survenue en supprimant cet élément." - -#: /home/brenard/dev/eesyphp/includes/db.php:31 +#: Db.php:74 msgid "Unable to connect to the database." msgstr "Impossible de se connecter à la base de données." -#: /home/brenard/dev/eesyphp/includes/core.php:44 -msgid "Pending" -msgstr "En attente" - -#: /home/brenard/dev/eesyphp/includes/core.php:45 -msgid "Validated" -msgstr "Validé" - -#: /home/brenard/dev/eesyphp/includes/core.php:46 -msgid "Refused" -msgstr "Refusé" - -#: /home/brenard/dev/eesyphp/includes/core.php:47 -msgid "Archived" -msgstr "Archivé" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:59 -msgid "Fail to list PHP files." -msgstr "Impossible de lister les fichiers PHP." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:76 -msgid "Fail to extract messages from PHP files using xgettext." -msgstr "" -"Impossible d'extraire les messages depuis les fichiers PHP en utilisant " -"xgettext." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:86 -msgid "Fail to list JS files." -msgstr "Impossible de lister les fichiers JS." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:103 -msgid "Fail to extract messages from JS files using xgettext." -msgstr "" -"Impossible d'extraire les messages depuis les fichiers JS en utilisant " -"xgettext." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:116 -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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:142 -msgid "Fail to merge messages using msgcat." -msgstr "Impossible de fusionner les messages en utilisant msgcat." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:147 -msgid "Extract messages that need to be translated" -msgstr "Extraire les messages devant être traduit" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:149 -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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:165 +#: Email.php:141 #, php-format -msgid "Compendium file %s not found." -msgstr "Fichier compendium %s introuvable." +msgid "

Mail initialy intended for %s.

" +msgstr "

Email initialement destiné à %s.

" -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:172 -#, 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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:184 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:301 -#, php-format -msgid "Lang directory '%s' found" -msgstr "Dossier de langue '%s' trouvé" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:190 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:307 -#, 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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:205 -#, 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)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:223 -#, 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)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:229 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:315 -#, 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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:236 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:356 -#, php-format -msgid "Fail to open root lang directory (%s)." -msgstr "Impossible d'ouvrir le dossier racine des langues (%s)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:241 -msgid "Update messages in translation PO lang files" -msgstr "" -"Mettre à jour les messages dans les fichiers de traduction PO existants" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:243 -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." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:270 -#, php-format -msgid "Lang alias symlink found: %s -> %s" -msgstr "Lien symbolique d'alias de langue trouvé : %s -> %s" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:277 -#, php-format -msgid "JSON catalog symlink for %s -> %s created (%s)" -msgstr "Lien symbolique de catalogue JSON pour %s -> %s créé (%s)" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:281 -#, php-format -msgid "Fail to create JSON catalog symlink for %s -> %s (%s)" -msgstr "" -"Impossible de créer le lien symbolique de catalogue JSON pour %s -> %s (%s)" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:287 -#, php-format -msgid "JSON catalog symlink for %s -> %s already exist (%s)" -msgstr "Le lien symbolique du catalogue JSON pour %s -> %s existe déjà (%s)" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:293 -#, php-format -msgid "" -"JSON catalog file for %s already exist, but it's not a symlink to %s (%s)" -msgstr "" -"Le catalogue JSON pour %s existe, mais il ne s'agit par d'un lien symbolique " -"vers %s (%s)" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:329 -#, 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)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:339 -#, php-format -msgid "Fail to open %s JSON catalog file in write mode (%s)." -msgstr "Impossible d'ouvrir le catalogue JSON %s en mode écriture (%s)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:344 -#, php-format -msgid "Fail to write %s JSON catalog in file (%s)." -msgstr "Impossible d'écrire le fichier du catalogue JSON %s (%s)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:349 -#, php-format -msgid "%s JSON catalog writed (%s)." -msgstr "Catalogue JSON %s créé (%s)." - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:362 -msgid "" -"Compile messages from existing translation PO lang files to corresponding MO " -"files and JSON catalogs" -msgstr "" -"Compiler les messages depuis les fichiers PO de traduction existants vers " -"les fichiers MO et les catalogues JSON correspondant" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:367 -msgid "" -"This command could be used to compile PO files in lang/*/LC_MESSAGES " -"directories to MO files and as JSON 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 JSON " -"dans public_html/translations." - -#: /home/brenard/dev/eesyphp/includes/mail.php:14 +#: Email.php:142 #, php-format msgid "" "\n" @@ -351,27 +88,49 @@ msgstr "" "\n" "Mail originalement destiné à %s." -#: /home/brenard/dev/eesyphp/includes/url.php:98 +#: Email.php:178 +#, php-format +msgid "

%s: %s

" +msgstr "

%s: %s

" + +#: 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" -#: /home/brenard/dev/eesyphp/includes/url.php:99 +#: Url.php:142 msgid "Invalid request." msgstr "Requête invalide." -#: /home/brenard/dev/eesyphp/includes/url.php:102 +#: Url.php:145 msgid "Authentication required" msgstr "Authentification requise" -#: /home/brenard/dev/eesyphp/includes/url.php:103 +#: Url.php:146 msgid "You have to be authenticated to access to this page." msgstr "Vous devez être authentifié pour accéder à cette page." -#: /home/brenard/dev/eesyphp/includes/url.php:106 +#: Url.php:149 msgid "Access denied" msgstr "Accès interdit" -#: /home/brenard/dev/eesyphp/includes/url.php:107 +#: Url.php:150 msgid "" "You do not have access to this application. If you think this is an error, " "please contact support." @@ -379,25 +138,25 @@ 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." -#: /home/brenard/dev/eesyphp/includes/url.php:110 +#: Url.php:153 msgid "Whoops ! Page not found" msgstr "Oups ! Page introuvable" -#: /home/brenard/dev/eesyphp/includes/url.php:111 +#: Url.php:154 msgid "The requested page can not be found." msgstr "La page demandée est introuvable." -#: /home/brenard/dev/eesyphp/includes/url.php:119 +#: Url.php:162 msgid "Error" msgstr "Erreur" -#: /home/brenard/dev/eesyphp/includes/url.php:120 +#: 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." -#: /home/brenard/dev/eesyphp/includes/url.php:165 +#: Url.php:226 msgid "" "Unable to determine the requested page. If the problem persists, please " "contact support." @@ -405,7 +164,7 @@ msgstr "" "Impossible de déterminer la page demandée. Si le problème persiste, merci de " "prendre contact avec le support." -#: /home/brenard/dev/eesyphp/includes/url.php:318 +#: Url.php:376 msgid "" "Unable to determine the requested page (loop detected). If the problem " "persists, please contact support." @@ -413,296 +172,637 @@ 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." -#: /home/brenard/dev/eesyphp/includes/url.php:347 +#: Url.php:407 msgid "This request cannot be processed." msgstr "Cette requête ne peut être traitée." -#: /home/brenard/dev/eesyphp/includes/url.php:360 +#: 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." -#: /home/brenard/dev/eesyphp/includes/url.php:368 +#: Url.php:429 msgid "This request could not be processed correctly." msgstr "Cette requête n'a put être traitée correctement." -#: /home/brenard/dev/eesyphp/includes/cli.php:8 +#: 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 lang/messages.pot file." +msgstr "" +"Cette commande peut-être utilisée pour générer/mettre à jour le fichier lang/" +"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 lang/*/LC_MESSAGES " +"directories." +msgstr "" +"Cette commande peut-être utilisée pour initialiser/mettre à jour les " +"fichiers PO les dossiers lang/*/LC_MESSAGES." + +#: I18n.php:147 +msgid "" +"Compile messages from existing translation PO lang files to corresponding MO " +"files and JSON catalogs" +msgstr "" +"Compiler les messages depuis les fichiers PO de traduction existants vers " +"les fichiers MO et les catalogues JSON correspondant" + +#: I18n.php:152 +msgid "" +"This command could be used to compile PO files in lang/*/LC_MESSAGES " +"directories to MO files and as JSON 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 JSON " +"dans public_html/translations." + +#: 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 "The CLI command '%s' already exists." -msgstr "La commande CLI '%s' n'existe pas." +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'." -#: /home/brenard/dev/eesyphp/includes/cli.php:13 -#, 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 !" - -#: /home/brenard/dev/eesyphp/includes/cli.php:54 -#, php-format -msgid "Usage: %s [-h] [-qd] command\n" -msgstr "Utilisation: %s [-h] [-qd] commande\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:55 -msgid " -h Show this message\n" -msgstr " -h Affiche ce message\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:56 -msgid " -q / -d Quiet/Debug mode\n" -msgstr " -q / -d Mode silencieux/debug\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:57 -msgid " --trace Trace mode (the most verbose)\n" -msgstr " --trace Mode trace (le plus verbeux)\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:58 -msgid " command Command to run\n" -msgstr " command La commande à exécuter\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:60 -msgid "Available commands:\n" -msgstr "Commandes disponibles:\n" - -#: /home/brenard/dev/eesyphp/includes/cli.php:102 -msgid "Only one command could be executed !" -msgstr "Une seul commande peut-être exécutée !" - -#: /home/brenard/dev/eesyphp/includes/cli.php:127 +#: I18n.php:364 #, php-format msgid "" -"Invalid parameter \"%s\".\n" -"Note: Command's parameter/argument must be place after the command." +"Fail to extract messages from JS files in the directory of static files '%s' " +"using xgettext." msgstr "" -"Paramètre \"%s\" invalide.\n" -"Note : Les paramètres/arguments de la requête doivent être placés après " -"celle-ci." +"Une erreur est survenue en extrayant les messages depuis les fichiers JS du " +"dossier des fichiers statiques '%s' en utilisant xgettext." -#: /home/brenard/dev/eesyphp/includes/cli.php:149 +#: I18n.php:384 #, php-format -msgid "An exception occured running command %s" -msgstr "Une exception est survenue en exécutant la commande %s" +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." -#: /home/brenard/dev/eesyphp/includes/cli.php:155 +#: 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 "JSON catalog symlink for %s -> %s created (%s)" +msgstr "Lien symbolique de catalogue JSON pour %s -> %s créé (%s)" + +#: I18n.php:542 +#, php-format +msgid "Fail to create JSON catalog symlink for %s -> %s (%s)" +msgstr "" +"Impossible de créer le lien symbolique de catalogue JSON pour %s -> %s (%s)" + +#: I18n.php:548 +#, php-format +msgid "JSON catalog symlink for %s -> %s already exist (%s)" +msgstr "Le lien symbolique du catalogue JSON pour %s -> %s existe déjà (%s)" + +#: I18n.php:553 +#, php-format +msgid "" +"JSON catalog file for %s already exist, but it's not a symlink to %s (%s)" +msgstr "" +"Le catalogue JSON 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 JSON catalog file in write mode (%s)." +msgstr "Impossible d'ouvrir le catalogue JSON %s en mode écriture (%s)." + +#: I18n.php:603 +#, php-format +msgid "Fail to write %s JSON catalog in file (%s)." +msgstr "Impossible d'écrire le fichier du catalogue JSON %s (%s)." + +#: I18n.php:608 +#, php-format +msgid "%s JSON catalog writed (%s)." +msgstr "Catalogue JSON %s créé (%s)." + +#: App.php:122 +msgid "Hello world!" +msgstr "Salut tout le monde !" + +#: includes/cli.php:23 #, php-format msgid "Item #%s:\n" msgstr "Élément #%s :\n" -#: /home/brenard/dev/eesyphp/includes/cli.php:156 +#: includes/cli.php:24 #, php-format msgid "ID: %s" msgstr "ID : %s" -#: /home/brenard/dev/eesyphp/includes/cli.php:157 +#: includes/cli.php:25 #, php-format msgid "Name: '%s'" msgstr "Nom : %s" -#: /home/brenard/dev/eesyphp/includes/cli.php:158 +#: includes/cli.php:26 #, php-format msgid "Date: %s" msgstr "Date : %s" -#: /home/brenard/dev/eesyphp/includes/cli.php:160 +#: includes/cli.php:28 #, php-format msgid "Description: %s" msgstr "Description : %s" -#: /home/brenard/dev/eesyphp/includes/cli.php:161 +#: includes/cli.php:29 msgid "Not set" msgstr "Non-défini" -#: /home/brenard/dev/eesyphp/includes/cli.php:163 +#: includes/cli.php:31 #, php-format msgid "Status: %s" msgstr "Statut : %s" -#: /home/brenard/dev/eesyphp/includes/cli.php:216 +#: includes/cli.php:84 msgid "No item.\n" msgstr "Aucun élément.\n" -#: /home/brenard/dev/eesyphp/includes/cli.php:242 +#: includes/cli.php:110 #, php-format msgid "%d item(s)" msgstr "%d élément(s)" -#: /home/brenard/dev/eesyphp/includes/cli.php:248 +#: includes/cli.php:116 msgid "List/search items" msgstr "Lister/rechercher les éléments" -#: /home/brenard/dev/eesyphp/includes/cli.php:249 +#: includes/cli.php:117 msgid "[patterns]" msgstr "[mots clés]" -#: /home/brenard/dev/eesyphp/includes/cli.php:251 +#: includes/cli.php:119 msgid "-o|--orderby Ordering list criterion. Possible values:" msgstr "-o|--orderby Critère de tri de la liste. Valeurs possibles :" -#: /home/brenard/dev/eesyphp/includes/cli.php:253 +#: includes/cli.php:121 msgid "-r|--reverse Reverse order" msgstr "-r|--reverse Ordre inverse" -#: /home/brenard/dev/eesyphp/includes/cli.php:254 +#: includes/cli.php:122 msgid "-s|--status Filter on status. Possible values:" msgstr "-s|--status Filtrer sur le statut. Valeurs possibles :" -#: /home/brenard/dev/eesyphp/includes/cli.php:261 +#: includes/cli.php:129 msgid "You must provide a valid ID." msgstr "Vous devez fournir un ID valide." -#: /home/brenard/dev/eesyphp/includes/cli.php:267 -#: /home/brenard/dev/eesyphp/includes/cli.php:291 +#: includes/cli.php:135 includes/cli.php:159 #, php-format msgid "Item #%s not found." msgstr "Élément #%s introuvable." -#: /home/brenard/dev/eesyphp/includes/cli.php:275 +#: includes/cli.php:143 msgid "Show item" msgstr "Voir un élément" -#: /home/brenard/dev/eesyphp/includes/cli.php:276 +#: includes/cli.php:144 msgid "[ID]" msgstr "[ID]" -#: /home/brenard/dev/eesyphp/includes/cli.php:281 +#: includes/cli.php:149 msgid "You must provide item ID." msgstr "Vous devez fournir un ID valide." -#: /home/brenard/dev/eesyphp/includes/cli.php:285 +#: includes/cli.php:153 msgid "Invalid item ID" msgstr "ID d'élément invalide" -#: /home/brenard/dev/eesyphp/includes/cli.php:296 +#: includes/cli.php:164 msgid "Are you sure you want to delete this item? Type 'yes' to continue: " msgstr "" "Êtes-vous sûre de vouloir supprimer cet élément ? Taper 'yes' pour " "continuer : " -#: /home/brenard/dev/eesyphp/includes/cli.php:300 +#: includes/cli.php:168 msgid "User cancel" msgstr "L'utilisateur a annulé" -#: /home/brenard/dev/eesyphp/includes/cli.php:306 +#: includes/cli.php:174 #, php-format msgid "An error occured deleting item #%d." msgstr "Une erreur est survenue en supprimant l'élément #%d." -#: /home/brenard/dev/eesyphp/includes/cli.php:313 +#: includes/cli.php:181 msgid "Delete item" msgstr "Supprimer un élément" -#: /home/brenard/dev/eesyphp/includes/cli.php:314 +#: includes/cli.php:182 msgid "[item ID]" msgstr "[ID de l'élément]" -#: /home/brenard/dev/eesyphp/includes/cli.php:326 +#: includes/cli.php:194 msgid "Export items (as CSV)" msgstr "Exporter les éléments (au format CSV)" -#: /home/brenard/dev/eesyphp/includes/cli.php:327 +#: includes/cli.php:195 msgid "[output file path]" msgstr "[chemin du fichier de sortie]" -#: /home/brenard/dev/eesyphp/includes/cli.php:342 +#: includes/cli.php:210 msgid "Restore items (from CSV)" msgstr "Restaurer les éléments (depuis un fichier CSV)" -#: /home/brenard/dev/eesyphp/includes/cli.php:343 +#: includes/cli.php:211 msgid "[input file path]" msgstr "[chemin du fichier d'entrée]" -#: /home/brenard/dev/eesyphp/includes/cli.php:412 +#: includes/cli.php:278 msgid "Cron to handle item expiration" msgstr "Cron gérant l'expiration des éléments" -#: /home/brenard/dev/eesyphp/includes/cli.php:415 +#: includes/cli.php:281 msgid "-j/--just-try Just-try mode : do not really removed expired item(s)" msgstr "" "-j/--just-try Mode just-try : Ne supprime pas réellement les éléments " "expirés" -#: /home/brenard/dev/eesyphp/includes/cli.php:416 +#: includes/cli.php:282 msgid "-m/--max-age Item expiration limit (in days, optional)" msgstr "" "-m/--max-age Limite d'expiration des éléments (en secondes, optionnel)" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:4 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:171 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:200 +#: includes/url-helpers.php:9 +msgid "Invalid element identifier." +msgstr "Identifiant d'élément invalide." + +#: includes/url-helpers.php:13 includes/url-public.php:220 +#: includes/url-public.php:242 +#, php-format +msgid "Item #% s not found." +msgstr "L'élément #%s est introuvable." + +#: includes/core.php:51 +msgid "Pending" +msgstr "En attente" + +#: includes/core.php:52 +msgid "Validated" +msgstr "Validé" + +#: includes/core.php:53 +msgid "Refused" +msgstr "Refusé" + +#: includes/core.php:54 +msgid "Archived" +msgstr "Archivé" + +#: includes/url-public.php:33 +msgid "Any" +msgstr "Peu importe" + +#: includes/url-public.php:91 +msgid "" +"An error occurred while listing the items. If the problem persists, please " +"contact support." +msgstr "" +"Une erreur est survenue en listant les éléments. Si le problème persiste, " +"merci de prendre contact avec le support." + +#: includes/url-public.php:106 +msgid "Search" +msgstr "Rechercher" + +#: includes/url-public.php:128 +#, php-format +msgid "Element %s" +msgstr "Élément %s" + +#: includes/url-public.php:142 +#, php-format +msgid "The element '% s' has been created." +msgstr "L'élément '%s' a bien été créé." + +#: includes/url-public.php:146 +msgid "An error occurred while saving this item." +msgstr "Une erreur est survenue en enregistrant cet élément." + +#: includes/url-public.php:153 +msgid "" +"There are errors preventing this item from being saved. Please correct them " +"before attempting to add this item." +msgstr "" +"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger " +"avant de tenter d'ajouter cet élément." + +#: includes/url-public.php:160 +msgid "New" +msgstr "Nouveau" + +#: includes/url-public.php:170 +msgid "You cannot edit this item." +msgstr "Vous ne pouvez pas modifier cet élément." + +#: includes/url-public.php:183 +#, php-format +msgid "You have not made any changes to element '% s'." +msgstr "Vous n'avez apporté aucune modification à l'élément '%s'." + +#: includes/url-public.php:187 +#, php-format +msgid "The element '% s' has been updated successfully." +msgstr "L'élément '%s' a bien été mise à jour." + +#: includes/url-public.php:191 +msgid "An error occurred while updating this item." +msgstr "Une erreur est survenue en mettant à jour cet élément." + +#: includes/url-public.php:199 +msgid "" +"There are errors preventing this item from being saved. Please correct them " +"before attempting to save your changes." +msgstr "" +"Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger " +"avant de tenter d'enregistrer vos modifications." + +#: includes/url-public.php:211 +#, php-format +msgid "Element %s: Modification" +msgstr "Élément %s : Modification" + +#: includes/url-public.php:224 +msgid "This item is already archived." +msgstr "Cet élément est déjà archivé." + +#: includes/url-public.php:227 +msgid "You cannot archive this item." +msgstr "Vous ne pouvez pas archiver cet élément." + +#: includes/url-public.php:230 +#, php-format +msgid "The element '% s' has been archived successfully." +msgstr "L'élément '%s' a bien été archivé." + +#: includes/url-public.php:233 +msgid "An error occurred while archiving this item." +msgstr "Une erreur est survenue en archivant cet élément." + +#: includes/url-public.php:245 +msgid "You cannot delete this item." +msgstr "Vous ne pouvez pas supprimer cet élément." + +#: includes/url-public.php:248 +#, php-format +msgid "The element '% s' has been deleted successfully." +msgstr "L'élément '%s' a bien été supprimé." + +#: includes/url-public.php:251 +msgid "An error occurred while deleting this item." +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" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:5 +#: static/js/myconfirm.js:5 msgid "Do you confirm?" msgstr "Confirmez-vous ?" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:11 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:108 +#: static/js/myconfirm.js:11 static/js/myconfirm.js:108 msgid "Cancel" msgstr "Annuler" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:17 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:114 +#: static/js/myconfirm.js:17 static/js/myconfirm.js:114 msgid "Validate" msgstr "Valider" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:52 +#: static/js/myconfirm.js:52 msgid "OK" msgstr "OK" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:91 +#: static/js/myconfirm.js:91 msgid "Question" msgstr "Question" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:92 +#: static/js/myconfirm.js:92 msgid "Please enter your answer below:" msgstr "Merci de saisir vos réponses ci-dessous :" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:143 +#: static/js/myconfirm.js:143 msgid "Please wait" msgstr "Merci de patienter" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:144 +#: 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." -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:172 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:201 +#: static/js/myconfirm.js:172 static/js/myconfirm.js:201 msgid "Are you sure?" msgstr "Êtes-vous sure ?" -#: /home/brenard/dev/eesyphp/templates/form.tpl:7 -#: /home/brenard/dev/eesyphp/templates/search.tpl:36 -#: /home/brenard/dev/eesyphp/templates/show.tpl:5 +#: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7 msgid "Name" msgstr "Nom" -#: /home/brenard/dev/eesyphp/templates/form.tpl:15 -#: /home/brenard/dev/eesyphp/templates/search.tpl:11 -#: /home/brenard/dev/eesyphp/templates/show.tpl:23 +#: templates/show.tpl:14 +msgid "Creation date" +msgstr "Date de création" + +#: templates/show.tpl:23 templates/search.tpl:11 templates/form.tpl:15 msgid "Status" msgstr "Statut" -#: /home/brenard/dev/eesyphp/templates/form.tpl:25 -#: /home/brenard/dev/eesyphp/templates/show.tpl:32 +#: templates/show.tpl:32 templates/form.tpl:25 msgid "Description" msgstr "Description" -#: /home/brenard/dev/eesyphp/templates/form.tpl:33 -#: /home/brenard/dev/eesyphp/templates/fatal_error.tpl:9 -#: /home/brenard/dev/eesyphp/templates/show.tpl:42 +#: templates/show.tpl:35 +msgid "Unspecified." +msgstr "Non-spécifié." + +#: templates/show.tpl:42 templates/form.tpl:33 msgid "Back" msgstr "Retour" -#: /home/brenard/dev/eesyphp/templates/form.tpl:36 -msgid "Save" -msgstr "Enregistrer" +#: templates/show.tpl:43 templates/search.tpl:51 +msgid "Modify" +msgstr "Modifier" -#: /home/brenard/dev/eesyphp/templates/form.tpl:38 -#: /home/brenard/dev/eesyphp/templates/search.tpl:28 +#: templates/show.tpl:44 templates/search.tpl:52 +msgid "Are you sure you want to archive this item?" +msgstr "Êtes-vous sûre de vouloir archiver cet élément ?" + +#: templates/show.tpl:44 templates/search.tpl:52 +msgid "Archive" +msgstr "Archiver" + +#: templates/show.tpl:45 templates/search.tpl:53 +msgid "Are you sure you want to delete this item?" +msgstr "Êtes-vous sûre de vouloir supprimer cet élément ?" + +#: templates/show.tpl:45 templates/search.tpl:53 +msgid "Delete" +msgstr "Supprimer" + +#: templates/search.tpl:8 +msgid "Pattern" +msgstr "Mot clé" + +#: templates/search.tpl:16 +msgid "Nb by page" +msgstr "Nb par page" + +#: templates/search.tpl:23 +msgid "Reset" +msgstr "Réinitialiser" + +#: templates/search.tpl:28 templates/form.tpl:38 msgid "Add" msgstr "Ajouter" -#: /home/brenard/dev/eesyphp/templates/fatal_error.tpl:5 +#: templates/search.tpl:35 +msgid "Date" +msgstr "Date" + +#: templates/search.tpl:37 +msgid "Actions" +msgstr "Actions" + +#: templates/search.tpl:47 templates/search.tpl:50 +msgid "View" +msgstr "Voir" + +#: templates/search.tpl:59 +msgid "No item found." +msgstr "Aucun élément trouvé." + +#: templates/search.tpl:68 +msgid "%3 element" +msgid_plural "Elements %1 to %2 on %3" +msgstr[0] "%3 élément" +msgstr[1] "Éléments %1 à %2 sur %3" + +#: templates/homepage.tpl:5 +msgid "Hello, world!" +msgstr "Bonjour tout le monde !" + +#: templates/homepage.tpl:6 +msgid "" +"This is a simple app to show the different possibilities and basic " +"functionality." +msgstr "" +"Ceci est une simple application pour montrer les différentes possibilités et " +"les fonctionnalités de base." + +#: templates/homepage.tpl:8 +msgid "This app contains some demo pages:" +msgstr "Cette application contient quelques pages de démo :" + +#: templates/homepage.tpl:9 +msgid "Search page" +msgstr "Page de recherche" + +#: templates/form.tpl:36 +msgid "Save" +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." @@ -711,97 +811,58 @@ msgstr "" "fonctionner correctement. Merci de réessayer ultérieurement ou de prendre " "contact avec le service support." -#: /home/brenard/dev/eesyphp/templates/fatal_error.tpl:7 +#: templates/fatal_error.tpl:7 msgid "Error: %1" msgstr "Erreur : %1" -#: /home/brenard/dev/eesyphp/templates/search.tpl:8 -msgid "Pattern" -msgstr "Mot clé" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:16 -msgid "Nb by page" -msgstr "Nb par page" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:23 -msgid "Reset" -msgstr "Réinitialiser" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:35 -msgid "Date" -msgstr "Date" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:37 -msgid "Actions" -msgstr "Actions" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:47 -#: /home/brenard/dev/eesyphp/templates/search.tpl:50 -msgid "View" -msgstr "Voir" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:51 -#: /home/brenard/dev/eesyphp/templates/show.tpl:43 -msgid "Modify" -msgstr "Modifier" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:52 -#: /home/brenard/dev/eesyphp/templates/show.tpl:44 -msgid "Are you sure you want to archive this item?" -msgstr "Êtes-vous sûre de vouloir archiver cet élément ?" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:52 -#: /home/brenard/dev/eesyphp/templates/show.tpl:44 -msgid "Archive" -msgstr "Archiver" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:53 -#: /home/brenard/dev/eesyphp/templates/show.tpl:45 -msgid "Are you sure you want to delete this item?" -msgstr "Êtes-vous sûre de vouloir supprimer cet élément ?" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:53 -#: /home/brenard/dev/eesyphp/templates/show.tpl:45 -msgid "Delete" -msgstr "Supprimer" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:59 -msgid "No item found." -msgstr "Aucun élément trouvé." - -#: /home/brenard/dev/eesyphp/templates/search.tpl:68 -msgid "%3 element" -msgid_plural "Elements %1 to %2 on %3" -msgstr[0] "%3 élément" -msgstr[1] "Éléments %1 à %2 sur %3" - -#: /home/brenard/dev/eesyphp/templates/show.tpl:14 -msgid "Creation date" -msgstr "Date de création" - -#: /home/brenard/dev/eesyphp/templates/show.tpl:35 -msgid "Unspecified." -msgstr "Non-spécifié." - -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:5 -msgid "Hello, world!" -msgstr "Bonjour tout le monde !" - -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:6 +#: templates/homepage.tpl:6 msgid "" -"This is a simple app to show the different possibilities and basic " -"functionality." +"This is the default page of a new app using EesyPHP framework. Register your " +"own templates directory and create a homepage.tpl file to overwrite " +"it. You could also overwrite the URL handler for the root of the web " +"application." msgstr "" -"Ceci est une simple application pour montrer les différentes possibilités et " -"les fonctionnalités de base." +"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 homepage.tpl pour l'écraser. Vous pouvez également écraser " +"le gestionnaire de l'URL racine de l'application web." -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:8 -msgid "This app contains some demo pages:" -msgstr "Cette application contient quelques pages de démo :" +#, 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'." -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:9 -msgid "Search page" -msgstr "Page de recherche" +#, 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 "" diff --git a/example/locales/headers.pot b/example/locales/headers.pot index ede26b1..7da20a6 100644 --- a/example/locales/headers.pot +++ b/example/locales/headers.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" -"POT-Creation-Date: 2022-04-25 18:40+0200\n" -"PO-Revision-Date: 2022-04-25 18:40+0200\n" +"POT-Creation-Date: 2023-02-13 02:32+0100\n" +"PO-Revision-Date: 2023-02-13 02:32+0100\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" \ No newline at end of file diff --git a/example/locales/js-1-messages.pot b/example/locales/js-1-messages.pot new file mode 100644 index 0000000..310fe62 --- /dev/null +++ b/example/locales/js-1-messages.pot @@ -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 "" diff --git a/example/locales/messages.pot b/example/locales/messages.pot index 76660ee..ebb3a9b 100644 --- a/example/locales/messages.pot +++ b/example/locales/messages.pot @@ -1,302 +1,72 @@ msgid "" msgstr "" -"POT-Creation-Date: 2022-04-25 18:40+0200\n" -"PO-Revision-Date: 2022-04-25 18:40+0200\n" +"POT-Creation-Date: 2023-02-13 02:32+0100\n" +"PO-Revision-Date: 2023-02-13 02:32+0100\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: /home/brenard/dev/eesyphp/includes/url-helpers.php:5 -msgid "Invalid element identifier." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-helpers.php:9 -#: /home/brenard/dev/eesyphp/includes/url-public.php:222 -#: /home/brenard/dev/eesyphp/includes/url-public.php:246 +#: Cli.php:34 #, php-format -msgid "Item #% s not found." +msgid "The CLI command '%s' already exists." msgstr "" -#: /home/brenard/dev/eesyphp/includes/smarty.php:61 -msgid "Smarty version not supported." +#: Cli.php:39 +#, php-format +msgid "The CLI command '%s' handler is not callable !" msgstr "" -#: /home/brenard/dev/eesyphp/includes/smarty.php:148 -msgid "No template specified." +#: Cli.php:71 +#, php-format +msgid "Usage: %s [-h] [-qd] command\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/smarty.php:166 -msgid "An error occurred while viewing this page." +#: Cli.php:72 +msgid " -h Show this message\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url-public.php:7 -#: /home/brenard/dev/eesyphp/includes/translation.php:140 -msgid "Hello world !" +#: Cli.php:73 +msgid " -q / -d Quiet/Debug mode\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url-public.php:31 -msgid "Any" +#: Cli.php:74 +msgid " --trace Trace mode (the most verbose)\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url-public.php:89 +#: 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 "" -"An error occurred while listing the items. If the problem persists, please " -"contact support." +"Invalid parameter \"%s\".\n" +"Note: Command's parameter/argument must be place after the command." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url-public.php:104 -msgid "Search" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:128 +#: Cli.php:178 #, php-format -msgid "Element %s" +msgid "An exception occured running command %s" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url-public.php:142 -#, php-format -msgid "The element '% s' has been created." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:146 -msgid "An error occurred while saving this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:153 -msgid "" -"There are errors preventing this item from being saved. Please correct them " -"before attempting to add this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:160 -msgid "New" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:170 -msgid "You cannot edit this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:183 -#, php-format -msgid "You have not made any changes to element '% s'." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:187 -#, php-format -msgid "The element '% s' has been updated successfully." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:191 -msgid "An error occurred while updating this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:199 -msgid "" -"There are errors preventing this item from being saved. Please correct them " -"before attempting to save your changes." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:211 -#, php-format -msgid "Element %s: Modification" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:226 -msgid "This item is already archived." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:229 -msgid "You cannot archive this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:232 -#, php-format -msgid "The element '% s' has been archived successfully." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:235 -msgid "An error occurred while archiving this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:249 -msgid "You cannot delete this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:252 -#, php-format -msgid "The element '% s' has been deleted successfully." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/url-public.php:255 -msgid "An error occurred while deleting this item." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/db.php:31 +#: Db.php:74 msgid "Unable to connect to the database." msgstr "" -#: /home/brenard/dev/eesyphp/includes/core.php:44 -msgid "Pending" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/core.php:45 -msgid "Validated" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/core.php:46 -msgid "Refused" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/core.php:47 -msgid "Archived" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:59 -msgid "Fail to list PHP files." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:76 -msgid "Fail to extract messages from PHP files using xgettext." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:86 -msgid "Fail to list JS files." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:103 -msgid "Fail to extract messages from JS files using xgettext." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:116 -msgid "" -"Fail to extract messages from template files using tsmarty2c.php script." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:142 -msgid "Fail to merge messages using msgcat." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:147 -msgid "Extract messages that need to be translated" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:149 -msgid "This command could be used to generate/update lang/messages.pot file." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:165 +#: Email.php:141 #, php-format -msgid "Compendium file %s not found." +msgid "

Mail initialy intended for %s.

" msgstr "" -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:172 -#, php-format -msgid "POT file not found (%s). Please run extract_messages first." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:184 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:301 -#, php-format -msgid "Lang directory '%s' found" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:190 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:307 -#, php-format -msgid "LC_MESSAGES directory not found in lang '%s' directory, ignore it." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:205 -#, php-format -msgid "Fail to init messages in %s PO file using msginit (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:223 -#, php-format -msgid "Fail to update messages in %s PO file using msgmerge (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:229 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:315 -#, php-format -msgid "PO file not found in lang '%s' directory, ignore it." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:236 -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:356 -#, php-format -msgid "Fail to open root lang directory (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:241 -msgid "Update messages in translation PO lang files" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:243 -msgid "" -"This command could be used to init/update PO files in lang/*/LC_MESSAGES " -"directories." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:270 -#, php-format -msgid "Lang alias symlink found: %s -> %s" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:277 -#, php-format -msgid "JSON catalog symlink for %s -> %s created (%s)" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:281 -#, php-format -msgid "Fail to create JSON catalog symlink for %s -> %s (%s)" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:287 -#, php-format -msgid "JSON catalog symlink for %s -> %s already exist (%s)" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:293 -#, php-format -msgid "" -"JSON catalog file for %s already exist, but it's not a symlink to %s (%s)" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:329 -#, php-format -msgid "Fail to compile messages from %s PO file as MO file using msgfmt (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:339 -#, php-format -msgid "Fail to open %s JSON catalog file in write mode (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:344 -#, php-format -msgid "Fail to write %s JSON catalog in file (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:349 -#, php-format -msgid "%s JSON catalog writed (%s)." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:362 -msgid "" -"Compile messages from existing translation PO lang files to corresponding MO " -"files and JSON catalogs" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/translation-cli.php:367 -msgid "" -"This command could be used to compile PO files in lang/*/LC_MESSAGES " -"directories to MO files and as JSON catalogs in public_html/translations." -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/mail.php:14 +#: Email.php:142 #, php-format msgid "" "\n" @@ -305,431 +75,675 @@ msgid "" "Mail initialy intended for %s." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:98 +#: Email.php:178 +#, php-format +msgid "

%s: %s

" +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 "" -#: /home/brenard/dev/eesyphp/includes/url.php:99 +#: Url.php:142 msgid "Invalid request." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:102 +#: Url.php:145 msgid "Authentication required" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:103 +#: Url.php:146 msgid "You have to be authenticated to access to this page." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:106 +#: Url.php:149 msgid "Access denied" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:107 +#: Url.php:150 msgid "" "You do not have access to this application. If you think this is an error, " "please contact support." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:110 +#: Url.php:153 msgid "Whoops ! Page not found" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:111 +#: Url.php:154 msgid "The requested page can not be found." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:119 +#: Url.php:162 msgid "Error" msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:120 +#: Url.php:163 msgid "An unknown error occurred. If problem persist, please contact support." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:165 +#: Url.php:226 msgid "" "Unable to determine the requested page. If the problem persists, please " "contact support." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:318 +#: Url.php:376 msgid "" "Unable to determine the requested page (loop detected). If the problem " "persists, please contact support." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:347 +#: Url.php:407 msgid "This request cannot be processed." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:360 +#: Url.php:420 msgid "" "Authentication required but force_authentication function is not defined." msgstr "" -#: /home/brenard/dev/eesyphp/includes/url.php:368 +#: Url.php:429 msgid "This request could not be processed correctly." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:8 +#: 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 lang/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 lang/*/LC_MESSAGES " +"directories." +msgstr "" + +#: I18n.php:147 +msgid "" +"Compile messages from existing translation PO lang files to corresponding MO " +"files and JSON catalogs" +msgstr "" + +#: I18n.php:152 +msgid "" +"This command could be used to compile PO files in lang/*/LC_MESSAGES " +"directories to MO files and as JSON catalogs in public_html/translations." +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 "The CLI command '%s' already exists." +msgid "Fail to list JS files in the directory of static files '%s'." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:13 -#, php-format -msgid "The CLI command '%s' handler is not callable !" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:54 -#, php-format -msgid "Usage: %s [-h] [-qd] command\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:55 -msgid " -h Show this message\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:56 -msgid " -q / -d Quiet/Debug mode\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:57 -msgid " --trace Trace mode (the most verbose)\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:58 -msgid " command Command to run\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:60 -msgid "Available commands:\n" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:102 -msgid "Only one command could be executed !" -msgstr "" - -#: /home/brenard/dev/eesyphp/includes/cli.php:127 +#: I18n.php:364 #, php-format msgid "" -"Invalid parameter \"%s\".\n" -"Note: Command's parameter/argument must be place after the command." +"Fail to extract messages from JS files in the directory of static files '%s' " +"using xgettext." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:149 +#: I18n.php:384 #, php-format -msgid "An exception occured running command %s" +msgid "" +"Fail to extract messages from templates directory '%s' using tsmarty2c.php " +"script." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:155 +#: 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 "JSON catalog symlink for %s -> %s created (%s)" +msgstr "" + +#: I18n.php:542 +#, php-format +msgid "Fail to create JSON catalog symlink for %s -> %s (%s)" +msgstr "" + +#: I18n.php:548 +#, php-format +msgid "JSON catalog symlink for %s -> %s already exist (%s)" +msgstr "" + +#: I18n.php:553 +#, php-format +msgid "" +"JSON 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 JSON catalog file in write mode (%s)." +msgstr "" + +#: I18n.php:603 +#, php-format +msgid "Fail to write %s JSON catalog in file (%s)." +msgstr "" + +#: I18n.php:608 +#, php-format +msgid "%s JSON catalog writed (%s)." +msgstr "" + +#: App.php:122 +msgid "Hello world!" +msgstr "" + +#: includes/cli.php:23 #, php-format msgid "Item #%s:\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:156 +#: includes/cli.php:24 #, php-format msgid "ID: %s" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:157 +#: includes/cli.php:25 #, php-format msgid "Name: '%s'" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:158 +#: includes/cli.php:26 #, php-format msgid "Date: %s" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:160 +#: includes/cli.php:28 #, php-format msgid "Description: %s" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:161 +#: includes/cli.php:29 msgid "Not set" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:163 +#: includes/cli.php:31 #, php-format msgid "Status: %s" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:216 +#: includes/cli.php:84 msgid "No item.\n" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:242 +#: includes/cli.php:110 #, php-format msgid "%d item(s)" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:248 +#: includes/cli.php:116 msgid "List/search items" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:249 +#: includes/cli.php:117 msgid "[patterns]" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:251 +#: includes/cli.php:119 msgid "-o|--orderby Ordering list criterion. Possible values:" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:253 +#: includes/cli.php:121 msgid "-r|--reverse Reverse order" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:254 +#: includes/cli.php:122 msgid "-s|--status Filter on status. Possible values:" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:261 +#: includes/cli.php:129 msgid "You must provide a valid ID." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:267 -#: /home/brenard/dev/eesyphp/includes/cli.php:291 +#: includes/cli.php:135 includes/cli.php:159 #, php-format msgid "Item #%s not found." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:275 +#: includes/cli.php:143 msgid "Show item" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:276 +#: includes/cli.php:144 msgid "[ID]" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:281 +#: includes/cli.php:149 msgid "You must provide item ID." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:285 +#: includes/cli.php:153 msgid "Invalid item ID" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:296 +#: includes/cli.php:164 msgid "Are you sure you want to delete this item? Type 'yes' to continue: " msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:300 +#: includes/cli.php:168 msgid "User cancel" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:306 +#: includes/cli.php:174 #, php-format msgid "An error occured deleting item #%d." msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:313 +#: includes/cli.php:181 msgid "Delete item" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:314 +#: includes/cli.php:182 msgid "[item ID]" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:326 +#: includes/cli.php:194 msgid "Export items (as CSV)" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:327 +#: includes/cli.php:195 msgid "[output file path]" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:342 +#: includes/cli.php:210 msgid "Restore items (from CSV)" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:343 +#: includes/cli.php:211 msgid "[input file path]" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:412 +#: includes/cli.php:278 msgid "Cron to handle item expiration" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:415 +#: includes/cli.php:281 msgid "-j/--just-try Just-try mode : do not really removed expired item(s)" msgstr "" -#: /home/brenard/dev/eesyphp/includes/cli.php:416 +#: includes/cli.php:282 msgid "-m/--max-age Item expiration limit (in days, optional)" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:4 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:171 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:200 +#: includes/url-helpers.php:9 +msgid "Invalid element identifier." +msgstr "" + +#: includes/url-helpers.php:13 includes/url-public.php:220 +#: includes/url-public.php:242 +#, php-format +msgid "Item #% s not found." +msgstr "" + +#: includes/core.php:51 +msgid "Pending" +msgstr "" + +#: includes/core.php:52 +msgid "Validated" +msgstr "" + +#: includes/core.php:53 +msgid "Refused" +msgstr "" + +#: includes/core.php:54 +msgid "Archived" +msgstr "" + +#: includes/url-public.php:33 +msgid "Any" +msgstr "" + +#: includes/url-public.php:91 +msgid "" +"An error occurred while listing the items. If the problem persists, please " +"contact support." +msgstr "" + +#: includes/url-public.php:106 +msgid "Search" +msgstr "" + +#: includes/url-public.php:128 +#, php-format +msgid "Element %s" +msgstr "" + +#: includes/url-public.php:142 +#, php-format +msgid "The element '% s' has been created." +msgstr "" + +#: includes/url-public.php:146 +msgid "An error occurred while saving this item." +msgstr "" + +#: includes/url-public.php:153 +msgid "" +"There are errors preventing this item from being saved. Please correct them " +"before attempting to add this item." +msgstr "" + +#: includes/url-public.php:160 +msgid "New" +msgstr "" + +#: includes/url-public.php:170 +msgid "You cannot edit this item." +msgstr "" + +#: includes/url-public.php:183 +#, php-format +msgid "You have not made any changes to element '% s'." +msgstr "" + +#: includes/url-public.php:187 +#, php-format +msgid "The element '% s' has been updated successfully." +msgstr "" + +#: includes/url-public.php:191 +msgid "An error occurred while updating this item." +msgstr "" + +#: includes/url-public.php:199 +msgid "" +"There are errors preventing this item from being saved. Please correct them " +"before attempting to save your changes." +msgstr "" + +#: includes/url-public.php:211 +#, php-format +msgid "Element %s: Modification" +msgstr "" + +#: includes/url-public.php:224 +msgid "This item is already archived." +msgstr "" + +#: includes/url-public.php:227 +msgid "You cannot archive this item." +msgstr "" + +#: includes/url-public.php:230 +#, php-format +msgid "The element '% s' has been archived successfully." +msgstr "" + +#: includes/url-public.php:233 +msgid "An error occurred while archiving this item." +msgstr "" + +#: includes/url-public.php:245 +msgid "You cannot delete this item." +msgstr "" + +#: includes/url-public.php:248 +#, php-format +msgid "The element '% s' has been deleted successfully." +msgstr "" + +#: includes/url-public.php:251 +msgid "An error occurred while deleting this item." +msgstr "" + +#: static/js/myconfirm.js:4 static/js/myconfirm.js:171 +#: static/js/myconfirm.js:200 msgid "Confirmation" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:5 +#: static/js/myconfirm.js:5 msgid "Do you confirm?" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:11 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:108 +#: static/js/myconfirm.js:11 static/js/myconfirm.js:108 msgid "Cancel" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:17 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:114 +#: static/js/myconfirm.js:17 static/js/myconfirm.js:114 msgid "Validate" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:52 +#: static/js/myconfirm.js:52 msgid "OK" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:91 +#: static/js/myconfirm.js:91 msgid "Question" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:92 +#: static/js/myconfirm.js:92 msgid "Please enter your answer below:" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:143 +#: static/js/myconfirm.js:143 msgid "Please wait" msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:144 +#: static/js/myconfirm.js:144 msgid "Please wait while your request is being processed." msgstr "" -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:172 -#: /home/brenard/dev/eesyphp/public_html/js/myconfirm.js:201 +#: static/js/myconfirm.js:172 static/js/myconfirm.js:201 msgid "Are you sure?" msgstr "" -#: /home/brenard/dev/eesyphp/templates/form.tpl:7 -#: /home/brenard/dev/eesyphp/templates/search.tpl:36 -#: /home/brenard/dev/eesyphp/templates/show.tpl:5 +#: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7 msgid "Name" msgstr "" -#: /home/brenard/dev/eesyphp/templates/form.tpl:15 -#: /home/brenard/dev/eesyphp/templates/search.tpl:11 -#: /home/brenard/dev/eesyphp/templates/show.tpl:23 +#: templates/show.tpl:14 +msgid "Creation date" +msgstr "" + +#: templates/show.tpl:23 templates/search.tpl:11 templates/form.tpl:15 msgid "Status" msgstr "" -#: /home/brenard/dev/eesyphp/templates/form.tpl:25 -#: /home/brenard/dev/eesyphp/templates/show.tpl:32 +#: templates/show.tpl:32 templates/form.tpl:25 msgid "Description" msgstr "" -#: /home/brenard/dev/eesyphp/templates/form.tpl:33 -#: /home/brenard/dev/eesyphp/templates/fatal_error.tpl:9 -#: /home/brenard/dev/eesyphp/templates/show.tpl:42 +#: templates/show.tpl:35 +msgid "Unspecified." +msgstr "" + +#: templates/show.tpl:42 templates/form.tpl:33 msgid "Back" msgstr "" -#: /home/brenard/dev/eesyphp/templates/form.tpl:36 -msgid "Save" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/form.tpl:38 -#: /home/brenard/dev/eesyphp/templates/search.tpl:28 -msgid "Add" -msgstr "" - -#: /home/brenard/dev/eesyphp/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 "" - -#: /home/brenard/dev/eesyphp/templates/fatal_error.tpl:7 -msgid "Error: %1" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:8 -msgid "Pattern" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:16 -msgid "Nb by page" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:23 -msgid "Reset" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:35 -msgid "Date" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:37 -msgid "Actions" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:47 -#: /home/brenard/dev/eesyphp/templates/search.tpl:50 -msgid "View" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/search.tpl:51 -#: /home/brenard/dev/eesyphp/templates/show.tpl:43 +#: templates/show.tpl:43 templates/search.tpl:51 msgid "Modify" msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:52 -#: /home/brenard/dev/eesyphp/templates/show.tpl:44 +#: templates/show.tpl:44 templates/search.tpl:52 msgid "Are you sure you want to archive this item?" msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:52 -#: /home/brenard/dev/eesyphp/templates/show.tpl:44 +#: templates/show.tpl:44 templates/search.tpl:52 msgid "Archive" msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:53 -#: /home/brenard/dev/eesyphp/templates/show.tpl:45 +#: templates/show.tpl:45 templates/search.tpl:53 msgid "Are you sure you want to delete this item?" msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:53 -#: /home/brenard/dev/eesyphp/templates/show.tpl:45 +#: templates/show.tpl:45 templates/search.tpl:53 msgid "Delete" msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:59 +#: templates/search.tpl:8 +msgid "Pattern" +msgstr "" + +#: templates/search.tpl:16 +msgid "Nb by page" +msgstr "" + +#: templates/search.tpl:23 +msgid "Reset" +msgstr "" + +#: templates/search.tpl:28 templates/form.tpl:38 +msgid "Add" +msgstr "" + +#: templates/search.tpl:35 +msgid "Date" +msgstr "" + +#: templates/search.tpl:37 +msgid "Actions" +msgstr "" + +#: templates/search.tpl:47 templates/search.tpl:50 +msgid "View" +msgstr "" + +#: templates/search.tpl:59 msgid "No item found." msgstr "" -#: /home/brenard/dev/eesyphp/templates/search.tpl:68 +#: templates/search.tpl:68 msgid "%3 element" msgid_plural "Elements %1 to %2 on %3" msgstr[0] "" msgstr[1] "" -#: /home/brenard/dev/eesyphp/templates/show.tpl:14 -msgid "Creation date" -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/show.tpl:35 -msgid "Unspecified." -msgstr "" - -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:5 +#: templates/homepage.tpl:5 msgid "Hello, world!" msgstr "" -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:6 +#: templates/homepage.tpl:6 msgid "" "This is a simple app to show the different possibilities and basic " "functionality." msgstr "" -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:8 +#: templates/homepage.tpl:8 msgid "This app contains some demo pages:" msgstr "" -#: /home/brenard/dev/eesyphp/templates/homepage.tpl:9 +#: templates/homepage.tpl:9 msgid "Search page" msgstr "" + +#: templates/form.tpl:36 +msgid "Save" +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 homepage.tpl file to overwrite " +"it. You could also overwrite the URL handler for the root of the web " +"application." +msgstr "" diff --git a/example/locales/templates-0-messages.pot b/example/locales/templates-0-messages.pot new file mode 100644 index 0000000..8debfa3 --- /dev/null +++ b/example/locales/templates-0-messages.pot @@ -0,0 +1,110 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +#: templates/show.tpl:5 templates/search.tpl:36 templates/form.tpl:7 +msgid "Name" +msgstr "" + +#: templates/show.tpl:14 +msgid "Creation date" +msgstr "" + +#: templates/show.tpl:23 templates/search.tpl:11 templates/form.tpl:15 +msgid "Status" +msgstr "" + +#: templates/show.tpl:32 templates/form.tpl:25 +msgid "Description" +msgstr "" + +#: templates/show.tpl:35 +msgid "Unspecified." +msgstr "" + +#: templates/show.tpl:42 templates/form.tpl:33 +msgid "Back" +msgstr "" + +#: templates/show.tpl:43 templates/search.tpl:51 +msgid "Modify" +msgstr "" + +#: templates/show.tpl:44 templates/search.tpl:52 +msgid "Are you sure you want to archive this item?" +msgstr "" + +#: templates/show.tpl:44 templates/search.tpl:52 +msgid "Archive" +msgstr "" + +#: templates/show.tpl:45 templates/search.tpl:53 +msgid "Are you sure you want to delete this item?" +msgstr "" + +#: templates/show.tpl:45 templates/search.tpl:53 +msgid "Delete" +msgstr "" + +#: templates/search.tpl:8 +msgid "Pattern" +msgstr "" + +#: templates/search.tpl:16 +msgid "Nb by page" +msgstr "" + +#: templates/search.tpl:22 +msgid "Search" +msgstr "" + +#: templates/search.tpl:23 +msgid "Reset" +msgstr "" + +#: templates/search.tpl:28 templates/form.tpl:38 +msgid "Add" +msgstr "" + +#: templates/search.tpl:35 +msgid "Date" +msgstr "" + +#: templates/search.tpl:37 +msgid "Actions" +msgstr "" + +#: templates/search.tpl:47 templates/search.tpl:50 +msgid "View" +msgstr "" + +#: templates/search.tpl:59 +msgid "No item found." +msgstr "" + +#: templates/search.tpl:68 +msgid "%3 element" +msgid_plural "Elements %1 to %2 on %3" +msgstr[0] "" +msgstr[1] "" + +#: templates/homepage.tpl:5 +msgid "Hello, world!" +msgstr "" + +#: templates/homepage.tpl:6 +msgid "" +"This is a simple app to show the different possibilities and basic " +"functionality." +msgstr "" + +#: templates/homepage.tpl:8 +msgid "This app contains some demo pages:" +msgstr "" + +#: templates/homepage.tpl:9 +msgid "Search page" +msgstr "" + +#: templates/form.tpl:36 +msgid "Save" +msgstr "" diff --git a/example/locales/templates-1-messages.pot b/example/locales/templates-1-messages.pot new file mode 100644 index 0000000..2591830 --- /dev/null +++ b/example/locales/templates-1-messages.pot @@ -0,0 +1,28 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +#: 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 homepage.tpl file to overwrite " +"it. You could also overwrite the URL handler for the root of the web " +"application." +msgstr "" diff --git a/src/I18n.php b/src/I18n.php index 9885ac8..28fd96a 100644 --- a/src/I18n.php +++ b/src/I18n.php @@ -274,29 +274,31 @@ class I18n { __DIR__ // Run from EesyPHP src directory ); if (!is_array($eesyphp_php_files) || $eesyphp_php_files[0] != 0) { - Log :: fatal(_("Fail to list PHP files.")); + Log :: fatal(_("Fail to list EesyPHP PHP files.")); } // Extract messages from EesyPHP PHP files using xgettext + $pot_file = self :: $root_path."/eesyphp-messages.pot"; $result = run_external_command( array( "xgettext", "--from-code utf-8", "--language=PHP", - "-o", self :: $root_path."/eesyphp-messages.pot", // Output - "--omit-header", // No POT header - "--keyword=___", // Handle custom ___() translation function - "--files=-" // Read files to parse from STDIN + "-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 + $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(_("Fail to extract messages from PHP files using xgettext.")); - $pot_files[] = self :: $root_path."/eesyphp-messages.pot"; + Log :: fatal(_("Fail to extract messages from EesyPHP PHP files using xgettext.")); + if (is_file($pot_file)) + $pot_files[] = $pot_file; - // List PHP files to parse + // List application PHP files to parse $php_files = run_external_command( array('find', '-name', "'*.php'"), null, // no STDIN data @@ -304,75 +306,91 @@ class I18n { App :: root_directory_path() // Run from Application root directory ); if (!is_array($php_files) || $php_files[0] != 0) { - Log :: fatal(_("Fail to list PHP files.")); + 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", self :: $root_path."/php-messages.pot", // Output - "--omit-header", // No POT header - "--keyword=___", // Handle custom ___() translation function - "--files=-" // Read files to parse from STDIN + "-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 + $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"; - // List JS files to parse - $js_files = array(); - foreach(Tpl::static_directories() as $static_directory) { + // Extract messages from JS files using xgettext in each registered static directories + foreach(Tpl::static_directories() as $idx => $static_directory) { + // List JS files to parse $result = run_external_command( - array('find', escapeshellarg($static_directory), '-name', "'*.js'"), + array('find', escapeshellarg(basename($static_directory)), '-name', "'*.js'"), null, // no STDIN data - false // do not escape command args (already done) + false, // do not escape command args (already done) + dirname($static_directory) // Run from parent directory ); if (!is_array($result) || $result[0] != 0) { - Log :: fatal(_("Fail to list JS files in '%s' static directory."), $static_directory); + Log :: fatal(_("Fail to list JS files in the directory of static files '%s'."), $static_directory); return; } - $js_files[] = $result[1]; - } - // Extract messages from JS files using xgettext - $result = run_external_command( - array( - "xgettext", - "--from-code utf-8", - "--language=JavaScript", - "-o", self :: $root_path."/js-messages.pot", // Output - "--omit-header", // No POT header - "--keyword=___", // Handle custom ___() translation function - "--files=-" // Read files to parse from STDIN - ), - implode("\n", $js_files) // Pass JS files list via STDIN - ); - if (!is_array($result) || $result[0] != 0) - Log :: fatal(_("Fail to extract messages from JS files using xgettext.")); - $pot_files[] = self :: $root_path."/js-messages.pot"; - - if (Tpl :: initialized()) { - // Extract messages from templates files using tsmarty2c.php + // Extract messages from JS files using xgettext + $pot_file = self :: $root_path."/js-$idx-messages.pot"; $result = run_external_command( - array_merge( - array( - App :: root_directory_path()."/vendor/bin/tsmarty2c.php", - "-o", self :: $root_path."/templates-messages.pot", - ), - Tpl :: templates_directories(), - ) + array( + "xgettext", + "--from-code utf-8", + "--language=JavaScript", + "-o", $pot_file, // Output + "--omit-header", // No POT header + "--keyword=___", // Handle custom ___() translation function + "--files=-" // Read files to parse from STDIN + ), + $result[1], // Pass JS files list via STDIN + true, // Escape arguments + dirname($static_directory) // Run from parent directory ); if (!is_array($result) || $result[0] != 0) Log :: fatal( - _("Fail to extract messages from template files using tsmarty2c.php script.")); - $pot_files[] = self :: $root_path."/templates-messages.pot"; + _("Fail to extract messages from JS files in the directory of static files '%s' using xgettext."), + $static_directory); + if (is_file($pot_file)) + $pot_files[] = $pot_file; + } + + if (Tpl :: initialized()) { + foreach (Tpl :: templates_directories() as $idx => $templates_directory) { + // Extract messages from templates files using tsmarty2c.php + $result = run_external_command( + array( + App :: root_directory_path()."/vendor/smarty-gettext/smarty-gettext/tsmarty2c.php", + basename($templates_directory), + ), + null, // Pass nothing on STDIN + true, // Escape arguments + dirname($templates_directory) // Run from parent directory + ); + if (!is_array($result) || $result[0] != 0) + Log :: fatal( + _("Fail to extract messages from templates directory '%s' using tsmarty2c.php script."), + $templates_directory + ); + if (!$result[1]) continue; + $pot_file = self :: $root_path."/templates-$idx-messages.pot"; + $fd = fopen($pot_file, 'w'); + fwrite($fd, $result[1]); + fclose($fd); + $pot_files[] = $pot_file; + } } $fd = fopen(self :: $root_path."/headers.pot", 'w');