note 34343 added to language.constants

From: Date: Thu, 24 Jul 2003 12:04:35 +0000
Subject: note 34343 added to language.constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-52551@lists.php.net to get a copy of this message
Late reply to fmmarzoa at gmx dot net: You're better off using sprintf format and defining your strings like this: define('strArticleDescr', 'Published by %1$s on %2$s in %2$s'); It's more standard than what you're doing. Then instead of outputting it using an eval, do this: echo sprintf(strArticleDescr, $article_author, $article_date, $article_lang_name'); And even better for i18n and l10n, don't use defines; use gettext. See the PHP manual section on gettext and the GNU gettext website. Gettext requires some modification of the way you think about strings but I find it worthwhile to make that adjustment. ---- Manual Page -- http://www.php.net/manual/en/language.constants.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34343 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34343&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34343&report=yes

« previous php.notes (#52551) next »