Skip to content

Language: 48622: Set LC_ALL for native gettext on macOS and BSD - #12327

Merged
c-knof merged 1 commit into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:fix/trunk/ck/48622-macos-lc-all
Oct 29, 2026
Merged

c-knof merged 1 commit into
ILIAS-eLearning:trunkfrom
kroepelin-projekte:fix/trunk/ck/48622-macos-lc-all

Conversation

@c-knof

@c-knof c-knof commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #12324, https://mantis.ilias.de/view.php?id=48622

On macOS, setup build still aborted with "Native gettext does not translate: ... in the domain "acc.ar"" if the environment sets LANG=C.UTF-8 (reported on Discord) or LC_ALL/LC_MESSAGES/LANG to C. GNU libintl on macOS takes the locale from these variables before setlocale() and ignores LANGUAGE for C and C.<codeset>.

  • With a system locale (macOS/BSD), NativeGettext now also sets the environment variable LC_ALL to that locale and restores it like LANGUAGE. Linux (glibc) is unchanged.
  • Child processes inherit LC_ALL during the request (documented).

Checked on macOS arm64 (Homebrew PHP 8.5, gettext 1.0) with GitHub Actions: setup build and lookups pass under 8 locale environments, including LANG=C.UTF-8, and the Language tests are green. FreeBSD was not affected.

GNU libintl on macOS takes the locale from LC_ALL, LC_MESSAGES or LANG before setlocale() and ignores LANGUAGE
for "C" and "C.<codeset>", so `setup build` aborted e.g. with LANG=C.UTF-8. With a system locale `NativeGettext`
now also sets the environment variable LC_ALL to that locale and restores it like LANGUAGE.
@c-knof c-knof added bugfix php Pull requests that update Php code labels Oct 29, 2026
@c-knof
c-knof merged commit dd8e949 into ILIAS-eLearning:trunk Oct 29, 2026
6 checks passed
@c-knof
c-knof deleted the fix/trunk/ck/48622-macos-lc-all branch October 29, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant