Re: POSIX gettext(): Use of LANGUAGE in the POSIX locale

2022-05-16 Thread Geoff Clare via austin-group-l at The Open Group
Bruno Haible wrote, on 12 May 2022:
>
> https://posix.rhansen.org/p/gettext_draft
> Line 65
> "The locale names in LANGUAGE shall take precedence over <...>"
> 
> Issue: If this is true in all cases, then
> 
> 1) programs such as 'diff'
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
> - which are forced to produce a specific output in the POSIX locale -
> will have to explicitly test for the POSIX locale, for example by
> doing
>   const char *fmt =
> (in_posix_locale () ? "Only in %s: %s\n" : gettext ("Only in %s: %s\n"));
> 
> 2) for many languages, which use non-ASCII characters, the output
> will contain many question marks, due to transliteration, because the
> POSIX locale, on many systems, comes with the ASCII encoding.
> 
> Suggestion: Change
> "over <...>"
> to
> "over <...>, if the latter is not the POSIX locale"

In today's call we made changes along the lines you suggest. Please
check the updated etherpad to see if they achieve what you wanted.

-- 
Geoff Clare 
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England



POSIX gettext(): Use of LANGUAGE in the POSIX locale

2022-05-11 Thread Bruno Haible via austin-group-l at The Open Group
https://posix.rhansen.org/p/gettext_draft
Line 65
"The locale names in LANGUAGE shall take precedence over <...>"

Issue: If this is true in all cases, then

1) programs such as 'diff'
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
- which are forced to produce a specific output in the POSIX locale -
will have to explicitly test for the POSIX locale, for example by
doing
  const char *fmt =
(in_posix_locale () ? "Only in %s: %s\n" : gettext ("Only in %s: %s\n"));

2) for many languages, which use non-ASCII characters, the output
will contain many question marks, due to transliteration, because the
POSIX locale, on many systems, comes with the ASCII encoding.

Suggestion: Change
"over <...>"
to
"over <...>, if the latter is not the POSIX locale"

Remark: This is how GNU gettext behaves for over 20 years.
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=gettext-runtime/intl/dcigettext.c;h=e7cb9b962a9a6b8e9ccf4a4a249b41517f857f26;hb=HEAD#l1626