partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit c70159d0f3938ad0440714de2160c8041384b8de
parent 6749422b8be9798191d936fe2fb31f54a31f314c
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue,  3 Apr 2012 06:10:32 +0200

Added support for sprintf-like parameters to i18n

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php b/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php @@ -333,10 +333,22 @@ class PartKeepr { } /** - *@todo stub + * Formats a message and applies internationalization. + * + * This method accepts sprintf-like parameters, which are appended after the $string parameter. + * + * @param $string string The string to internationalize + * @todo stub */ public static function i18n ($string) { - return $string; + if (func_num_args() > 1) { + $args = func_get_args(); + array_shift($args); + + return vsprintf($string, $args); + } else { + return $string; + } } /**