rkd77 / elinks

Fork of elinks
Other
339 stars 35 forks source link

Remove dependence on _nl_msg_cat_cntr #325

Closed doughdemon closed 1 week ago

doughdemon commented 1 week ago

The extern variable _nl_msg_cat_cntr in src/intl/libintl.* is an implementation detail of GNU gettext. Other gettext implementations, such as the one used by musl libc do not provide this external variable. I wonder whether there is a way to implement set_language() without depending on this detail. Here is a related bug report: https://bugs.gentoo.org/906895

rkd77 commented 1 week ago

I tried it on Alpine. It compiles, _nl_msg_cat_cntr is found, but changing a language has no effect.

rkd77 commented 1 week ago

Update: When LANG=C.UTF-8 changing languages has no effect. Also on glibc. When LANG is "normal" it worked.

doughdemon commented 1 week ago

I should have said that the compilation error only occurred with the -Dgettext=true compile option (so that the external gettext is used). Otherwise, it also compiles on the gentoo musl profile. The new commit works, thank you!