On Tue, Nov 26, 2024 at 06:33:31PM +0000, Gavin Smith wrote:
> > Opinions?.
> 
> If I understand correctly, there are two ways to get translations in
> the XS modules.  One is to call the gettext functions directly.  The
> other is to call back into the Perl interpreter to use the non-XS
> translation functionality.  For older versions of Perl we use the
> latter method as calling gettext directly doesn't work reliably due
> a bug in the Perl interpreter which has since been fixed.
> 
> On the two systems you mention (Cygwin64 and Macos-13), in spite of
> Perl appearing to be new enough, calling gettext does not work.  It
> is presumed that calling back into Perl would work, though.  Have I
> understood the issue correctly?

You understood correctly.

> Could we make a configure-time check to see whether getting translations
> with gettext works?  I think it is something that we should be able
> to determine automatically rather than trouble the user with a customization
> variable.

In any case, I think that we need a configure flag, as even if we manage
to do some automatic detection, it is likely to fail in some cases, so
we need to provide with a possibility to manually override.

Testing reliably if gettext works the way we want it to work seems
difficult to me.  A first difficulty is that we need to setup a
translation gmo file in a specific domain that can be usable before
anything has been configured, and then we have to setup the domain in
the code.  The other difficulty is that it is not very clear what fails.
It probably isn't every gettext calls, more likely the language
switching code fails, which is not so small.  And lastly we need to run
the check, which is always problematic when cross-compiling.  So, it is
probably doable, but it will very likely be error prone, especially for
platforms without someone being able to test with direct access to the
platform.

I am not sure that it is worth it, it would be better to actually test
on the platforms and understand what is problematic, try to fix, and if
it is not possible, try to come up with an automatic check of something
more focused.

-- 
Pat

Reply via email to