1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
@c This file is part of the GNU gettext manual.
@c Copyright (C) 1995-2024 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@node PHP
@subsection PHP Hypertext Preprocessor
@cindex PHP
@table @asis
@item RPMs
php
@item Ubuntu packages
php
@item File extension
@code{php}, @code{php3}, @code{php4}
@item String syntax
@code{"abc"}, @code{'abc'},
@code{<<<EOT}, @code{<<<"EOT"}, @code{<<<'EOT'}
@item gettext shorthand
@code{_("abc")}
@item gettext/ngettext functions
@code{gettext}, @code{dgettext}, @code{dcgettext},
@code{ngettext}, @code{dngettext}, @code{dcngettext}
@item textdomain
@code{textdomain} function
@item bindtextdomain
@code{bindtextdomain} function
@item setlocale
Programmer must call @code{setlocale (LC_ALL, "")}
@item Prerequisite
---
@item Use or emulate GNU gettext
use
@c There is also an alternative package named 'php-gettext'
@c <https://bugs.launchpad.net/php-gettext>, but we better not mention it
@c since it has a critical security vulnerability open since 2016.
@item Extractor
@code{xgettext}
@item Formatting with positions
@code{printf "%2\$d %1\$d"}
@item Portability
On platforms without gettext, the functions are not available.
@item po-mode marking
---
@end table
An example is available in the @file{examples} directory: @code{hello-php}.
|