On Thu, Oct 08, 2026 at 04:31:35PM +0200, Bruno Haible wrote:
> Patrice Dumas wrote:
> > However, if the locale is the C locale, it must be
> > changed first to any other locale such that LANGUAGE is obeyed, and it
> > is this code that is skipped on _WIN32, which is probably wrong.
> 
> Yes, such code is needed, because gettext returns untranslated strings
> when the locale is "C".
> 
> The only real differences between _WIN32 and POSIX systems are the
> locale names: What is "fr_FR.ISO-8859-1" in POSIX systems, is
> "French_France.1252" on _WIN32.

Is there a locale, and what could be its name, that is always installed
on _WIN32 systems, such that we can switch to that locale from the C
locale?  (On POSIX, we try "en_US.UTF-8", "en_US" and 'locale -a'
command output).

> The only real difference between _UCRT and older MSVCRT regarding
> gettext is that you may need to call SetEnvironmentVariable in the
> _UCRT case, as mentioned in the gettext FAQ.

That is something we definitively do not right now.  It could also be
the reason why there are no translations.

If I have understood correctly, we could remove the special case for
_WIN32 when we have a replacement of "switch_messages_locale ();" that
works for _WIN32 (cf my question above) if we use Gnulib.

We need to reset the locale to the previous values, therefore we also
call "getenv" to get the previous values for the environment variables.
Is there another function to use with _UCRT?

-- 
Pat

  • rema... Patrice Dumas
    • ... Eli Zaretskii
      • ... Patrice Dumas
        • ... Eli Zaretskii
          • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
            • ... Patrice Dumas
              • ... Eli Zaretskii
                • ... Patrice Dumas
                • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
                • ... Patrice Dumas
                • ... Eli Zaretskii
                • ... Patrice Dumas
                • ... Eli Zaretskii
                • ... Patrice Dumas
                • ... Eli Zaretskii
                • ... Patrice Dumas
                • ... Eli Zaretskii
                • ... Patrice Dumas
                • ... Patrice Dumas
            • ... Gavin Smith

Reply via email to