From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 3D09021800 for ; Tue, 30 Jan 2024 12:45:47 +0100 (CET) Received: (qmail 20418 invoked by uid 550); 30 Jan 2024 11:43:22 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 20379 invoked from network); 30 Jan 2024 11:43:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706615133; x=1707219933; darn=lists.openwall.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=RAd/11ZiL3ljEO5ysVMVt46/ISCq9ZAQj8mm5ynGjrk=; b=EEmNlR8GFxePgHvoaY5VPbt0xjpe3Cj0iL5sIZEdwbJbcw5vI8GEeW98KeCmI8cemX ZWq5E2i/tz/CnL65rTTkfS3O55L2Ks5RxR/kzNXyGKB2bUpwWnAGQtFHx2HPEUIWbjNS liggS9HcN0XSF4F9mfsAcb/E1TA2Xmob/I/zypAM5oyGFy7aSQLNk5gH+W9C5ahjMfSE vBKqAS3L00rqkJGTZafs0Tc8A7LCJJ03qq6w/3EEAWDzThSLoqQlaDOu6BUPya9B1bkm nr/09kcyoPOR1fzgvt/WaK0olh1y7caIp6S4C3c+Q89KF6QaJmT7RkpwryUeZ7pp0F9P /8ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706615133; x=1707219933; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RAd/11ZiL3ljEO5ysVMVt46/ISCq9ZAQj8mm5ynGjrk=; b=hqGHz17UGQe/MYo1Q6S5JhIHUDKveOxbLQEkwqLhZO5INKB/+0rCPDGo27+WeUH+0q 2MB0qVbTCFrr6cK6E3kq/j1A3afcq/BIZVv9RXsPkKZO61FdLkmQtjOKGuPAIOuDp810 gY1PYHwAH547hfA4KvG106eXMlAh2ydOT5QF0uMOrtktTW/awyhLAXBeecDiWiGwXDDk acAdR9lv/4eoo9qesMlAv431Z88YP+ejN+uHoaFGQ+XjWZZS1sM5jcIgwPdR6g8R9CXC A3YPgaK3eiGf/0MtSQBrGx2kAdpIBop4z4/BjV91vhgw/p8frH+U+OQ0LT28aZXXZSwo y7vw== X-Gm-Message-State: AOJu0YykqsJDdA9A3IDlL99LV95R07+MzVyMV3ReZW1F4JaDw1QXixW9 QXI76VqKi1hm7vfWOYK+Xw1AdWPyuGuMqBnEnfqemsF8oc+QWf2PLsmMN6zZyn54E2qCECBOHhT X/jShKtx7hUHhPoPT0UVNS9E4z6tkYoXr X-Google-Smtp-Source: AGHT+IFTdd1Ef4JrX9SZKYH73nq/t5IewSd98n2Rg3V95RQhnjjCF9Mbc860LxJXlmwMh+g+8vFxjXO+2jj7Kmubwg4= X-Received: by 2002:a05:6358:7289:b0:175:d3e6:8fa0 with SMTP id w9-20020a056358728900b00175d3e68fa0mr5253672rwf.56.1706615133420; Tue, 30 Jan 2024 03:45:33 -0800 (PST) MIME-Version: 1.0 References: <150a43fecb5b775052693c9f34b30140cc483bed.camel@postmarketos.org> In-Reply-To: <150a43fecb5b775052693c9f34b30140cc483bed.camel@postmarketos.org> From: "Konstantin P." Date: Tue, 30 Jan 2024 15:12:09 +0300 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="000000000000cbc0ad0610284cf0" Subject: Re: [musl] On musl-locales, gettext, and easying translatable strings detections --000000000000cbc0ad0610284cf0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I am an original author of musl-locales. 1. We need a solution for May month, because in some languages it have more than 3 letters 2. I crafted those musl-po files mostly manually, with a little help of gettext 3. We need to be able to translate currency and digital symbol somehow. Maybe a solution is an embedding a .mo file into musl? On Tue, Jan 30, 2024 at 2:02=E2=80=AFAM Pablo Correa Gomez < pabloyoyoista@postmarketos.org> wrote: > Hello everybody, > > I've been working on musl-locales with the general goal of improving > localization in musl. I'd hope that some of the locale-related patches > in the pipeline could be merged if we improve the locales, and prove > that we can maintain them. > > While going through the current status, I've realized that the ".pot" > file contains a multitude of strings that are not supposed to be > localized in musl (e.g: strings in src/misc/fmtmsg.c), and it has > missing some others (like key-related errors from > src/errno/__strerror.h). Manually crafting such a file is complete > madness, and gettext can help here, but we need to be able to provide > it with some way to identify what is a translatable string, as it does > not understand static strings with '\0' as separator. I've come with an > example of something that would work for gettext, but would maintain > the behavior of static strings. Would this be something that might be > considered, given a complete patch is provided? > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > diff --git i/src/network/hstrerror.c w/src/network/hstrerror.c > index a4d001c5..c86e3e8f 100644 > --- i/src/network/hstrerror.c > +++ w/src/network/hstrerror.c > @@ -3,11 +3,14 @@ > #include "locale_impl.h" > > static const char msgs[] =3D > - "Host not found\0" > - "Try again\0" > - "Non-recoverable error\0" > - "Address not available\0" > - "\0Unknown error"; > +#define MSG(m) m"\0" > + MSG("Host not found") > + MSG("Try again") > + MSG("Non-recoverable error") > + MSG("Address not available") > + "\0" > + MSG("Unknown error"); > +#undef MSG > > const char *hstrerror(int ecode) > { > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Would probably mean applying the same logic to the relevant strings in > > src/network/gai_strerror.c > src/network/hstrerror.c > src/regex/regerror.c > src/string/strsignal.c > src/locale/langinfo.c > > Anything else I might have missed? > > Best regards, > Pablo Correa Gomez. > --000000000000cbc0ad0610284cf0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am an original author of musl-locales.
1. We need a solution for May month, because in some languages= it have more than 3 letters
2. I crafted those musl-po files mos= tly manually, with a little help of gettext
3. We need to be able= to translate currency and digital symbol somehow.

Maybe a solution is an embedding a .mo file into musl?

=
On Tue, Ja= n 30, 2024 at 2:02=E2=80=AFAM Pablo Correa Gomez <pabloyoyoista@postmarketos.org> wrote:
Hello everybody,<= br>
I've been working on musl-locales with the general goal of improving localization in musl. I'd hope that some of the locale-related patches<= br> in the pipeline could be merged if we improve the locales, and prove
that we can maintain them.=C2=A0

While going through the current status, I've realized that the ".p= ot"
file contains a multitude of strings that are not supposed to be
localized in musl (e.g: strings in src/misc/fmtmsg.c), and it has
missing some others (like key-related errors from
src/errno/__strerror.h).=C2=A0Manually crafting such a file is complete
madness, and gettext can help here, but we need to be able to provide
it with some way to identify what is a translatable string, as it does
not understand static strings with '\0' as separator. I've come= with an
example of something that would work for gettext, but would maintain
the behavior of static strings. Would this be something that might be
considered, given a complete patch is provided?
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0
diff --git i/src/network/hstrerror.c w/src/network/hstrerror.c
index a4d001c5..c86e3e8f 100644
--- i/src/network/hstrerror.c
+++ w/src/network/hstrerror.c
@@ -3,11 +3,14 @@
=C2=A0#include "locale_impl.h"

=C2=A0static const char msgs[] =3D
-=C2=A0 =C2=A0 =C2=A0 =C2=A0"Host not found\0"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0"Try again\0"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0"Non-recoverable error\0"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0"Address not available\0"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0"\0Unknown error";
+#define MSG(m) m"\0"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0MSG("Host not found")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0MSG("Try again")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0MSG("Non-recoverable error")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0MSG("Address not available")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0"\0"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0MSG("Unknown error");
+#undef MSG

=C2=A0const char *hstrerror(int ecode)
=C2=A0{
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Would probably mean applying the same logic to the relevant strings in

=C2=A0src/network/gai_strerror.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0src/network/hstrerror.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0src/regex/regerror.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0src/string/strsignal.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0src/locale/langinfo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

Anything else I might have missed?

Best regards,
Pablo Correa Gomez.
--000000000000cbc0ad0610284cf0--