[php-src] Issue #9807: Thread-safe alternatives to gettext/ngettext
| From: | TysonAndre | Date: | Sat, 22 Oct 2022 05:16:57 +0000 |
| Subject: | [php-src] Issue #9807: Thread-safe alternatives to gettext/ngettext | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242656@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9807
Author: TysonAndre
### Description
Motivation: If an application running on a web server uses gettext mo files for translations (e.g.
for rendering a web page, or for generating translated strings to notify users that the logged in
user interacted with), it would be prevented from using the ZTS (threaded) APIs (e.g. php-fpm+zts)
It seems like /usr/include/libintl.h still doesn't have thread safe alternatives
https://www.php.net/manual/en/function.ngettext.php
https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
documents the messages.mo format
https://www.php.net/bindtextdomain
> The bindtextdomain() information is maintained per process, not per thread.
https://docs.laminas.dev/laminas-i18n/ user
polyfills exist instead; should this be moved to pecl entirely?