From e936064b7850222abef2340beef6fc850f6066b3 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 28 Jul 2021 17:13:10 +0200 Subject: [PATCH] Add translation system and improve URL routing system --- composer.json | 4 +- composer.lock | 1148 +++++++++++++++++++++++- includes/cli.php | 168 ++-- includes/config.inc.php | 3 + includes/core.php | 17 +- includes/db.php | 2 +- includes/functions.php | 51 ++ includes/mail.php | 2 +- includes/session.php | 6 + includes/smarty.php | 12 +- includes/translation.php | 120 +++ includes/url-helpers.php | 7 +- includes/url-public.php | 72 +- includes/url.php | 599 +++++++++---- lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo | Bin 0 -> 10781 bytes lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po | 830 +++++++++++++++++ lang/messages.pot | 524 +++++++++++ lang/php-messages.pot | 390 ++++++++ lang/templates-messages.pot | 136 +++ public_html/index.php | 2 +- templates/error_404.tpl | 2 +- templates/fatal_error.tpl | 6 +- templates/form.tpl | 12 +- templates/homepage.tpl | 8 +- templates/search.tpl | 44 +- templates/show.tpl | 18 +- 26 files changed, 3849 insertions(+), 334 deletions(-) create mode 100644 includes/translation.php create mode 100644 lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo create mode 100644 lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po create mode 100644 lang/messages.pot create mode 100644 lang/php-messages.pot create mode 100644 lang/templates-messages.pot diff --git a/composer.json b/composer.json index 4855452..7f6716d 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,8 @@ "require": { "envms/fluentpdo": "^1.1", "pear/console_table": "^1.3", - "brenard/php-unidecode": "dev-master" + "brenard/php-unidecode": "dev-master", + "smarty-gettext/smarty-gettext": "^1.6", + "smarty-gettext/tsmarty2c": "^0.2.1" } } diff --git a/composer.lock b/composer.lock index 581c9d3..26c5eed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d1f16b984c121a9716a4827bce42ea09", + "content-hash": "a04f1f6d9c33a934cf0fe14d26de9ae7", "packages": [ { "name": "brenard/php-unidecode", @@ -81,6 +81,54 @@ ], "time": "2018-04-27T19:01:30+00:00" }, + { + "name": "geekwright/po", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/geekwright/Po.git", + "reference": "31cfb43d44f2084f1d79bb7581c63412f41d592b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/geekwright/Po/zipball/31cfb43d44f2084f1d79bb7581c63412f41d592b", + "reference": "31cfb43d44f2084f1d79bb7581c63412f41d592b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Geekwright\\Po\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Richard Griffith", + "email": "richard@geekwright.com" + } + ], + "description": "Objects to assist in reading, manipulating and creating GNU gettext style PO files", + "homepage": "https://github.com/geekwright/Po", + "keywords": [ + "gettext", + "i18n", + "l10n", + "po", + "pot" + ], + "support": { + "issues": "https://github.com/geekwright/Po/issues", + "source": "https://github.com/geekwright/Po/tree/master" + }, + "time": "2016-08-24T22:08:24+00:00" + }, { "name": "pear/console_table", "version": "v1.3.1", @@ -135,6 +183,1104 @@ "console" ], "time": "2018-01-25T20:47:17+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "smarty-gettext/smarty-gettext", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/smarty-gettext/smarty-gettext.git", + "reference": "22e5b91b642cd643f9acdd8d04ab0e05647b98a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smarty-gettext/smarty-gettext/zipball/22e5b91b642cd643f9acdd8d04ab0e05647b98a7", + "reference": "22e5b91b642cd643f9acdd8d04ab0e05647b98a7", + "shasum": "" + }, + "require": { + "ext-gettext": "*", + "ext-pcre": "*", + "php": "~5.3|~7.0|~8.0" + }, + "require-dev": { + "azatoth/php-pgettext": "~1.0", + "phpunit/phpunit": ">=4.8.36", + "smarty/smarty": "3.1.*" + }, + "suggest": { + "azatoth/php-pgettext": "Support msgctxt for {t} via context parameter" + }, + "bin": [ + "tsmarty2c.php" + ], + "type": "library", + "autoload": { + "files": [ + "block.t.php", + "function.locale.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Sagi Bashari", + "email": "sagi@boom.org.il" + }, + { + "name": "Elan Ruusamäe", + "email": "glen@delfi.ee" + } + ], + "description": "Gettext plugin enabling internationalization in Smarty Package files", + "homepage": "https://github.com/smarty-gettext/smarty-gettext", + "support": { + "issues": "https://github.com/smarty-gettext/smarty-gettext/issues", + "source": "https://github.com/smarty-gettext/smarty-gettext/tree/1.6.2" + }, + "time": "2021-02-23T22:00:29+00:00" + }, + { + "name": "smarty-gettext/tsmarty2c", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/smarty-gettext/tsmarty2c.git", + "reference": "84b342e6fb7b4b5b3e92e732635f3b0bbc217649" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smarty-gettext/tsmarty2c/zipball/84b342e6fb7b4b5b3e92e732635f3b0bbc217649", + "reference": "84b342e6fb7b4b5b3e92e732635f3b0bbc217649", + "shasum": "" + }, + "require": { + "geekwright/po": "^1.0", + "php": "^5.5.9 || ^7.0", + "smarty-gettext/smarty-gettext": "^1.5.0", + "smarty/smarty": "<3.1.35", + "symfony/console": "^3.2|^4|^5", + "symfony/finder": "^2.8|^3.0|^4|^5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36|^5.7", + "symfony/var-dumper": "^3.3|^4|^5" + }, + "bin": [ + "bin/tsmarty2c.php" + ], + "type": "library", + "autoload": { + "psr-4": { + "SmartyGettext\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Elan Ruusamäe", + "email": "glen@pld-linux.org" + } + ], + "description": "Smarty Gettext Translation String Ripper", + "homepage": "https://github.com/smarty-gettext/tsmarty2c", + "support": { + "issues": "https://github.com/smarty-gettext/tsmarty2c/issues", + "source": "https://github.com/smarty-gettext/tsmarty2c/tree/0.2.1" + }, + "time": "2020-11-11T21:40:04+00:00" + }, + { + "name": "smarty/smarty", + "version": "v3.1.34", + "source": { + "type": "git", + "url": "https://github.com/smarty-php/smarty.git", + "reference": "c9f0de05f41b9e52798b268ab1e625fac3b8578c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/c9f0de05f41b9e52798b268ab1e625fac3b8578c", + "reference": "c9f0de05f41b9e52798b268ab1e625fac3b8578c", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "phpunit/phpunit": "6.4.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "libs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Monte Ohrt", + "email": "monte@ohrt.com" + }, + { + "name": "Uwe Tews", + "email": "uwe.tews@googlemail.com" + }, + { + "name": "Rodney Rehm", + "email": "rodney.rehm@medialize.de" + } + ], + "description": "Smarty - the compiling PHP template engine", + "homepage": "http://www.smarty.net", + "keywords": [ + "templating" + ], + "support": { + "forum": "http://www.smarty.net/forums/", + "irc": "irc://irc.freenode.org/smarty", + "issues": "https://github.com/smarty-php/smarty/issues", + "source": "https://github.com/smarty-php/smarty/tree/v3.1.34" + }, + "time": "2019-02-28T06:42:20+00:00" + }, + { + "name": "symfony/console", + "version": "v5.3.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1", + "reference": "ebd610dacd40d75b6a12bf64b5ccd494fc7d6ab1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.3.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-26T16:33:26+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T23:28:01+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.3.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "17f50e06018baec41551a71a15731287dbaab186" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/17f50e06018baec41551a71a15731287dbaab186", + "reference": "17f50e06018baec41551a71a15731287dbaab186", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.3.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-23T15:54:19+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-04-01T10:43:52+00:00" + }, + { + "name": "symfony/string", + "version": "v5.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-27T11:44:38+00:00" } ], "packages-dev": [], diff --git a/includes/cli.php b/includes/cli.php index 729b948..c6128df 100644 --- a/includes/cli.php +++ b/includes/cli.php @@ -42,21 +42,28 @@ function usage($error=false) { if ($error) echo "$error\n\n"; - echo "Usage : ".$argv[0]." [-h] [-qd] command\n"; - echo " -h Show this message\n"; - echo " -q / -d Quiet/Debug mode\n"; - echo " command Command to run\n"; + printf(_("Usage: %s [-h] [-qd] command\n"), $argv[0]); + echo _(" -h Show this message\n"); + echo _(" -q / -d Quiet/Debug mode\n"); + echo _(" command Command to run\n"); echo "\n"; - echo "Available commands :\n"; + echo _("Available commands:\n"); foreach ($cli_commands as $command => $info) { if ($cli_command && $command != $cli_command) continue; - echo " $command : ".$info['short_desc']."\n"; - echo " ".$argv[0]." $command ".($info['usage_args']?$info['usage_args']:'')."\n"; + echo " $command: "._($info['short_desc'])."\n"; + echo " ".$argv[0]." $command ".($info['usage_args']?_($info['usage_args']):'')."\n"; if ($info['long_desc']) { - if (is_array($info['long_desc'])) - $info['long_desc'] = implode("\n", $info['long_desc']); + if (is_array($info['long_desc'])) { + $lines = array(); + foreach ($info['long_desc'] as $line) + $lines[] = _($line); + $info['long_desc'] = implode("\n", $lines); + } + else + $info['long_desc'] = _($info['long_desc']); + echo "\n ".str_replace("\n", "\n ", wordwrap($info['long_desc']))."\n"; } echo "\n"; @@ -75,7 +82,7 @@ function handle_cli_args() { if (!$cli_command) $cli_command = $argv[$i]; else - usage("Only one command could be executed !"); + usage(_("Only one command could be executed !")); } else { switch($argv[$i]) { @@ -95,7 +102,9 @@ function handle_cli_args() { if ($cli_command) $command_args[] = $argv[$i]; else - usage("Invalid parameter \"".$argv[$i]."\".\nNote: Command's parameter/argument must be place after the command."); + usage( + sprintf(_("Invalid parameter \"%s\".\nNote: Command's parameter/argument must be place after the command."), $argv[$i]) + ); } } } @@ -111,18 +120,18 @@ function handle_cli_args() { exit($result?0:1); } catch(Exception $e) { - log_exception("An exception occured running command $cli_command"); + log_exception(sprintf(_("An exception occured running command %s"), $cli_command)); exit(1); } } function print_item_info($item) { - echo "Item #".$item['id']." :\n"; - echo "\tID : ".$item['id']."\n"; - echo "\tName : '".$item['name']."'\n"; - echo "\tDate : ".format_time($item['date'])."\n"; - echo "\tDescription : ".($item['description']?"'".$item['description']."'":"Not set")."\n"; - echo "\tStatus : '".$item['status']."'\n"; + printf(_("Item #%s:\n"), $item['id']); + printf("\t"._("ID: %s")."\n", $item['id']); + printf("\t"._("Name: '%s'")."\n", $item['name']); + printf("\t"._("Date: %s")."\n", format_time($item['date'])); + printf("\t"._("Description: %s")."\n", ($item['description']?"'".$item['description']."'":_("Not set"))); + printf("\t"._("Status: %s")."\n", $item['status']); return true; } @@ -175,7 +184,7 @@ function cli_list($command_args) { } if ($items['count'] == 0){ - echo "No item.\n"; + echo _("No item.\n"); return True; } @@ -201,32 +210,32 @@ function cli_list($command_args) { ); } echo $tbl->getTable(); - echo "\n".$items['count']." item(s)\n"; + echo "\n".sprintf(_("%d item(s)"), $items['count'])."\n"; return True; } add_cli_command( 'list', 'cli_list', - "List/search items", - "[patterns]", + ___("List/search items"), + ___("[patterns]"), array( - "-o|--orderby Ordering list criterion. Possible values :", + ___("-o|--orderby Ordering list criterion. Possible values:"), " - ".implode("\n - ", $orderbys), - "-r|--reverse Reverse order", - "-s|--status Filter on status. Possible values :", + ___("-r|--reverse Reverse order"), + ___("-s|--status Filter on status. Possible values:"), " - ".implode("\n - ", array_keys($status_list)), ) ); function cli_show($command_args) { if (count($command_args) != 1 || !check_id($command_args[0])) - usage('You must provide a valid ID.'); + usage(_('You must provide a valid ID.')); $item_id = $command_args[0]; $item = get_item($item_id); if (!$item) - logging('FATAL', "Item #$item_id not found."); + logging('FATAL', sprintf(_("Item #%s not found."), $item_id)); print_item_info($item); return True; @@ -234,46 +243,46 @@ function cli_show($command_args) { add_cli_command( 'show', 'cli_show', - "Show item", - "[ID]" + ___("Show item"), + ___("[ID]") ); function cli_delete($command_args) { if (count($command_args) != 1) - usage('You must provide item ID.'); + usage(_('You must provide item ID.')); // Check URI if (!check_id($command_args[0])) - logging('FATAL', "Invalid item ID"); + logging('FATAL', _("Invalid item ID")); // Check exist $item_id = $command_args[0]; $item = get_item($item_id); if (!$item) - logging('FATAL', "Item #$item_id not found."); + logging('FATAL', sprintf(_("Item #%s not found."), $item_id)); print_item_info($item); // Sure ? - echo "Are you sure you want to delete this item ? Type 'yes' to continue: "; + echo _("Are you sure you want to delete this item? Type 'yes' to continue: "); $handle = fopen ("php://stdin","r"); $line = fgets($handle); if(trim($line) != 'yes'){ - logging('WARNING', "User cancel"); + logging('WARNING', _("User cancel")); exit; } echo "\n"; if (!delete_item($item['id'])) - logging('FATAL', "An error occured deleting item #$item_id."); + logging('FATAL', sprintf(_("An error occured deleting item #%d."), $item_id)); return True; } add_cli_command( 'delete', 'cli_delete', - "Delete item", - "[item ID]" + ___("Delete item"), + ___("[item ID]") ); function cli_export($command_args) { @@ -285,8 +294,8 @@ function cli_export($command_args) { add_cli_command( 'export', 'cli_export', - "Export items (as CSV)", - "[output file path]" + ___("Export items (as CSV)"), + ___("[output file path]") ); function cli_restore($command_args) { @@ -298,8 +307,8 @@ function cli_restore($command_args) { add_cli_command( 'restore', 'cli_restore', - "Restore items (from CSV)", - "[input file path]" + ___("Restore items (from CSV)"), + ___("[input file path]") ); function cli_cron($command_args) { @@ -327,8 +336,8 @@ function cli_cron($command_args) { } if (!is_int($item_max_age) || $item_max_age <= 0) - logging('FATAL', 'Invalid $item_max_age value set in configuration : it\'s must be a positive integer.'); - logging('DEBUG', "cli_cron() : item max age = $item_max_age day(s)"); + logging('FATAL', 'Invalid $item_max_age value set in configuration: it\'s must be a positive integer.'); + logging('DEBUG', "cli_cron(): item max age = $item_max_age day(s)"); $limit = time() - ($item_max_age * 86400); logging('DEBUG', "Handle items expiration with creation date limit ".format_time($limit)."."); @@ -338,19 +347,19 @@ function cli_cron($command_args) { foreach($items['items'] as $item) { if ($item['date'] < $limit) { if ($just_try) { - logging('DEBUG', 'Just-try mode : do not really delete item #'.$item['id'].' ('.$item['name'].', creation date : '.format_time($item['date']).')'); + logging('DEBUG', 'Just-try mode: do not really delete item #'.$item['id'].' ('.$item['name'].', creation date: '.format_time($item['date']).')'); } else if (delete_item($item['id'])) { - logging('INFO', 'item #'.$item['id'].' ('.$item['name'].') deleted (creation date : '.format_time($item['date']).')'); + logging('INFO', 'item #'.$item['id'].' ('.$item['name'].') deleted (creation date: '.format_time($item['date']).')'); remove_item_attachments($item['id']); } else { - logging('ERROR', 'Fail to delete item "'.$item['id'].'" ('.$item['name'].', creation date : '.format_time($item['date']).')'); + logging('ERROR', 'Fail to delete item "'.$item['id'].'" ('.$item['name'].', creation date: '.format_time($item['date']).')'); $error = true; } } else { - logging('DEBUG', 'item "'.$item['id'].'" ('.$item['name'].') still valid (creation date : '.format_time($item['date']).')'); + logging('DEBUG', 'item "'.$item['id'].'" ('.$item['name'].') still valid (creation date: '.format_time($item['date']).')'); } } exit($error?1:0); @@ -358,10 +367,69 @@ function cli_cron($command_args) { add_cli_command( 'cron', 'cli_cron', - "Cron to handle items expiration", + ___("Cron to handle item expiration"), false, array ( - "-j/--just-try Just-try mode : do not really removed expired item(s)", - "-m/--max-day item expiration limit (in day, default = ".(isset($item_max_age)?$item_max_age:183).")" + ___("-j/--just-try Just-try mode : do not really removed expired item(s)"), + ___("-m/--max-age Item expiration limit (in days, optional)"), ) ); + + +function cli_extract_messages($command_args) { + global $root_dir_path, $root_lang_dir, $smarty_templates_dir; + + // List PHP files to parse + $php_files = run_external_command( + array('find', escapeshellarg($root_dir_path), '-name', "'*.php'"), + null, // no STDIN data + false // do not escape command args (already done) + ); + if (!is_array($php_files) || $php_files[0] != 0) { + logging('FATAL', _("Fail to list PHP files.")); + } + + // Extract messages from PHP files using xgettext + $result = run_external_command( + array( + "xgettext", + "--from-code utf-8", + "--language=PHP", + "-o", "$root_lang_dir/php-messages.pot", // 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 + ); + if (!is_array($result) || $result[0] != 0) + logging('FATAL', _("Fail to extract messages from PHP files using xgettext.")); + + // Extract messages from templates files using tsmarty2c.php + $result = run_external_command( + array ( + "$root_dir_path/vendor/bin/tsmarty2c.php", + "-o", "$root_lang_dir/templates-messages.pot", + $smarty_templates_dir, + ) + ); + if (!is_array($result) || $result[0] != 0) + logging('FATAL', _("Fail to extract messages from template files using tsmarty2c.php script.")); + + // Merge previous results in ldapsaisie.pot file using msgcat + $result = run_external_command(array( + 'msgcat', + "$root_lang_dir/php-messages.pot", + "$root_lang_dir/templates-messages.pot", + "-o", "$root_lang_dir/messages.pot", + )); + if (!is_array($result) || $result[0] != 0) + logging('FATAL', _("Fail to merge messages using msgcat.")); +} +add_cli_command( + 'extract_messages', + 'cli_extract_messages', + ___("Extract messages that need to be translated"), + null, + ___("This command could be used to generate/update lang/messages.pot file.") +); diff --git a/includes/config.inc.php b/includes/config.inc.php index f51d6d1..6f88298 100644 --- a/includes/config.inc.php +++ b/includes/config.inc.php @@ -43,6 +43,9 @@ $smarty_path = 'smarty3/Smarty.class.php'; $smarty_templates_dir = "$root_dir_path/templates"; $smarty_templates_c_dir = "$tmp_root_dir/templates_c"; +// Default locale (see lang directory for available languages list) +$default_locale = 'en_US.UTF8'; + // Session $session_timeout = 1800; // Session timeout dur to inactivity (in seconds) $session_max_duration = 43200; // Session max duration (in seconds, default : 12h) diff --git a/includes/core.php b/includes/core.php index 460122c..ef59286 100644 --- a/includes/core.php +++ b/includes/core.php @@ -20,7 +20,11 @@ set_include_path($root_dir_path.'/includes' . PATH_SEPARATOR . get_include_path( // Load composer autoload.php require("$root_dir_path/vendor/autoload.php"); +// API mode +$api_mode = false; + // Load configuration +require_once('translation.php'); require_once('config.inc.php'); // Check $public_root_url end @@ -37,10 +41,10 @@ require_once('session.php'); // Nomenclatures $status_list = array ( - 'pending' => 'En attente', - 'validated' => 'Validé', - 'refused' => 'Refusé', - 'archived' => 'Archivé', + 'pending' => ___('Pending'), + 'validated' => ___('Validated'), + 'refused' => ___('Refused'), + 'archived' => ___('Archived'), ); require_once('hooks.php'); @@ -49,3 +53,8 @@ require_once('smarty.php'); require_once('url.php'); require_once('url-helpers.php'); require_once('db.php'); + +// Initialize translation +init_translation(); +foreach($status_list as $key => $value) + $status_list[$key] = _($value); diff --git a/includes/db.php b/includes/db.php index 1bbc7eb..f777f87 100644 --- a/includes/db.php +++ b/includes/db.php @@ -28,7 +28,7 @@ try { } catch(Exception $e) { logging('ERROR',"Fail to connect to DB (DSN : '$db_dsn') : ".$e->getMessage()); - logging("FATAL", "Impossible de se connecter à la base de données"); + logging("FATAL", _('Unable to connect to the database.')); } /* diff --git a/includes/functions.php b/includes/functions.php index d4e5a06..2176337 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -293,3 +293,54 @@ function delete_directory($dir, $recursive=true) { } return rmdir($dir); } + +/* + * Run external command helper + */ + /** + * Run external command + * + * @param[in] $command string|array The command. It's could be an array of the command with its arguments. + * @param[in] $data_stdin string|null The command arguments (optional, default: null) + * @param[in] $escape_command_args boolean If true, the command will be escaped (optional, default: true) + * + * @retval false|array An array of return code, stdout and stderr result or False in case of fatal error + **/ + function run_external_command($command, $data_stdin=null, $escape_command_args=true) { + if (array($command)) + $command = implode(' ', $command); + if ($escape_command_args) + $command = escapeshellcmd($command); + logging('DEBUG', "Run external command: '$command'"); + $descriptorspec = array( + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w"), // stderr + ); + $process = proc_open($command, $descriptorspec, $pipes); + + if (!is_resource($process)) { + logging('ERROR', "Fail to run external command: '$command'"); + return false; + } + + if (!is_null($data_stdin)) { + fwrite($pipes[0], $data_stdin); + } + fclose($pipes[0]); + + $stdout = stream_get_contents($pipes[1]); + fclose($pipes[1]); + + $stderr = stream_get_contents($pipes[2]); + fclose($pipes[2]); + + $return_value = proc_close($process); + + if (!empty($stderr) || $return_value != 0) + logging('ERROR', "Externan command error:\nCommand : $command\nStdout :\n$stdout\n\n - Stderr :\n$stderr"); + else + logging('DEBUG', "Externan command result:\n\tCommand : $command\n\tReturn code: $return_value\n\tOutput:\n\t\t- Stdout :\n$stdout\n\n\t\t- Stderr :\n$stderr"); + + return array($return_value, $stdout, $stderr); + } diff --git a/includes/mail.php b/includes/mail.php index f245c3f..29afe63 100644 --- a/includes/mail.php +++ b/includes/mail.php @@ -9,7 +9,7 @@ function send_mail($from, $to, $subject, $msg, $headers=array(), $attachments=ar $mail_obj = Mail::factory($mail_send_method, $mail_send_params); if ($mail_catch_all) { - $msg.="\n\n\nMail originalement destiné à ".(is_array($to)?implode(',', $to):$to); + $msg .= sprintf(_("\n\n\nMail initialy intended for %s."), (is_array($to)?implode(',', $to):$to)); $to = $mail_catch_all; } diff --git a/includes/session.php b/includes/session.php index 48a92b5..7297185 100644 --- a/includes/session.php +++ b/includes/session.php @@ -31,3 +31,9 @@ if ($session_timeout) { session_destroy(); } } + +function check_session_key($value=null) { + if (is_null($value) && isset($_REQUEST['session_key'])) + $value = $_REQUEST['session_key']; + return ($value && $_SESSION['session_key'] == $value); +} diff --git a/includes/smarty.php b/includes/smarty.php index 8e89451..cbeea2d 100644 --- a/includes/smarty.php +++ b/includes/smarty.php @@ -58,7 +58,7 @@ elseif (method_exists($smarty,'registerPlugin')) { } } else { - logging('FATAL', 'Smarty version not recognized !'); + logging('FATAL', _('Smarty version not supported.')); } // Configure templates/templates_c directories @@ -131,7 +131,7 @@ function _defineCommonTemplateVariables($template, $pagetitle) { function display_template($template, $pagetitle=false) { if (!$template) - logging("FATAL", "Aucun template fourni."); + logging("FATAL", _("No template specified.")); global $smarty; try { _defineCommonTemplateVariables($template, $pagetitle); @@ -142,7 +142,7 @@ function display_template($template, $pagetitle=false) { catch (Exception $e) { log_exception($e, "Smarty - An exception occured displaying template '$template'"); if ($template != 'fatal_error.tpl') - logging("FATAL", "Une erreur est survenue en affichant cette page."); + logging("FATAL", _("An error occurred while viewing this page.")); } } @@ -165,7 +165,7 @@ function display_ajax_return($data) { $ajax=false; function fatal_error($error) { - global $smarty, $ajax; + global $smarty, $ajax, $api_mode; if (php_sapi_name() == "cli") die("FATAL ERROR : $error\n"); @@ -173,8 +173,8 @@ function fatal_error($error) { // Set HTTP reponse code to 500 http_response_code(500); - if ($ajax) - display_ajax_return(array('error' => $error)); + if ($ajax || $api_mode) + display_ajax_return(array('success' => false, 'error' => $error)); $smarty->assign('fatal_error', $error); display_template('fatal_error.tpl'); diff --git a/includes/translation.php b/includes/translation.php new file mode 100644 index 0000000..e580936 --- /dev/null +++ b/includes/translation.php @@ -0,0 +1,120 @@ + 'ASC', ); if (isset($_REQUEST['clear']) && $_REQUEST['clear']=='true') - redirect($url_info['current_page']); + redirect($request -> current_url); } logging('DEBUG', 'Request params : '.vardump($_REQUEST)); - $status_list['all'] = 'Peu importe'; + $status_list['all'] = _('Any'); if (isset($_REQUEST['status'])) { if (check_status($_REQUEST['status']) || $_REQUEST['status'] == 'all') $_SESSION['search']['status'] = $_REQUEST['status']; @@ -81,7 +81,7 @@ function handle_search($url_info) { logging('DEBUG', 'Search params : '.vardump($_SESSION['search'])); $result = search_items($_SESSION['search']); if (!is_array($result)) - fatal_error("Une erreur est survenue en listant les éléments. Si le problème persiste, merci de prendre contact avec le support."); + fatal_error(_("An error occurred while listing the items. If the problem persists, please contact support.")); $smarty -> assign('result', $result); $smarty -> assign('search', $_SESSION['search']); @@ -93,7 +93,7 @@ function handle_search($url_info) { add_js_file('lib/myconfirm.js'); add_js_file('js/search.js'); - display_template("search.tpl", "Recherche"); + display_template("search.tpl", _("Search")); } add_url_handler('|^item/?$|', 'handle_search'); @@ -101,10 +101,10 @@ add_url_handler('|^item/?$|', 'handle_search'); * One item pages */ -function handle_show($url_info) { +function handle_show($request) { global $smarty; - $item = get_item_from_url($url_info['id']); + $item = get_item_from_url($request -> id); if (!$item) error_404(); @@ -115,11 +115,11 @@ function handle_show($url_info) { add_js_file('lib/bootstrap4-dialog/bootstrap-dialog.min.js'); add_js_file('lib/myconfirm.js'); - display_template("show.tpl", "Élement ".(is_array($item)?$item['name']:"#".$url_info['id'])); + display_template("show.tpl", sprintf(_("Element %s"), (is_array($item)?$item['name']:"#".$request -> id))); } add_url_handler('|^item/(?P[0-9]+)$|', 'handle_show'); -function handle_create($url_info) { +function handle_create($request) { global $smarty, $status_list; $info = array(); @@ -127,33 +127,33 @@ function handle_create($url_info) { if (isset($_POST['submit']) && empty($field_errors)) { $item = add_item($info); if (is_array($item)) { - add_message("L'élément '".$item['name']."' a bien été créé."); + add_message(sprintf(_("The element '% s' has been created."), $item['name'])); redirect('item/'.$item['id']); } else { - add_error("Une erreur est survenue en enregistrant cet élément."); + add_error(_("An error occurred while saving this item.")); } } logging('DEBUG', 'Validated data : '.vardump($info)); logging('DEBUG', 'Fields errors : '.vardump($field_errors)); if (isset($_POST['submit']) && !empty($field_errors)) - add_error("Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger avant de tenter d'ajouter cet élément."); + add_error(_("There are errors preventing this item from being saved. Please correct them before attempting to add this item.")); $smarty->assign('submited', isset($_POST['submit'])); $smarty->assign('info', $info); $smarty->assign('field_errors', $field_errors); $smarty->assign('status_list', $status_list); - display_template("form.tpl", "Nouveau"); + display_template("form.tpl", _("New")); } add_url_handler('|^item/new$|', 'handle_create'); -function handle_modify($url_info) { +function handle_modify($request) { global $smarty, $status_list; - $item = get_item_from_url($url_info['id']); + $item = get_item_from_url($request -> id); if(is_array($item)) { if (!can_modify($item)) { - add_error('Vous ne pouvez pas modifier cet élément.'); + add_error(_('You cannot edit this item.')); redirect('item/'.$item['id']); } $info = array(); @@ -166,22 +166,22 @@ function handle_modify($url_info) { } logging('DEBUG', 'Changes : '.vardump($changes)); if (empty($changes)) { - add_message("Vous n'avez apporté aucune modification à l'élément '".$item['name']."'."); + add_message(sprintf(_("You have not made any changes to element '% s'."), $item['name'])); redirect('item/'.$item['id']); } else if (update_item($item['id'], $changes) === true) { - add_message("L'élément '".$item['name']."' a bien été mise à jour."); + add_message(sprintf(_("The element '% s' has been updated successfully."), $item['name'])); redirect('item/'.$item['id']); } else { - add_error("Une erreur est survenue en mettant à jour cet élément."); + add_error(_("An error occurred while updating this item.")); } } logging('DEBUG', 'Validated data : '.vardump($info)); logging('DEBUG', 'Fields errors : '.vardump($field_errors)); $smarty->assign('submited', isset($_POST['submit'])); if (isset($_POST['submit']) && !empty($field_errors)) - add_error("Des erreurs empêchent l'enregistrement de cet élément. Merci de les corriger avant de tenter d'enregistrer vos modifications."); + add_error(_("There are errors preventing this item from being saved. Please correct them before attempting to save your changes.")); $smarty->assign('info', (!empty($info)?$info:$item)); $smarty->assign('item_id', $item['id']); $smarty->assign('field_errors', $field_errors); @@ -191,49 +191,49 @@ function handle_modify($url_info) { error_404(); } - display_template("form.tpl", "Élement ".(is_array($item)?$item['name']:"#".$url_info['id'])." : Modification"); + display_template("form.tpl", sprintf(_("Element %s: Modification"), (is_array($item)?$item['name']:"#".$request -> id))); } add_url_handler('|^item/(?P[0-9]+)/modify$|', 'handle_modify'); -function handle_archive($url_info) { +function handle_archive($request) { global $smarty; - $item = get_item_from_url($url_info['id']); + $item = get_item_from_url($request -> id); if(!is_array($item)) { - add_error("Élement #".$url_info['id']." introuvable."); + add_error(sprintf(_("Item #% s not found."), $request -> id)); redirect('item'); } elseif ($item['status'] == 'archived') { - add_message("Cet élément est déjà archivé."); + add_message(_("This item is already archived.")); } else if (!can_archive($item)) { - add_error('Vous ne pouvez pas archiver cet élément.'); + add_error(_('You cannot archive this item.')); } else if (archive_item($item['id']) === true) { - add_message("L'élément '".$item['name']."' a bien été archivé."); + add_message(sprintf(_("The element '% s' has been archived successfully."), $item['name'])); } else { - add_error("Une erreur est survenue en archivant cet élément."); + add_error(_('An error occurred while archiving this item.')); } redirect('item/'.$item['id']); } add_url_handler('|^item/(?P[0-9]+)/archive$|', 'handle_archive'); -function handle_delete($url_info) { +function handle_delete($request) { global $smarty; - $item = get_item_from_url($url_info['id']); + $item = get_item_from_url($request -> id); if(!is_array($item)) { - add_error("Élement #".$url_info['id']." introuvable."); + add_error(sprintf(_("Item #% s not found."), $request -> id)); } else if (!can_delete($item)) { - add_error('Vous ne pouvez pas supprimer cet élément.'); + add_error(_('You cannot delete this item.')); } else if (delete_item($item['id']) === true) { - add_message("L'élément '".$item['name']."' a bien été supprimé."); + add_message(sprintf(_("The element '% s' has been deleted successfully."), $item['name'])); } else { - add_error("Une erreur est survenue en supprimant cet élément."); + add_error(_('An error occurred while deleting this item.')); redirect('item/'.$item['id']); } redirect('item'); diff --git a/includes/url.php b/includes/url.php index 7bd1dbd..43bcba1 100644 --- a/includes/url.php +++ b/includes/url.php @@ -1,245 +1,474 @@ [a-zA-Z0-9]+)$|' => array ( + * 'handler' => 'get', + * 'authenticated' => true, + * 'api_mode' => false, + * 'methods' => array('GET'), + * ), + * '|get/all$|' => => array ( + * 'handler' => 'get_all', + * 'authenticated' => true, + * 'api_mode' => false, + * 'methods' => array('GET', 'POST'), + * ), + * ) + * + */ $url_patterns =array(); -function add_url_handler($pattern, $handler=null, $override=true) { - global $url_patterns; - if (is_array($pattern)) { - if (is_null($handler)) - foreach($pattern as $p => $h) - add_url_handler($p, $h, $override); - else - foreach($pattern as $p) - add_url_handler($p, $handler, $override); - } - else { - if (!isset($url_patterns[$pattern])) { - $url_patterns[$pattern] = $handler; - } - elseif ($override) { - logging('DEBUG', "URL : override pattern '$pattern' with handler '$handler' (old handler = '".$url_patterns[$pattern]."')"); - $url_patterns[$pattern] = $handler; - } - else { - logging('DEBUG', "URL : pattern '$pattern' already defined : do not override."); - } - } +/** + * Add an URL pattern + * + * @param[in] $pattern string The URL pattern (required) + * @param[in] $handler callable The URL pattern handler (must be callable, required) + * @param[in] $authenticated boolean Permit to define if this URL is accessible only for authenticated users (optional, default: true) + * @param[in] $override boolean Allow override if a command already exists with the same name (optional, default: false) + * @param[in] $api_mode boolean Enable API mode (optional, default: false) + * @param[in] $methods array|null HTTP method (optional, default: array('GET', 'POST')) + **/ +function add_url_handler($pattern, $handler=null, $authenticated=false, $override=true, $api_mode=false, $methods=null) { + if (is_null($methods)) + $methods = array('GET', 'POST'); + elseif (!is_array($methods)) + $methods = array($methods); + global $url_patterns; + if (is_array($pattern)) { + if (is_null($handler)) + foreach($pattern as $p => $h) + add_url_handler($p, $h, $authenticated, $override, $api_mode, $methods); + else + foreach($pattern as $p) + add_url_handler($p, $handler, $authenticated, $override, $api_mode, $methods); + } + else { + if (!isset($url_patterns[$pattern])) { + $url_patterns[$pattern] = array( + 'handler' => $handler, + 'authenticated' => $authenticated, + 'api_mode' => $api_mode, + 'methods' => $methods, + ); + } + elseif ($override) { + logging('DEBUG', "URL : override pattern '$pattern' with handler '$handler' (old handler = '".$url_patterns[$pattern]."')"); + $url_patterns[$pattern] = array( + 'handler' => $handler, + 'authenticated' => $authenticated, + 'api_mode' => $api_mode, + 'methods' => $methods, + ); + } + else { + logging('DEBUG', "URL : pattern '$pattern' already defined : do not override."); + } + } } /* * Error 404 page */ -function error_404($url_infos=array()) { - display_template('error_404.tpl', "Oups ! Page introuvable"); - exit(); + + /** + * Error 404 handler + * + * @param[in] $request UrlRequest|null The request (optional, default: null) + * + * @retval void + **/ +function error_404($request=null) { + display_template('error_404.tpl', _("Whoops ! Page not found")); + exit(); } $_404_url_handler = 'error_404'; function set_404_url_handler($handler=null) { - global $_404_url_handler; - $_404_url_handler = $handler; + global $_404_url_handler; + $_404_url_handler = $handler; } /* - * URL patterns : + * Interprets the requested URL and return the corresponding UrlRequest object * - * array ( - * '[URL pattern]' => '[handler]', - * [...] - * ) - * - * Example : - * - * array ( - * '#get/(?P[a-zA-Z0-9]+)$#' => 'get_by_name', - * '#get/status/(?Ppending|archived)$#' => 'get_by_status', - * '#get/all$#' => 'get_all', - * ) - * - * Return example (for the last one previous URL pattern) : - * - * return : array ( - * 'handler' => 'get', - * 'current_page' => 'get/[name]', - * 'name' => [name], - * ) + * @param[in] $default_url string|null The default URL if current one does not + * match with any configured pattern. * + * @retval UrlRequest The UrlRequest object corresponding to the the requested URL. */ -function get_current_url_handler($url_patterns=null, $default_page=false) { - global $_404_url_handler; - if (is_null($url_patterns)) - global $url_patterns; - $current_page = get_current_page(); - if ($current_page === false) { - logging('FATAL', 'Impossible de déterminer la page demandée. Si le problème persiste, merci de prendre contact avec le support.'); - exit(); - } - if (!is_array($url_patterns)) { - logging('FATAL', 'URL : No URL patterns provided !'); - exit(); - } - - logging('DEBUG', "URL : current page = '$current_page'"); - logging('DEBUG', "URL : check current page with the following URL patterns :\n - ".implode("\n - ", array_keys($url_patterns))); - foreach ($url_patterns as $pattern => $handler) { - $m = url_match($pattern, $current_page); - if (is_array($m)) { - $m['handler'] = $handler; - $m['current_page'] = $current_page; - // Reset last redirect - if (isset($_SESSION['last_redirect'])) - unset($_SESSION['last_redirect']); - logging('DEBUG', "URL : result :\n".print_r($m, 1)); - return $m; - } - } - if ($default_page !== false) { - logging('DEBUG', "Current page match with no pattern. Redirect to default page ('$default_page')"); - redirect($default_page); - exit(); - } - elseif ($_404_url_handler) { - logging('DEBUG', "Current page match with no pattern. Use error 404 handler."); - return array('handler' => $_404_url_handler); +function get_request($default_url=null) { + global $url_patterns, $_404_url_handler; + $current_url = get_current_url(); + if ($current_url === false) { + logging('FATAL', _('Unable to determine the requested page. If the problem persists, please contact support.')); + exit(); } - return False; + if (!is_array($url_patterns)) { + logging('FATAL', 'URL : No URL patterns configured !'); + exit(); + } + + logging('DEBUG', "URL : current url = '$current_url'"); + logging('DEBUG', "URL : check current url with the following URL patterns :\n - ".implode("\n - ", array_keys($url_patterns))); + foreach ($url_patterns as $pattern => $handler_infos) { + $m = url_match($pattern, $current_url, $handler_infos['methods']); + if (is_array($m)) { + $request = new UrlRequest($current_url, $handler_infos, $m); + // Reset last redirect + if (isset($_SESSION['last_redirect'])) + unset($_SESSION['last_redirect']); + logging('DEBUG', "URL : result :\n".varDump($request, 1)); + return $request; + } + } + if ($default_url !== false) { + logging('DEBUG', "Current url match with no pattern. Redirect to default url ('$default_url')"); + redirect($default_url); + exit(); + } + // Error 404 + $api_mode = (strpos($current_url, 'api/') === 0); + logging('DEBUG', "Current URL match with no pattern. Use error 404 handler (API mode=$api_mode)."); + return new UrlRequest( + $current_url, + array( + 'handler' => $_404_url_handler, + 'authenticated' => false, + 'api_mode' => $api_mode, + ) + ); } -function url_match($pattern, $current_page=false) { - if ($current_page === false) { - $current_page = get_current_page(); - if (!$current_page) return False; - } - if (preg_match($pattern, $current_page, $m)) { - logging('DEBUG', "URL : Match found with pattern '$pattern' :\n\t".str_replace("\n", "\n\t", print_r($m, 1))); - return $m; - } - return False; +/** + * Check if the current requested URL match with a specific pattern + * + * @param[in] $pattern string The URL pattern + * @param[in] $current_url string|false The current URL (optional) + * @param[in] $methods array|null HTTP method (optional, default: no check) + * + * @retval array|false The URL info if pattern matched, false otherwise. + **/ +function url_match($pattern, $current_url=false, $methods=null) { + if ($methods && !in_array($_SERVER['REQUEST_METHOD'], $methods)) + return false; + if ($current_url === false) { + $current_url = get_current_url(); + if (!$current_url) return False; + } + if (preg_match($pattern, $current_url, $m)) { + logging('DEBUG', "URL : Match found with pattern '$pattern' :\n\t".str_replace("\n", "\n\t", print_r($m, 1))); + return $m; + } + return False; } -function get_current_page() { - if (isset($_REQUEST['go'])) - return $_REQUEST['go']; - else - return detect_current_page(); +/* + * Retreive current requested URL and return it + * + * @retval string|false The current request URL or false if fail + **/ +function get_current_url() { + if (isset($_REQUEST['go'])) + return $_REQUEST['go']; + return detect_current_url(); } -function detect_current_page() { - logging('DEBUG', "URL : request URI = '".$_SERVER['REQUEST_URI']."'"); +/* + * Try to detect current requested URL and return it + * + * @retval string|false The current request URL or false if detection fail + **/ +function detect_current_url() { + logging('DEBUG', "URL : request URI = '".$_SERVER['REQUEST_URI']."'"); - $base = get_rewrite_base(); - logging('DEBUG', "URL : rewrite base = '$base'"); + $base = get_rewrite_base(); + logging('DEBUG', "URL : rewrite base = '$base'"); - if ($_SERVER['REQUEST_URI'] == $base) - return ''; + if ($_SERVER['REQUEST_URI'] == $base) + return ''; - if (substr($_SERVER['REQUEST_URI'], 0, strlen($base)) != $base) { - logging('ERROR', "URL : request URI (".$_SERVER['REQUEST_URI'].") does not start with rewrite base ($base)"); - return False; - } + if (substr($_SERVER['REQUEST_URI'], 0, strlen($base)) != $base) { + logging('ERROR', "URL : request URI (".$_SERVER['REQUEST_URI'].") does not start with rewrite base ($base)"); + return False; + } - $current_page = substr($_SERVER['REQUEST_URI'], strlen($base)); + $current_url = substr($_SERVER['REQUEST_URI'], strlen($base)); - // URL contain params ? - $params_start = strpos($current_page, '?'); - if ($params_start !== false) - // Params detected, remove it + // URL contain params ? + $params_start = strpos($current_url, '?'); + if ($params_start !== false) + // Params detected, remove it - // No page / currrent page start by '?' ? - if ($params_start == 0) - return ''; - else - return substr($current_page, 0, $params_start); + // No url / currrent url start by '?' ? + if ($params_start == 0) + return ''; + else + return substr($current_url, 0, $params_start); - return $current_page; + return $current_url; } +/** + * Try to detect rewrite base from public root URL + * + * @retval string The detected rewrite base + **/ function get_rewrite_base() { - global $public_root_url; - if (preg_match('|^https?://[^/]+/(.*)$|', $public_root_url, $m)) - return '/'.remove_trailing_slash($m[1]).'/'; - elseif (preg_match('|^/(.*)$|', $public_root_url, $m)) - return '/'.remove_trailing_slash($m[1]).'/'; - return '/'; + global $public_root_url; + if (preg_match('|^https?://[^/]+/(.*)$|', $public_root_url, $m)) + return '/'.remove_trailing_slash($m[1]).'/'; + elseif (preg_match('|^/(.*)$|', $public_root_url, $m)) + return '/'.remove_trailing_slash($m[1]).'/'; + return '/'; } +/** + * Trigger redirect to specified URL (or homepage if omited) + * + * @param[in] $go string|false The destination URL + * + * @retval void + **/ function redirect($go=false) { - global $public_root_url; + global $public_root_url; - if ($go===false) - $go = ""; + if ($go===false) + $go = ""; - if (preg_match('#^https?://#',$go)) - $url = $go; - elseif (isset($public_root_url) && $public_root_url) { - // Check $public_root_url end - if (substr($public_root_url, -1)=='/') { - $public_root_url=substr($public_root_url, 0, -1); - } - $url="$public_root_url/$go"; - } - else - $url="/$go"; + if (is_absolute_url($go)) + $url = $go; + elseif (isset($public_root_url) && $public_root_url) { + // Check $public_root_url end + if (substr($public_root_url, -1)=='/') { + $public_root_url=substr($public_root_url, 0, -1); + } + $url="$public_root_url/$go"; + } + else + $url="/$go"; - // Prevent loop - if (isset($_SESSION['last_redirect']) && $_SESSION['last_redirect'] == $url) - logging('FATAL', 'Impossible de déterminer la page demandée (boucle). Si le problème persiste, merci de prendre contact avec le support.'); - else - $_SESSION['last_redirect'] = $url; + // Prevent loop + if (isset($_SESSION['last_redirect']) && $_SESSION['last_redirect'] == $url) + logging('FATAL', _('Unable to determine the requested page (loop detected). If the problem persists, please contact support.')); + else + $_SESSION['last_redirect'] = $url; - logging('DEBUG',"redirect($go) => Redirect to : <$url>"); - header("Location: $url"); - exit(); + logging('DEBUG',"redirect($go) => Redirect to : <$url>"); + header("Location: $url"); + exit(); } -function handle_url($url_patterns=null, $default_url=null) { - global $smarty; - if (is_null($url_patterns)) global $url_patterns; - if (is_null($default_url)) global $default_url; +/** + * Handle the current requested URL + * + * @param[in] $default_url string|null The default URL if current one does not + * match with any configured pattern. + * + * @retval void + **/ +function handle_request($default_url=null) { + global $smarty, $api_mode; - global $url_info; - $url_info = get_current_url_handler(); + $request = get_request($default_url); - if (!is_array($url_info)) - logging('FATAL', "Une problème est survenu en interprétant l'URL de la page demandée."); + if (!is_callable($request -> handler)) { + logging('ERROR', "URL handler function ".$request -> handler."() does not exists !"); + logging('FATAL', _("This request cannot be processed.")); + } - if (!function_exists($url_info['handler'])) { - logging('ERROR', "URL handler function ".$url_info['handler']."() does not exists !"); - logging('FATAL', "Cette requête ne peut être traitée."); - } + if ($request -> api_mode) + $api_mode = true; + if (isset($smarty) && $smarty) + $smarty -> assign('request', $request); - if (isset($smarty) && $smarty) - $smarty -> assign('url_info', $url_info); + // Check authentication (if need) + if($request -> authenticated && function_exists('force_authentication')) + force_authentication(); - try { - return call_user_func($url_info['handler'], $url_info); - } - catch (Exception $e) { - log_exception($e, "An exception occured running URL handler function ".$url_info['handler']."()"); - logging('FATAL', "Cette requête n'a put être traitée correctement."); - } + try { + return call_user_func($request -> handler, $request); + } + catch (Exception $e) { + log_exception($e, "An exception occured running URL handler function ".$request -> handler."()"); + logging('FATAL', _("This request could not be processed correctly.")); + } } +/** + * Remove trailing slash in specified URL + * + * @param[in] $url string The URL + * + * @retval string The specified URL without trailing slash + **/ function remove_trailing_slash($url) { - if ($url == '/') - return $url; - elseif (substr($url, -1) == '/') - return substr($url, 0, -1); - return $url; + if ($url == '/') + return $url; + elseif (substr($url, -1) == '/') + return substr($url, 0, -1); + return $url; } +/** + * Check an AJAX request and trigger a fatal error on fail + * + * Check if session key is present and valid and set AJAX + * mode. + * + * @param[in] $session_key string The current session key (optional) + * + * @retval void + **/ function check_ajax_request($session_key=null) { - global $ajax, $debug_ajax; - $ajax=true; + global $ajax, $debug_ajax; + $ajax=true; - if (is_null($session_key) && isset($_REQUEST['session_key'])) - $session_key = $_REQUEST['session_key']; + if (check_session_key($session_key)) + fatal_error('Invalid request'); + + if ($debug_ajax) + logging('DEBUG',"Ajax Request : ".vardump($_REQUEST)); +} + +/** + * Get the public absolute URL + * + * @param[in] $relative_url string|null Relative URL to convert (Default: current URL) + * + * @retval string The public absolute URL + **/ +function get_absolute_url($relative_url=null) { + global $public_root_url; + if (!is_string($relative_url)) + $relative_url = get_current_url(); + if ($public_root_url[0] == '/') { + logging('DEBUG', "URL :: get_absolute_url($relative_url): configured public root URL is relative ($public_root_url) => try to detect it from current request infos."); + $public_root_url = 'http'.(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'?'s':'').'://'.$_SERVER['HTTP_HOST'].$public_root_url; + logging('DEBUG', "URL :: get_absolute_url($relative_url): detected public_root_url: $public_root_url"); + } + + if (substr($relative_url, 0, 1) == '/') + $relative_url = substr($url, 1); + $url = remove_trailing_slash($public_root_url)."/$relative_url"; + logging('DEBUG', "URL :: get_absolute_url($relative_url): result = $url"); + return $url; +} + +/** + * Check if specified URL is absolute + * + * @param[in] $url string The URL to check + * + * @retval boolean True if specified URL is absolute, False otherwise + **/ +function is_absolute_url($url) { + return boolval(preg_match('#^https?://#', $url)); +} + +/* + * Add parameter in specified URL + * + * @param[in] &$url string The reference of the URL + * @param[in] $param string The parameter name + * @param[in] $value string The parameter value + * @param[in] $encode boolean Set if parameter value must be URL encoded (optional, default: true) + * + * @retval string|null The completed URL + */ +function add_url_parameter(&$url, $param, $value, $encode=true) { + if (strpos($url, '?') === false) + $url .= '?'; + else + $url .= '&'; + $url .= "$param=".($encode?urlencode($value):$value); + return $url; +} + +/** + * URL request abstraction + * + * @author Benjamin Renard + */ +class UrlRequest { + + // The URL requested handler + private $current_url = null; + + // The URL requested handler + private $handler = null; + + // Request need authentication ? + private $authenticated = true; + + // API mode enabled ? + private $api_mode = false; + + // Parameters detected on requested URL + private $url_params = array(); + + public function __construct($current_url, $handler_infos, $url_params=array()) { + $this -> current_url = $current_url; + $this -> handler = $handler_infos['handler']; + $this -> authenticated = (isset($handler_infos['authenticated'])?boolval($handler_infos['authenticated']):true); + $this -> api_mode = (isset($handler_infos['api_mode'])?boolval($handler_infos['api_mode']):false); + $this -> url_params = $url_params; + } + + /** + * Get request info + * + * @param[in] $key string The name of the info + * + * @retval mixed The value + **/ + public function __get($key) { + if ($key == 'current_url') + return $this -> current_url; + if ($key == 'handler') + return $this -> handler; + if ($key == 'authenticated') + return $this -> authenticated; + if ($key == 'api_mode') + return $this -> api_mode; + if ($key == 'referer') + return $this -> get_referer(); + if ($key == 'http_method') + return $_SERVER['REQUEST_METHOD']; + if (array_key_exists($key, $this->url_params)) { + return urldecode($this->url_params[$key]); + } + // Unknown key, log warning + logging('WARNING', "__get($key): invalid property requested\n".get_debug_backtrace_context()); + } + + /** + * Check is request info is set + * + * @param[in] $key string The name of the info + * + * @retval boolval True is info is set, False otherwise + **/ + public function __isset($key) { + if (in_array($key, array('current_url', 'handler', 'authenticated'))) + return True; + return array_key_exists($key, $this->url_params); + } + + /* + * Get request referer (if known) + * + * @retval string|null The request referer URL if known, null otherwise + */ + public function get_referer() { + if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) + return $_SERVER['HTTP_REFERER']; + return null; + } - if ($_SESSION['session_key'] != $session_key) { - fatal_error('Invalid request'); - } - - if ($debug_ajax) - logging('DEBUG',"Ajax Request : ".vardump($_REQUEST)); } diff --git a/lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo b/lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.mo new file mode 100644 index 0000000000000000000000000000000000000000..29c240c0fdeb87274f63f9ff0111c55f0476608f GIT binary patch literal 10781 zcmcJUTWn?3dB+zCA;BaKA<(2H&^1hrJ(D@d%s_y6m{2np#$+yL#vVw93E4hp+1|rB zdmr}2W22~TP!fqg^r;m|npS|K5k`tywW4a8wrYBisy?(TiIj&_MXD54B7LY@RJE#5 z)!%>ZwU3WI_Arc+EwA(6mv#BpcmI~(xar#8HCzSl6STj0uQ9(5KJk8jxc>2aV|IYA zgS)}Ez}vywM~t}*JOJJbo(1_c7x*~>J_}BQe+NDQUVDQv7Mub<1(&w}3ucY)?Z)%)GxZXVBoW8jxT&9eq--tT}P0AB?)&tHM+ z|5NY~c*`#sb2IpP@LDhh`D6-E`+PRMe-YF?7s2bmKLjD&{As|y0YA+1KY(o6ya9e3 zd=va7@I8Elb>?I-UDj=hd}Xt8l%1~t9~!V0qlYTjo+wr0KpN?y-{{{y}Rj)K1jlXrpN2Y&_pH&FE7z@+-#1f?gl z;4Ih%kAdF>4}#Z0lm#CF4}edBuYzl!82x9r#b+ zo#2$M_O}FzzLx_2IVe8;0F*xc7}WQ-!5(-sFS#{e1!1kZ2#T)nhxb1K#h150+2Pya zS;7>3*Mpk>77!7e+d%Q-UQqKL1=X(wN*_{C^L+!9-n;~A{C7av_p6}f^BSme{{^bw zH5ixX{b0b`LG`-}lpG>Z{g*(7m;yWkJ`ak2Z-COf>o7*iX%F~Ga1K=eFM})Kx53{8 zZ=B_884VGbIhy>PuA3|Ha{nUt)8Y9B@I0+eI}_gR z1*HccprHz0#{nOUaCPPs?P;1~JSyaEdJ#NAli!i9MYQ@l6mF7$Cj*`UZ>32WV%iSc zaoX@DJ;YsjJ&}(&N_&J>UoCDFYu-znrJbYISC^X`X`iPp(H^7C(+<)erKL34e|<@J zb3KfVj2w^Rj*XMJh@;LbH-$^uu5B06%#P+wV{M~RWKqjmYiB)n)3&qY#gen#G%xJ3 z%jVPE?HWe^P{;F40#A#wXaW^jPc%0aFw3_d+X-}`C4iuzcYBbWU z&9*%O3_hu+I9X&A3~6PolF_?qXVN^6=R3|WN1f8;lctd|ICJnUuhzBpRCw}Jnnq5C zyoic2_jK`dBO&FPNy; z>%^^Uy9-&`wHMOtDSho_Y0qVyRTk>F2tvi`Xfc8roye1t*;bkqQLC_d+3TfQ(KJ&n zF(@}v?Y5ap0wtabh-kZx^9zgrcIRlD{u}y;(hEy5oQks6QoKAMQUkW{Jeb#S=<<69v|nV@wQM@46VmQg`@VFO+Yp^cS4wf&Ys2wc1ed3HId&HYU3+M1 z#fX)b^U7Gs7{*~EiTc$BG>R0GRWs!|>1sqQnX{{DiOj;yg(xX3Mpp40Im=!}(}Uah z^(?>2u6U5up0i`CE+5mn;%}UkZqk~mW!z9CQwh7sCr8XfQR^vl5L5Oh3F913*a1VA z&}%x2*denuhtx+ulQ=JPNNUHk2j7?b9Q*YA8@~7552FMah(@m8PTJ#XJ6;HeQh&e| z+0nfsWOSb_bM$U=ShmMJd(Gh$nM9>zb{u0oc>2sP-pY*@wLi?^c2wBJAwZ^?mz70H zE(2?uBl5|-b(_a{JDoW?V;8WM+?KiIzOv|wg09VX7zeL@D?d z#hmqtyh9tTxBkBCG8|`c?KK_Ud=YojG)G;hlggWP+IC0vw5NL9VWtmxR!=8*#2CLE zSRS|KnHFM~HBJ4^%Xa$E;JFuNQ5Sh;_Kwl~j^@aTRALUXVhsOQf1il5#nMZ%OK=ct z*){Y*r~D=sRw2A?k)Py0v}z)N-(_8vSoU9;G8!bTm8xV;L&@~=&^Wv9xdGleRx z(jtI+hp@wUuQg>1VU76^H}70hyRJ4wwOV8v3ngK{T40+IE%_7CE+V$+Q#rYJF{yX! z2;x#IGWRr*UqX^1u&auPNH6FCWFVP{=A-weaav-qUS#u5=1#DI{5m$bQo=lLrC6fZ zyd!O6GIXJfk5ibzySMQ$wP*L+{`sya`V?nK5)kR4^YTWhOSsZp zIh-t&Hdbmj+{2sh=1%O}3sIUomw2UzW_Xo&$>JVRRl;8cg=})YOIz-+8{-?)W0R_l zcha;6j|(Po?Oj)q?p)bIS2gjFpPN&8Am3rnHkQuu^K|=MtqCJ$F2`rX*p};!QAe!GqNl()ti+0963%9#U+_dbNK7#TxP>Z*CuTqvK!61B-PeJ-G~|} zN>*zX_rW^EGVh_PseJrF7nX@{=wuc1rVnlL(QBB#oSi;&&YX>tURmih_E9Y9ja1No zOUq*ONBYS7=jY5!mYzr6jp=sdOy#mC?a0i@231BZ2i~ZXqmg3~B^33X&p4E~@FrO- zVPs?0Mctw2NqoI50PR zq;daxKP`v#H4Y~&a;ju;(%wHG7bA~19)WMH=ndg z&p+k|_U$L4>&t=h#D2!^-L-#YP|2oQyckocRjFJX*BdAOHQRsTl4_Qy?UODtgK<0s zGv>aSb>+&YVs>hQ{0{@8=a$v1pDD)yC9Rmz6K&PCDtK#uX6>=4esH42t@PIvx-(zg z_SZW7H6<)tR=9rlLCHI5PdFcevltKBBfHG{Yb0FNew7psX3JTIvbVpMo5tpP_n7Ki zoXVK*5)$lxj;SH!?ECTb@aIy9DbGSspDa%%sF;8TI45R`sc_6(I&l;`R5-Izy zRMN$W6fg!=F}qkut7t&@L4e*%drmj)ahEZgF5*8&9INywJ4JsjLkBo_P>jK4(1F4` z(bjzMBUIx=T7CmATaMAGOKa%!*tpAZ^n+b&Bp<<0ccTF+;5uUiiC3ldWrkJ$P@`J# zU@%TGuh0&bsy|m;lRF8wQJqz`F zf6erNt8jT^ImJ)q{qI%A##1MavpNsnM7n+OvV(#WNwtSJe6^$OY=k&NdEfJV3 zDe*(4hC;OCyq6|A7*myh$`$nWRlBUEg*|zHRMq;67?kJK_MU3J>Sr0ac)GF;3}|p? z%Vb^KhYSDV`)YLmx!{a7)$jwKeW6z$1q{B0!vKYtecm}$rvY+4&{LlWz?n_nc|0n0 z%-ZD`VEu%EV@ltzPHthzvi9G9rQi#S-7e$8Ors>>Xi+Yl*ISJ1m1Le;Q_+jkI=8Ci z@#BQ_G1w3&nA4Qd~iB}9r!4zv>oXZJJVPPv_aH5vmkU6kh1>Eltv+5 zHO;Xh@^+3A{=E@XOZc;phycBL zr*^#Uyv4AIppC&S>zLvP*L*_m6dg!#z&dkAj(C^_my4=f2M&LpQdH+DMaAmj%uxp` zI$E*`Mla(*0+iQusq++tkKn(&*Bpv3!-G*7rH*wZ(z)x74T|MgiR^rgmG#%iYC?pO zh=vvL(th&a@7ybdo_FrpMQF;HWz~MC{uqUm11fgO{u1rygg2yqV94z-s?OLTH>gX4 zjZtqXqm!FavKKF+C6RZ(2-<5^h7*XY^lZ~`MUtQM!s|Q8>~e}L96Fgs4G!uUctZlK zj1vhKmNTf1&Y`@;ddCCvIDDB5gF>OAd~9G~Rg@5qeJm#sQ%GSqoVyhAc6G9Z?$q{j z$+3)xQjU$jm1LOfhcbg4+s}=cX2!}QbwZ@XnAxVl4XLU}lBO1L&IMvAr z99R$YepR-49zv_USK3xFY2b4qN?TqJubL4by1Cm}WL0zzqOk9_u_D+M+)!KCuM-?L z1_{(dB2vV*dCw|{Y-2oxSUT%G2Uf6PUl7R>g&S|XD(ou5TM{Vs_3*(@j@ zKkW18s(eKM<=N&Oh<^|t8w+Vmp~NcU^d%|f@u@CjSmM2}Ia#hB2n_{3K9V#`){0fn zc;6R}hBoEC&8@m_lP7Q4x3WnD*c#Twy6YIV-!n2%QhfPTMMfnl>;GZ$sxlPeA&#+4;ipdlrxvlG9;%XO&Em55%bmu-`HRymPx# literal 0 HcmV?d00001 diff --git a/lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po b/lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po new file mode 100644 index 0000000..2d26d2d --- /dev/null +++ b/lang/fr_FR.UTF8/LC_MESSAGES/DEFAULT.po @@ -0,0 +1,830 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \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" + +#: /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:203 +#: /home/brenard/dev/eesyphp/includes/url-public.php:227 +#, php-format +msgid "Item #% s not found." +msgstr "L'élément #%s est introuvable." + +#: /home/brenard/dev/eesyphp/includes/smarty.php:61 +msgid "Smarty version not supported." +msgstr "Une erreur est survenue en affichant cette page." + +#: /home/brenard/dev/eesyphp/includes/smarty.php:134 +msgid "No template specified." +msgstr "Aucun template spécifié." + +#: /home/brenard/dev/eesyphp/includes/smarty.php:145 +msgid "An error occurred while viewing this page." +msgstr "Une erreur est survenue en affichant cette page." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:7 +msgid "Hello world !" +msgstr "Bonjour tout le monde !" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:27 +msgid "Any" +msgstr "Peu importe" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:84 +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." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:96 +#: /home/brenard/dev/eesyphp/templates/search.tpl:22 +msgid "Search" +msgstr "Rechercher" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:118 +#, php-format +msgid "Element %s" +msgstr "Élément %s" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:130 +#, 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:134 +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:140 +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:146 +msgid "New" +msgstr "Nouveau" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:156 +msgid "You cannot edit this item." +msgstr "Vous ne pouvez pas modifier cet élément." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:169 +#, 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:173 +#, 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:177 +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:184 +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:194 +#, php-format +msgid "Element %s: Modification" +msgstr "Élément %s : Modification" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:207 +msgid "This item is already archived." +msgstr "Cet élément est déjà archivé." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:210 +msgid "You cannot archive this item." +msgstr "Vous ne pouvez pas archiver cet élément." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:213 +#, 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:216 +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:230 +msgid "You cannot delete this item." +msgstr "Vous ne pouvez pas supprimer cet élément." + +#: /home/brenard/dev/eesyphp/includes/url-public.php:233 +#, 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:236 +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 +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/mail.php:12 +#, php-format +msgid "" +"\n" +"\n" +"\n" +"Mail initialy intended for %s." +msgstr "" +"\n" +"\n" +"\n" +"Mail originalement destiné à %s." + +#: /home/brenard/dev/eesyphp/includes/url.php:86 +msgid "Whoops ! Page not found" +msgstr "Oups ! Page introuvable" + +#: /home/brenard/dev/eesyphp/includes/url.php:109 +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." + +#: /home/brenard/dev/eesyphp/includes/url.php:258 +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." + +#: /home/brenard/dev/eesyphp/includes/url.php:282 +msgid "This request cannot be processed." +msgstr "Cette requête ne peut être traitée." + +#: /home/brenard/dev/eesyphp/includes/url.php:299 +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:7 +#, php-format +msgid "The CLI command '%s' already exists." +msgstr "La commande CLI '%s' n'existe pas." + +#: /home/brenard/dev/eesyphp/includes/cli.php:12 +#, 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:45 +#, php-format +msgid "Usage: %s [-h] [-qd] command\n" +msgstr "Utilisation: %s [-h] [-qd] commande\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:46 +msgid " -h Show this message\n" +msgstr " -h Affiche ce message\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:47 +msgid " -q / -d Quiet/Debug mode\n" +msgstr " -q / -d Mode silencieux/debug\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:48 +msgid " --trace Trace mode (the most verbose)\n" +msgstr " --trace Mode trace (le plus verbeux)\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:49 +msgid " command Command to run\n" +msgstr " command La commande à exécuter\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:51 +msgid "Available commands:\n" +msgstr "Commandes disponibles:\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:86 +msgid "Only one command could be executed !" +msgstr "Une seul commande peut-être exécutée !" + +#: /home/brenard/dev/eesyphp/includes/cli.php:110 +#, 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." + +#: /home/brenard/dev/eesyphp/includes/cli.php:127 +#, php-format +msgid "An exception occured running command %s" +msgstr "Une exception est survenue en exécutant la commande %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:133 +#, php-format +msgid "Item #%s:\n" +msgstr "Élément #%s :\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:134 +#, php-format +msgid "ID: %s" +msgstr "ID : %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:135 +#, php-format +msgid "Name: '%s'" +msgstr "Nom : %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:136 +#, php-format +msgid "Date: %s" +msgstr "Date : %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +#, php-format +msgid "Description: %s" +msgstr "Description : %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +msgid "Not set" +msgstr "Non-défini" + +#: /home/brenard/dev/eesyphp/includes/cli.php:138 +#, php-format +msgid "Status: %s" +msgstr "Statut : %s" + +#: /home/brenard/dev/eesyphp/includes/cli.php:191 +msgid "No item.\n" +msgstr "Aucun élément.\n" + +#: /home/brenard/dev/eesyphp/includes/cli.php:217 +#, php-format +msgid "%d item(s)" +msgstr "%d élément(s)" + +#: /home/brenard/dev/eesyphp/includes/cli.php:223 +msgid "List/search items" +msgstr "Lister/rechercher les éléments" + +#: /home/brenard/dev/eesyphp/includes/cli.php:224 +msgid "[patterns]" +msgstr "[mots clés]" + +#: /home/brenard/dev/eesyphp/includes/cli.php:226 +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:228 +msgid "-r|--reverse Reverse order" +msgstr "-r|--reverse Ordre inverse" + +#: /home/brenard/dev/eesyphp/includes/cli.php:229 +msgid "-s|--status Filter on status. Possible values:" +msgstr "-s|--status Filtrer sur le statut. Valeurs possibles :" + +#: /home/brenard/dev/eesyphp/includes/cli.php:236 +msgid "You must provide a valid ID." +msgstr "Vous devez fournir un ID valide." + +#: /home/brenard/dev/eesyphp/includes/cli.php:242 +#: /home/brenard/dev/eesyphp/includes/cli.php:266 +#, php-format +msgid "Item #%s not found." +msgstr "Élément #%s introuvable." + +#: /home/brenard/dev/eesyphp/includes/cli.php:250 +msgid "Show item" +msgstr "Voir un élément" + +#: /home/brenard/dev/eesyphp/includes/cli.php:251 +msgid "[ID]" +msgstr "[ID]" + +#: /home/brenard/dev/eesyphp/includes/cli.php:256 +msgid "You must provide item ID." +msgstr "Vous devez fournir un ID valide." + +#: /home/brenard/dev/eesyphp/includes/cli.php:260 +msgid "Invalid item ID" +msgstr "ID d'élément invalide" + +#: /home/brenard/dev/eesyphp/includes/cli.php:271 +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:275 +msgid "User cancel" +msgstr "L'utilisateur a annulé" + +#: /home/brenard/dev/eesyphp/includes/cli.php:281 +#, 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:288 +msgid "Delete item" +msgstr "Supprimer un élément" + +#: /home/brenard/dev/eesyphp/includes/cli.php:289 +msgid "[item ID]" +msgstr "[ID de l'élément]" + +#: /home/brenard/dev/eesyphp/includes/cli.php:301 +msgid "Export items (as CSV)" +msgstr "Exporter les éléments (au format CSV)" + +#: /home/brenard/dev/eesyphp/includes/cli.php:302 +msgid "[output file path]" +msgstr "[chemin du fichier de sortie]" + +#: /home/brenard/dev/eesyphp/includes/cli.php:314 +msgid "Restore items (from CSV)" +msgstr "Restaurer les éléments (depuis un fichier CSV)" + +#: /home/brenard/dev/eesyphp/includes/cli.php:315 +msgid "[input file path]" +msgstr "[chemin du fichier d'entrée]" + +#: /home/brenard/dev/eesyphp/includes/cli.php:374 +msgid "Cron to handle item expiration" +msgstr "Cron gérant l'expiration des éléments" + +#: /home/brenard/dev/eesyphp/includes/cli.php:377 +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:378 +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/includes/cli.php:393 +msgid "Fail to list PHP files." +msgstr "Impossible de lister les fichiers PHP." + +#: /home/brenard/dev/eesyphp/includes/cli.php:410 +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/cli.php:421 +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/cli.php:431 +msgid "Fail to merge messages using msgcat." +msgstr "Impossible de fusionner les messages en utilisant msgcat." + +#: /home/brenard/dev/eesyphp/includes/cli.php:436 +msgid "Extract messages that need to be translated" +msgstr "Extraire les messages devant être traduit" + +#: /home/brenard/dev/eesyphp/includes/cli.php:438 +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/templates/form.tpl:7 +#: /home/brenard/dev/eesyphp/templates/search.tpl:36 +#: /home/brenard/dev/eesyphp/templates/show.tpl:5 +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 +msgid "Status" +msgstr "Statut" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:25 +#: /home/brenard/dev/eesyphp/templates/show.tpl:32 +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 +msgid "Back" +msgstr "Retour" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:36 +msgid "Save" +msgstr "Enregistrer" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:38 +#: /home/brenard/dev/eesyphp/templates/search.tpl:28 +msgid "Add" +msgstr "Ajouter" + +#: /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 "" +"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." + +#: /home/brenard/dev/eesyphp/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 "Element(s) %1 to %2 on %3" +msgstr "Élément(s) %1 à %2 sur %3" + +#: /home/brenard/dev/eesyphp/templates/error_404.tpl:3 +msgid "The requested page can not be found." +msgstr "La page demandée est introuvable." + +#: /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 +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." + +#: /home/brenard/dev/eesyphp/templates/homepage.tpl:8 +msgid "This app contains some demo pages:" +msgstr "Cette application contient quelques pages de démo :" + +#: /home/brenard/dev/eesyphp/templates/homepage.tpl:9 +msgid "Search page" +msgstr "Page de recherche" + +#~ msgid "Authentication required" +#~ msgstr "Authentification requise" + +#~ msgid "Invalid session key" +#~ msgstr "Clé de session invalide" + +#~ msgid "Activate your account" +#~ msgstr "Activez votre compte" + +#~ msgid "Your account is activated" +#~ msgstr "Votre compte est activé" + +#~ msgid "" +#~ "Your account is already activated. If you loose your password, please use " +#~ "the reset password link present on login page." +#~ msgstr "" +#~ "Votre compte est déjà activé. Si vous avez perdu votre mot de passe, " +#~ "merci d'utiliser le lien de réinitialisation présent sur la page de " +#~ "connexion." + +#~ msgid "You previous initialization request was expired." +#~ msgstr "Votre précédente requête d'initialisation a expirée." + +#~ msgid "The repeated password does not match with the password you choosed." +#~ msgstr "" +#~ "Le mot de passe répété ne correspond pas au mot de passe que vous avez " +#~ "choisi." + +#~ msgid "Invalid password" +#~ msgstr "Mot de passe invalide" + +#~ msgid "Choose your password" +#~ msgstr "Choisissez votre mot de passe" + +#~ msgid "Please check your mailbox" +#~ msgstr "Merci de consulter votre boîte mails" + +#~ msgid "At least one uppercase unaccent character" +#~ msgstr "Au moins une lettre majuscule et non-accentuée" + +#~ msgid "At least one lowercase unaccent character" +#~ msgstr "Au moins une lettre minuscule et non-accentuée" + +#~ msgid "At least one digit" +#~ msgstr "Au moins un chiffre" + +#~ msgid "At least one character that is not an unaccent letter or a digit" +#~ msgstr "" +#~ "Au moins un caractère qui n'est pas une lettre non-accuentée ou un chiffre" + +#~ msgid "Railcoop - Activation of your account" +#~ msgstr "Railcoop - Activation de votre compte" + +#, php-format +#~ msgid "" +#~ "Hello,\n" +#~ "\n" +#~ "To activate your account, please click on the following link:\n" +#~ "\n" +#~ "%s\n" +#~ "\n" +#~ "Railcoop" +#~ msgstr "" +#~ "Bonjour,\n" +#~ "\n" +#~ "Pour activer votre compte, merci de cliquer sur le lien suivant :\n" +#~ "\n" +#~ "%s\n" +#~ "\n" +#~ "Railcoop" + +#, php-format +#~ msgid "Password is too long (maximum: %d)." +#~ msgstr "Mot de passe trop long (maximum : %d)." + +#, php-format +#~ msgid "Password is too short (minimum: %d)." +#~ msgstr "Mot de passe trop court (minimum : %d)." + +#, php-format +#~ msgid "Password match with only %d rule(s) (at least %d are required)." +#~ msgstr "" +#~ "Le mot de passe ne corresponds qu'a %d des règle(s) (au moins %d sont " +#~ "requises)." + +#, php-format +#~ msgid "Password match with any rule (at least %d are required)." +#~ msgstr "" +#~ "Le mot de passe ne corresponds à aucune règle (au moins %d sont requises)." + +#~ msgid "This password is prohibited." +#~ msgstr "Ce mot de passe est interdit." + +#, php-format +#~ msgid "Initialization request #%s:\n" +#~ msgstr "Requête d'initialisation #%s:\n" + +#~ msgid "No initialization request.\n" +#~ msgstr "" +#~ "Aucune requête d'initialisation.\n" +#~ "\n" + +#, php-format +#~ msgid "%d initialization request(s)" +#~ msgstr "%d requête(s) d'initialisation" + +#~ msgid "Show initialization request" +#~ msgstr "Afficher un requête d'initialisation" + +#~ msgid "You must provide initialization request ID." +#~ msgstr "Vous devez fournir l'ID de la requête d'initialisation." + +#~ msgid "Invalid initialization request ID" +#~ msgstr "ID de requête d'initialisation invalide" + +#~ msgid "Delete initialization request" +#~ msgstr "Supprimer une requête d'initialisation" + +#~ msgid "[initialization request ID]" +#~ msgstr "[ID de la requête d'initialisation]" + +#~ msgid "Email" +#~ msgstr "Email" + +#~ msgid "Please enter your email address." +#~ msgstr "Merci de saisir votre adresse email." + +#~ msgid "Continue" +#~ msgstr "Continuer" + +#~ msgid "Your account is now activated." +#~ msgstr "Votre compte est maintenant activé." + +#~ msgid "To continue, please click on the following button:" +#~ msgstr "Pour continuer, merci de cliquer sur le bouton suivant:" + +#~ msgid "You could now connect with your account." +#~ msgstr "Vous pouvez désormais vous connecter avec votre compte." + +#~ msgid "Invalid password choice" +#~ msgstr "Choix du mot de passe invalide" + +#~ msgid "" +#~ "The password you have chosen does not appear to be valid. Please check " +#~ "that it fulfills all the rules set out." +#~ msgstr "" +#~ "Le mot de passe que vous avez choisi ne semble pas être valide. Merci de " +#~ "vérifier qu'il rempli bien toutes les règles exposées." + +#~ msgid "The repeated password does not seem to match the password you chose." +#~ msgstr "" +#~ "Le mot de passe répété ne semble pas correspondre avec le mot de passe " +#~ "que vous avez choisi." + +#~ msgid "Password:" +#~ msgstr "Mot de passe :" + +#~ msgid "Please enter the password of your choice." +#~ msgstr "Merci de saisir le mot de passe de votre choix." + +#~ msgid "Your password must contain from %1 to %2 characters." +#~ msgstr "Votre mot de passe doit contenir entre %1 et %2 caractères." + +#~ msgid "Your password must contain at least %1 characters." +#~ msgstr "Votre mot de passe doit contenir au moins %1 caractères." + +#~ msgid "Your password must contain at most %1 characters." +#~ msgstr "Votre mot de passe doit contenir au maximum %1 caractères." + +#~ msgid "It also have to repect at least %1 of the following rules:" +#~ msgstr "Il doit également respecter au moins %1 des règles suivantes :" + +#~ msgid "It also have to repect all the following rules:" +#~ msgstr "Il doit également respecter toutes les règles suivantes :" + +#~ msgid "Confirmation:" +#~ msgstr "Confirmation :" + +#~ msgid "Please repeat here the password you choiced." +#~ msgstr "Merci de répéter le mot de passe que vous avez choisi." + +#~ msgid "" +#~ "An email with instructions to initialized your account have been sent to " +#~ "your email address (%1). Please check your mailbox to continue." +#~ msgstr "" +#~ "Un email avec les instructions pour initialiser votre compte a été envoyé " +#~ "à votre adresse (%1). Merci de consulter votre boîte mail pour continuer." + +#~ msgid "" +#~ "This email may take a few minutes to reach you. Furthermore, considering " +#~ "this email was sent to you automatically, please check that it did not " +#~ "arrive in your spam emails. Despite this, if you do not receive this " +#~ "email, please click on the following button." +#~ msgstr "" +#~ "Cet email peut prendre quelques minutes pour vous parvenir. Par ailleurs, " +#~ "ce mail vous ayant été envoyé automatiquement, merci de vérifier qu'il " +#~ "n'est pas arrivé dans vos spams. Malgré cela, si vous ne recevez pas cet " +#~ "email, merci de cliquer sur le bouton ci-dessous." + +#~ msgid "Resent me this email" +#~ msgstr "Renvoyez-moi cet email" + +#~ msgid "" +#~ "An email with instructions to initialized your account have been already " +#~ "sent to your email address (%1). Please check your mailbox to continue." +#~ msgstr "" +#~ "Un email avec les instructions pour initialiser votre compte vous a déjà " +#~ "été envoyé à votre adresse (%1). Merci de consulter votre boîte mail pour " +#~ "continuer." + +#~ msgid "" +#~ "This email may take a few minutes to reach you. Furthermore, considering " +#~ "this email was sent to you automatically, please check that it did not " +#~ "arrive in your spam emails. Despite this, if you still do not receive " +#~ "this email, please wait until %1 and click on the following button." +#~ msgstr "" +#~ "Cet email peut prendre quelques minutes pour vous parvenir. Par ailleurs, " +#~ "ce mail vous ayant été envoyé automatiquement, merci de vérifier qu'il " +#~ "n'est pas arrivé dans vos spams. Malgré cela, si vous ne recevez toujours " +#~ "pas cet email, merci de patienter jusqu'au %1 puis cliquer sur le bouton " +#~ "ci-dessous." + +#~ msgid "Please choose your password:" +#~ msgstr "Merci de choisir votre mot de passe:" + +#~ msgid "Please repeat it:" +#~ msgstr "Merci de le répéter:" + +#~ msgid "Please repeat it." +#~ msgstr "Merci de le répéter." + +#~ msgid "" +#~ "\n" +#~ "Your password must contain from 8 to 10 characters and contains at least " +#~ "one caracter that match with 3 of this types :\n" +#~ "
    \n" +#~ "
  • Uppercase unaccent character
  • \n" +#~ "
  • Lowercase unaccent character
  • \n" +#~ "
  • Digit
  • \n" +#~ "
  • Anything that is not a letter or a digit
  • \n" +#~ "
" +#~ msgstr "" +#~ "\n" +#~ "Votre mot de passe doit contenir de 8 à 10 caractères et au moins un " +#~ "caractère correspondant avec 3 des types suivants :\n" +#~ "
    \n" +#~ "
  • Une lettre majuscule non-accuentuée
  • \n" +#~ "
  • Une lettre minuscule non-accuentuée
  • \n" +#~ "
  • Un chiffre
  • \n" +#~ "
  • N'importe quel caractère qui n'est pas une lettre non-accuentée ou un " +#~ "chiffre
  • \n" +#~ "
" + +#~ msgid "Account initialization - Please check your mailbox" +#~ msgstr "Initialisation de compte - Merci de consulter votre boîte mails" + +#~ msgid "Account initialization" +#~ msgstr "Initialisation de compte" + +#~ msgid "Account initialization - Choose your password" +#~ msgstr "Initialisation de compte - Choisissez votre mot de passe" diff --git a/lang/messages.pot b/lang/messages.pot new file mode 100644 index 0000000..a584de1 --- /dev/null +++ b/lang/messages.pot @@ -0,0 +1,524 @@ +#: /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:203 +#: /home/brenard/dev/eesyphp/includes/url-public.php:227 +#, php-format +msgid "Item #% s not found." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:61 +msgid "Smarty version not supported." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:134 +msgid "No template specified." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:145 +msgid "An error occurred while viewing this page." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:7 +msgid "Hello world !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:27 +msgid "Any" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:84 +msgid "" +"An error occurred while listing the items. If the problem persists, please " +"contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:96 +#: /home/brenard/dev/eesyphp/templates/search.tpl:22 +msgid "Search" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:118 +#, php-format +msgid "Element %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:130 +#, php-format +msgid "The element '% s' has been created." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:134 +msgid "An error occurred while saving this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:140 +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:146 +msgid "New" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:156 +msgid "You cannot edit this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:169 +#, php-format +msgid "You have not made any changes to element '% s'." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:173 +#, php-format +msgid "The element '% s' has been updated successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:177 +msgid "An error occurred while updating this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:184 +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:194 +#, php-format +msgid "Element %s: Modification" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:207 +msgid "This item is already archived." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:210 +msgid "You cannot archive this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:213 +#, php-format +msgid "The element '% s' has been archived successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:216 +msgid "An error occurred while archiving this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:230 +msgid "You cannot delete this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:233 +#, php-format +msgid "The element '% s' has been deleted successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:236 +msgid "An error occurred while deleting this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/db.php:31 +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/mail.php:12 +#, php-format +msgid "" +"\n" +"\n" +"\n" +"Mail initialy intended for %s." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:86 +msgid "Whoops ! Page not found" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:109 +msgid "" +"Unable to determine the requested page. If the problem persists, please " +"contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:258 +msgid "" +"Unable to determine the requested page (loop detected). If the problem " +"persists, please contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:282 +msgid "This request cannot be processed." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:299 +msgid "This request could not be processed correctly." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:7 +#, php-format +msgid "The CLI command '%s' already exists." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:12 +#, php-format +msgid "The CLI command '%s' handler is not callable !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:45 +#, php-format +msgid "Usage: %s [-h] [-qd] command\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:46 +msgid " -h Show this message\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:47 +msgid " -q / -d Quiet/Debug mode\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:48 +msgid " --trace Trace mode (the most verbose)\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:49 +msgid " command Command to run\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:51 +msgid "Available commands:\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:86 +msgid "Only one command could be executed !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:110 +#, php-format +msgid "" +"Invalid parameter \"%s\".\n" +"Note: Command's parameter/argument must be place after the command." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:127 +#, php-format +msgid "An exception occured running command %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:133 +#, php-format +msgid "Item #%s:\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:134 +#, php-format +msgid "ID: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:135 +#, php-format +msgid "Name: '%s'" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:136 +#, php-format +msgid "Date: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +#, php-format +msgid "Description: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +msgid "Not set" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:138 +#, php-format +msgid "Status: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:191 +msgid "No item.\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:217 +#, php-format +msgid "%d item(s)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:223 +msgid "List/search items" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:224 +msgid "[patterns]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:226 +msgid "-o|--orderby Ordering list criterion. Possible values:" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:228 +msgid "-r|--reverse Reverse order" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:229 +msgid "-s|--status Filter on status. Possible values:" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:236 +msgid "You must provide a valid ID." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:242 +#: /home/brenard/dev/eesyphp/includes/cli.php:266 +#, php-format +msgid "Item #%s not found." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:250 +msgid "Show item" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:251 +msgid "[ID]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:256 +msgid "You must provide item ID." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:260 +msgid "Invalid item ID" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:271 +msgid "Are you sure you want to delete this item? Type 'yes' to continue: " +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:275 +msgid "User cancel" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:281 +#, php-format +msgid "An error occured deleting item #%d." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:288 +msgid "Delete item" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:289 +msgid "[item ID]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:301 +msgid "Export items (as CSV)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:302 +msgid "[output file path]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:314 +msgid "Restore items (from CSV)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:315 +msgid "[input file path]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:374 +msgid "Cron to handle item expiration" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:377 +msgid "-j/--just-try Just-try mode : do not really removed expired item(s)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:378 +msgid "-m/--max-age Item expiration limit (in days, optional)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:393 +msgid "Fail to list PHP files." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:410 +msgid "Fail to extract messages from PHP files using xgettext." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:421 +msgid "" +"Fail to extract messages from template files using tsmarty2c.php script." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:431 +msgid "Fail to merge messages using msgcat." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:436 +msgid "Extract messages that need to be translated" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:438 +msgid "This command could be used to generate/update lang/messages.pot file." +msgstr "" + +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:7 +#: /home/brenard/dev/eesyphp/templates/search.tpl:36 +#: /home/brenard/dev/eesyphp/templates/show.tpl:5 +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 +msgid "Status" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:25 +#: /home/brenard/dev/eesyphp/templates/show.tpl:32 +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 +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 +msgid "Modify" +msgstr "" + +#: /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 "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:52 +#: /home/brenard/dev/eesyphp/templates/show.tpl:44 +msgid "Archive" +msgstr "" + +#: /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 "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:53 +#: /home/brenard/dev/eesyphp/templates/show.tpl:45 +msgid "Delete" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:59 +msgid "No item found." +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:68 +msgid "Element(s) %1 to %2 on %3" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/error_404.tpl:3 +msgid "The requested page can not be found." +msgstr "" + +#: /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 +msgid "Hello, world!" +msgstr "" + +#: /home/brenard/dev/eesyphp/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 +msgid "This app contains some demo pages:" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/homepage.tpl:9 +msgid "Search page" +msgstr "" diff --git a/lang/php-messages.pot b/lang/php-messages.pot new file mode 100644 index 0000000..8c844cf --- /dev/null +++ b/lang/php-messages.pot @@ -0,0 +1,390 @@ +#: /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:203 +#: /home/brenard/dev/eesyphp/includes/url-public.php:227 +#, php-format +msgid "Item #% s not found." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:61 +msgid "Smarty version not supported." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:134 +msgid "No template specified." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/smarty.php:145 +msgid "An error occurred while viewing this page." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:7 +msgid "Hello world !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:27 +msgid "Any" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:84 +msgid "" +"An error occurred while listing the items. If the problem persists, please " +"contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:96 +msgid "Search" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:118 +#, php-format +msgid "Element %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:130 +#, php-format +msgid "The element '% s' has been created." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:134 +msgid "An error occurred while saving this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:140 +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:146 +msgid "New" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:156 +msgid "You cannot edit this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:169 +#, php-format +msgid "You have not made any changes to element '% s'." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:173 +#, php-format +msgid "The element '% s' has been updated successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:177 +msgid "An error occurred while updating this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:184 +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:194 +#, php-format +msgid "Element %s: Modification" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:207 +msgid "This item is already archived." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:210 +msgid "You cannot archive this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:213 +#, php-format +msgid "The element '% s' has been archived successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:216 +msgid "An error occurred while archiving this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:230 +msgid "You cannot delete this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:233 +#, php-format +msgid "The element '% s' has been deleted successfully." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url-public.php:236 +msgid "An error occurred while deleting this item." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/db.php:31 +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/mail.php:12 +#, php-format +msgid "" +"\n" +"\n" +"\n" +"Mail initialy intended for %s." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:86 +msgid "Whoops ! Page not found" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:109 +msgid "" +"Unable to determine the requested page. If the problem persists, please " +"contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:258 +msgid "" +"Unable to determine the requested page (loop detected). If the problem " +"persists, please contact support." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:282 +msgid "This request cannot be processed." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/url.php:299 +msgid "This request could not be processed correctly." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:7 +#, php-format +msgid "The CLI command '%s' already exists." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:12 +#, php-format +msgid "The CLI command '%s' handler is not callable !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:45 +#, php-format +msgid "Usage: %s [-h] [-qd] command\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:46 +msgid " -h Show this message\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:47 +msgid " -q / -d Quiet/Debug mode\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:48 +msgid " --trace Trace mode (the most verbose)\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:49 +msgid " command Command to run\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:51 +msgid "Available commands:\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:86 +msgid "Only one command could be executed !" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:110 +#, php-format +msgid "" +"Invalid parameter \"%s\".\n" +"Note: Command's parameter/argument must be place after the command." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:127 +#, php-format +msgid "An exception occured running command %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:133 +#, php-format +msgid "Item #%s:\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:134 +#, php-format +msgid "ID: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:135 +#, php-format +msgid "Name: '%s'" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:136 +#, php-format +msgid "Date: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +#, php-format +msgid "Description: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:137 +msgid "Not set" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:138 +#, php-format +msgid "Status: %s" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:191 +msgid "No item.\n" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:217 +#, php-format +msgid "%d item(s)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:223 +msgid "List/search items" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:224 +msgid "[patterns]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:226 +msgid "-o|--orderby Ordering list criterion. Possible values:" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:228 +msgid "-r|--reverse Reverse order" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:229 +msgid "-s|--status Filter on status. Possible values:" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:236 +msgid "You must provide a valid ID." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:242 +#: /home/brenard/dev/eesyphp/includes/cli.php:266 +#, php-format +msgid "Item #%s not found." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:250 +msgid "Show item" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:251 +msgid "[ID]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:256 +msgid "You must provide item ID." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:260 +msgid "Invalid item ID" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:271 +msgid "Are you sure you want to delete this item? Type 'yes' to continue: " +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:275 +msgid "User cancel" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:281 +#, php-format +msgid "An error occured deleting item #%d." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:288 +msgid "Delete item" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:289 +msgid "[item ID]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:301 +msgid "Export items (as CSV)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:302 +msgid "[output file path]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:314 +msgid "Restore items (from CSV)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:315 +msgid "[input file path]" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:374 +msgid "Cron to handle item expiration" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:377 +msgid "-j/--just-try Just-try mode : do not really removed expired item(s)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:378 +msgid "-m/--max-age Item expiration limit (in days, optional)" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:393 +msgid "Fail to list PHP files." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:410 +msgid "Fail to extract messages from PHP files using xgettext." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:421 +msgid "" +"Fail to extract messages from template files using tsmarty2c.php script." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:431 +msgid "Fail to merge messages using msgcat." +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:436 +msgid "Extract messages that need to be translated" +msgstr "" + +#: /home/brenard/dev/eesyphp/includes/cli.php:438 +msgid "This command could be used to generate/update lang/messages.pot file." +msgstr "" diff --git a/lang/templates-messages.pot b/lang/templates-messages.pot new file mode 100644 index 0000000..2e9328d --- /dev/null +++ b/lang/templates-messages.pot @@ -0,0 +1,136 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:7 +#: /home/brenard/dev/eesyphp/templates/search.tpl:36 +#: /home/brenard/dev/eesyphp/templates/show.tpl:5 +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 +msgid "Status" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/form.tpl:25 +#: /home/brenard/dev/eesyphp/templates/show.tpl:32 +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 +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:22 +msgid "Search" +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 +msgid "Modify" +msgstr "" + +#: /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 "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:52 +#: /home/brenard/dev/eesyphp/templates/show.tpl:44 +msgid "Archive" +msgstr "" + +#: /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 "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:53 +#: /home/brenard/dev/eesyphp/templates/show.tpl:45 +msgid "Delete" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:59 +msgid "No item found." +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/search.tpl:68 +msgid "Element(s) %1 to %2 on %3" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/error_404.tpl:3 +msgid "The requested page can not be found." +msgstr "" + +#: /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 +msgid "Hello, world!" +msgstr "" + +#: /home/brenard/dev/eesyphp/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 +msgid "This app contains some demo pages:" +msgstr "" + +#: /home/brenard/dev/eesyphp/templates/homepage.tpl:9 +msgid "Search page" +msgstr "" diff --git a/public_html/index.php b/public_html/index.php index a7d5aa3..4243b3f 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -4,4 +4,4 @@ include '../includes/core.php'; include 'url-public.php'; $default_url=''; -handle_url(); +handle_request(); diff --git a/templates/error_404.tpl b/templates/error_404.tpl index 44ce686..18cf762 100644 --- a/templates/error_404.tpl +++ b/templates/error_404.tpl @@ -1,4 +1,4 @@ {extends file='empty.tpl'} {block name="content"} -

La page demandée est introuvable.

+

{t}The requested page can not be found.{/t}

{/block} diff --git a/templates/fatal_error.tpl b/templates/fatal_error.tpl index c78a3c6..cd4145c 100644 --- a/templates/fatal_error.tpl +++ b/templates/fatal_error.tpl @@ -2,9 +2,9 @@ {block name="content"}

Oops ...

-

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.

+

{t}A fatal error has occurred and it is preventing this application from working properly. Please try again later or contact support.{/t}

-

Erreur : {$fatal_error}

+

{t 1=$fatal_error}Error: %1{/t}

- + {/block} diff --git a/templates/form.tpl b/templates/form.tpl index d0e60b7..d7c3ce3 100644 --- a/templates/form.tpl +++ b/templates/form.tpl @@ -4,7 +4,7 @@
- +
{if array_key_exists('name', $field_errors)}
{$field_errors['name']}
{/if} @@ -12,7 +12,7 @@
- +
{if array_key_exists('description', $field_errors)}
{$field_errors['description']}
{/if} @@ -30,12 +30,12 @@
- Retour + {t}Back{/t}
diff --git a/templates/homepage.tpl b/templates/homepage.tpl index 38c0ad2..5bf39c4 100644 --- a/templates/homepage.tpl +++ b/templates/homepage.tpl @@ -2,10 +2,10 @@ {block name="pagetitle"}{/block} {block name="content"}
-

Hello, world!

-

Ceci est une simple application pour montrer les différentes possibilités et les fonctionalités de base.

+

{t}Hello, world!{/t}

+

{t}This is a simple app to show the different possibilities and basic functionality.{/t}


-

Cette application contient quelques pages de démo :.

- Page de recherche +

{t}This app contains some demo pages:{/t}

+ {t}Search page{/t}
{/block} diff --git a/templates/search.tpl b/templates/search.tpl index 4757aba..655e440 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -5,36 +5,36 @@
- + - + - +
- - Réinitialiser + + {t}Reset{/t}
- - - + + + @@ -44,19 +44,19 @@ {foreachelse} - + {/foreach} @@ -65,7 +65,7 @@
{if $result.count>1}
-
Élement(s) {$result.first} à {$result.last} sur {$result.count}
+
{t 1=$result.first 2=$result.last 3=$result.count}Element(s) %1 to %2 on %3{/t}
{/if} {if $result.nb_pages > 1} @@ -73,10 +73,10 @@ diff --git a/templates/show.tpl b/templates/show.tpl index 65646d1..4e58118 100644 --- a/templates/show.tpl +++ b/templates/show.tpl @@ -2,7 +2,7 @@ {block name="content"}
- +
{$item.name} @@ -11,7 +11,7 @@
- +
{format_time time=$item.date} @@ -20,7 +20,7 @@
- +
{item_status item=$item} @@ -29,19 +29,19 @@
- +
- {if $item.description}{$item.description|escape:'htmlall'}{else}Non renseignée.{/if} + {if $item.description}{$item.description|escape:'htmlall'}{else}{t}Unspecified.{/t}{/if}
- Retour - {if can_modify($item)} Modifier{/if} - {if can_archive($item)} Archiver{/if} - {if can_delete($item)} Supprimer{/if} + {t}Back{/t} + {if can_modify($item)} {t}Modify{/t}{/if} + {if can_archive($item)} {t}Archive{/t}{/if} + {if can_delete($item)} {t}Delete{/t}{/if}
{/block}
{table_ordered_th url="{$url_info.current_page}" order="date" text="Date" search=$search}{table_ordered_th url="{$url_info.current_page}" order="name" text="Facture" search=$search}Actions{table_ordered_th url="{$request->current_url}" order="date" text="{t}Date{/t}" search=$search}{table_ordered_th url="{$request->current_url}" order="name" text="{t}Name{/t}" search=$search}{t}Actions{/t}
{$item.name} {item_status item=$item} - Voir + {t}View{/t} - Voir - {if can_modify($item)} Modifier{/if} - {if can_archive($item)} Archiver{/if} - {if can_delete($item)} Supprimer{/if} + {t}View{/t} + {if can_modify($item)} {t}Modify{/t}{/if} + {if can_archive($item)} {t}Archive{/t}{/if} + {if can_delete($item)} {t}Delete{/t}{/if}
Aucun élément trouvé.{t}No item found.{/t}