Bug #70574 [Opn->Csd]: Tests fail due to relying on Linux fallback behavior for gettext()

From: Date: Fri, 07 Aug 2020 12:38:03 +0000
Subject: Bug #70574 [Opn->Csd]: Tests fail due to relying on Linux fallback behavior for gettext()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228445@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70574&edit=1 ID: 70574 Updated by: nikic@php.net Reported by: rainer dot jung at kippdata dot de Summary: Tests fail due to relying on Linux fallback behavior for gettext() -Status: Open +Status: Closed Type: Bug Package: Gettext related Operating System: Solaris PHP Version: 7.0.0RC3 Block user comment: N Private report: N New Comment: Automatic comment on behalf of florian.engelhardt@oxid-esales.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=5be670265b261f2c0162ba89827f5652ba584b05 Log: Fix bug #70574: Move files to proper locale dir Previous Comments: ------------------------------------------------------------------------ [2020-08-05 12:05:40] flo at dotbox dot org The following pull request has been associated: Patch Name: Move message catalog to proper locale directory to fix #70574 On GitHub: https://github.com/php/php-src/pull/5940 Patch: https://github.com/php/php-src/pull/5940.patch ------------------------------------------------------------------------ [2015-09-24 16:34:59] rainer dot jung at kippdata dot de Description: ------------ The following six gettext tests fail on Solaris: - ext/gettext/tests/gettext_basic-enus.phpt - ext/gettext/tests/gettext_bindtextdomain-cwd.phpt - ext/gettext/tests/gettext_dcgettext.phpt - ext/gettext/tests/gettext_dgettext.phpt - ext/gettext/tests/gettext_dngettext-plural.phpt - ext/gettext/tests/gettext_ngettext.phpt They fail, because they set locale to en_US.UTF-8, but the message catalog used in the tests is located in ext/gettext/tests/locale/en. On Linux, gettext() has a fallback behavior. If it can't find the message for a certain locale, it will try other similar locals. So after looking for en_US.UTF-8, it checks en_US and finally en. But this behavior is a non-standard extension. On Solaris, gettext() will not fall back from en_US.UTF-8 to en. The problem can be fixed for any platform, by moving the directory with the test message catalog to the correct place: - move ext/gettext/tests/locale/en to ext/gettext/tests/locale/en_US.UTF-8 - move ext/gettext/tests/locale/fi to ext/gettext/tests/locale/fi_FI ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70574&edit=1

« previous php.bugs (#228445) next »