azatoth / php-pgettext
Extension of gettext functions for PHP like pgettext, dpgettext, etc.
Installs: 99 926
Dependents: 4
Suggesters: 3
Security: 0
Stars: 7
Watchers: 4
Forks: 5
Open Issues: 1
pkg:composer/azatoth/php-pgettext
Requires
- php: >=5.3.0
- ext-gettext: *
This package is not auto-updated.
Last update: 2025-10-21 09:43:01 UTC
README
Default installation of gettext in php lacks support for pgettext et al.
This php script adds support for those, as well as an gettext_noop wrapper.
For this to work when extracting strings using xgettext, many keyword parameters needs to be filed,
A wrapper script called php-xgettext might be used to simplify this.
Following functions are exported:
- pgettext($msg_ctxt, $msgid)
- dpgettext($domain, $msg_ctxt, $msgid)
- dcpgettext($domain, $msg_ctxt, $msgid, $category)
- npgettext($msg_ctxt, $msgid, $msgid_plural, $n)
- dnpgettext($domain, $msg_ctxt, $msgid, $msgid_plural, $n)
- dcnpgettext($domain, $msg_ctxt, $msgid, $msgid_plural, $n, $category)
- gettext_noop($msgid)