GNU gettext utilities: PHP
From Get docs
Gettext/docs/latest/PHP
Next: Pike, Previous: Perl, Up: List of Programming Languages [Contents][Index]
15.5.22 PHP Hypertext Preprocessor
- RPMs
- mod_php4, mod_php4-core, phpdoc
- Ubuntu packages
- php
- File extension
php,php3,php4- String syntax
"abc",'abc'- gettext shorthand
_("abc")- gettext/ngettext functions
gettext,dgettext,dcgettext; starting with PHP 4.2.0 alsongettext,dngettext,dcngettext- textdomain
textdomainfunction- bindtextdomain
bindtextdomainfunction- setlocale
- Programmer must call
setlocale (LC_ALL, "") - Prerequisite
- —
- Use or emulate GNU gettext
- use
- Extractor
xgettext- Formatting with positions
printf "%2\$d %1\$d"- Portability
- On platforms without gettext, the functions are not available.
- po-mode marking
- —
An example is available in the examples directory: hello-php.