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,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 A8793274CF for ; Tue, 30 Jan 2024 00:02:25 +0100 (CET) Received: (qmail 19778 invoked by uid 550); 29 Jan 2024 23:00:01 -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 19740 invoked from network); 29 Jan 2024 23:00:00 -0000 Message-ID: <150a43fecb5b775052693c9f34b30140cc483bed.camel@postmarketos.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postmarketos.org; s=key1; t=1706569329; 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; bh=yuzIeTSj8/CUUWe5r4ZuXzRR0j84SvP5a9Q00t0P6Gg=; b=VeK4tkp764D6DbUdc8l5v3U5pPgShssNiOpYfhbOWNv2qlHc764ZbfTa5N2WTB++uOG56+ Vhi9j+c4k3oVnUuLGMD7lqlt0ONNG7eDjpmTziAb1nEiQY/iSkeeSw1eD55z0Rh8FlRAwi t3tzxY1HS4yOjcvhwLk/H0jNDUOpDrcO8RDae3qFOC8/2tPcKS6+ByBzAnTO4Vh2HJn+DM vC3jWJ3TDVEMeNvz4048isL4/Q/wQ/uaafPfkzixkAHHm5ecrhmFjFqLSbB0/m/ycHDG7P PdMO9pn4jkjpMsKh7TIvyI+CAzqqGDhYeCAnUEKjgc6AKCXxzA1JrRnKvoubkA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Pablo Correa Gomez To: musl@lists.openwall.com Date: Tue, 30 Jan 2024 00:02:03 +0100 Organization: postmarketOS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Subject: [musl] On musl-locales, gettext, and easying translatable strings detections 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.=C2=A0 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 =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 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" =20 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 =20 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=20 src/network/gai_strerror.c =20 src/network/hstrerror.c =20 src/regex/regerror.c =20 src/string/strsignal.c =20 src/locale/langinfo.c =20 =20 Anything else I might have missed? Best regards, Pablo Correa Gomez.