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=-1.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,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 EBA882733A for ; Wed, 31 Jan 2024 23:45:13 +0100 (CET) Received: (qmail 20263 invoked by uid 550); 31 Jan 2024 22:42:44 -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 20228 invoked from network); 31 Jan 2024 22:42:43 -0000 Message-ID: <82f0b300759b2b08b45669b5379a39665aa06313.camel@postmarketos.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postmarketos.org; s=key1; t=1706741100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ln9yK8ALPgSHOC5XuTNv8QVVktZZLZpfKmI/Xl6qjbo=; b=U8Eql1iKQ+mI8fd0cJeGgXEGu24x5LgpYRs8T+3CL0VtW1HfZGFnr8JaNs5e/c+44CNqX1 q9M8bzHBmYW2WdRfbUpxTznThiDmGhKTwfqBqQbIDNcxcIVOYEnPKTT/hE9rWc3arrKChC +NoBnZokB/kYKwosLHON8h5KZ20M4Tuv5ykaWOP+x2GiAeYjNLOv0KCPG/0eNLXbcPg8ED lE6DK3xaybiQABNQz4pi+OOnqmDPK3JmP74IcWFyeO2P2iu6lS538UYy5a45z8RtRx6pxJ jNe/sz9c0/qNHfrBnsBD224MB1T3fVCEt6Rcjxy9xpxvuUWvobB8cDWCqdFFBQ== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Pablo Correa Gomez To: "Konstantin P." , musl@lists.openwall.com Date: Wed, 31 Jan 2024 23:44:57 +0100 In-Reply-To: References: <150a43fecb5b775052693c9f34b30140cc483bed.camel@postmarketos.org> Organization: postmarketOS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Subject: Re: [musl] On musl-locales, gettext, and easying translatable strings detections Hi Konstantin, Thank you very much for your input here. I guess that might be an option. The other alternative would be to maybe have some place-holder values? And change a bit some of the logic so that if no message is found, the placeholders are not returned?=20 In any case, I'm happy to look into implementing some of this solutions, but need feedback mostly from Rich into what could possibly be accepted into musl. So I can know in which directions would be worth to investigate. Best, Pablo. El mar, 30-01-2024 a las 15:12 +0300, Konstantin P. escribi=C3=B3: > I am an original author of musl-locales. >=20 > 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. >=20 > Maybe a solution is an embedding a .mo file into musl? >=20 > On Tue, Jan 30, 2024 at 2:02=E2=80=AFAM Pablo Correa Gomez > wrote: > > Hello everybody, > >=20 > > 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.=C2=A0 > >=20 > > 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).=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?=20 > > =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=20 > > 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" > >=20 > > =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 > >=20 > > =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 > >=20 > > Would probably mean applying the same logic to the relevant strings > > in=20 > >=20 > > =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=20 > > =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=20 > >=20 > > Anything else I might have missed? > >=20 > > Best regards, > > Pablo Correa Gomez.