Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vm7Tg-007iiS-0L for pgsql-hackers@arkaria.postgresql.org; Sat, 31 Jan 2026 09:41:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vm7Td-007l6X-0H for pgsql-hackers@arkaria.postgresql.org; Sat, 31 Jan 2026 09:41:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vm7Tc-007l6P-0V for pgsql-hackers@lists.postgresql.org; Sat, 31 Jan 2026 09:41:13 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vm7TZ-000Iw8-2Y for pgsql-hackers@lists.postgresql.org; Sat, 31 Jan 2026 09:41:11 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id E2777EC008A for ; Sat, 31 Jan 2026 04:41:08 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sat, 31 Jan 2026 04:41:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm1; t=1769852468; x=1769938868; bh=F2UVPrCJMe 7/0zhcDfrPnS7sbFrc+XiFb+O5jo6tAXc=; b=RPdXTAmGJUjc98fxTR5Ta3IOTW 1Z8ubv1CqvenEdHeTdycG8I6gIifYuCIRlWB0WVjL/Br7n55iAMMoDgGfoNN+p56 bZ+Lazn3fG2lHm85T/eHgNPU57lGHHxRYVNC/TlSaBtezPMLsiZpZ8k5RnJlMlM2 Ixj/frhpnUj89p78xlENDf3AB4ygV31eXWEx88TvjyyDeSENZ69bclkzro6RRHFD aBEsXUnKFnpq6npsrZjpVnWCGOCsMaDxAgDZ6t+L6kIptOhnfT2qaoMyRc9caoc/ +VSvBJoEgOiswi+ofmlL9jT9gGEK+04I+a6mAQ1jD6lr7aHz+fZR6i1KtCRw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1769852468; x=1769938868; bh=F2UVPrCJMe7/0zhcDfrPnS7sbFrc+XiFb+O 5jo6tAXc=; b=lim/vlo8ZHSR22VaLjIW2L34qEqM+Ve79EX4xG+pjQz+e6aocwA tP0CYESsMsykc5FAcYyvErBB4eS0M9nT6sQIeWz4iDAMiIA31LgprWDpcH7/6NO+ xKmbvqiDEUsx5UxWpaLLBqxVEgB8Wpnqv29zlxu7iHHH78e1rlMJSCZZ9y16YKKz OCCXlhle25+KcGHUW2YA2KTGlP7z9TQ4LNyGCG603Zeo/FdPr87gTQqtKEQ/KZZ/ CJcJylg+6wMnAqCohcBpWqerkncvgUvkL78fslxeHQt4TwJTFzOAACum+EhabRdb vjZykP970kHXMj3FmR7zdyU3RH32gPTAPxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddujeduheekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvffukfggtggugfesmhekreertddtjeenucfhrhhomheplmhlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtffrrg htthgvrhhnpeefveegkedttdeiueegtefgkedvgeevudegveeukeejtdejveejtefhfeeu jeeggeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsehk uhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 31 Jan 2026 04:41:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1769852466; bh=j3QOFNU/TDCjtqvd1vHgj65eW6+E+P9FoGy35nSqjY0=; h=Date:From:To:Subject:From; b=2iNkVsxAYT+YC3DfE6v439jsmAzuCfLi7EJItTW2fhxSso0srCzCIfu+yoVOog1/F 7N58+OAGwk9rzz5wHcziIPnSzheOMSXdU3GZkTrlzrqJmyRG3Mt3gDCbQYGVZPRv7Z xMPMfO2U7jXwqxaMp4WHWTc3SdXHUY8aFQxx/o7aIph1p2+EHoMGJKlA+WLFqXzvxq AfzmfB09L+0wt1Y6NWuq6VjeTTn530Rat2KP5OfIzaPEPgjZeF4F+/G5olHTfwmTwp OpVBDJXhNhizk5JCdT/EiN69uuHq6RSuwVqVdQwamjVxHF4CpxPFGoczsjuqddv6LB 1UI+cV6LwlZvw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 74BFD74; Sat, 31 Jan 2026 10:41:06 +0100 (CET) Date: Sat, 31 Jan 2026 10:41:06 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Pg Hackers Subject: splitting pg_resetwal output strings Message-ID: <202601310924.yoik5n3blgt4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6po7oomtfoqj5cjo" Content-Disposition: inline Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6po7oomtfoqj5cjo Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, For a long time I've been annoyed that certain tools such as (but not only) pg_resetwal have translatable strings full of whitespace that translators have to be careful about so that things look nice. For Spanish I have made the lines a bit wider so that everything fits, which means that every time someone adds a new line that's not yet translated, the output looks bad; and if I want to add one more space to align a new longer string, then I have to edit every single one of them. This is horrible. Here's a proposal. The idea is to have a separate file (entries.h right now but proposal for better names are welcome) which lists those strings, together with the printf specifiers needed to actually print them. This way, we can measure the length of each exactly as they translate before printing anything, and then line up everything to the same output length. One curious thing of note is that I had to add an internal_wcswidth() function, to avoid having to link libpq just to be able to do pg_wcswidth(). This is not complete. It modifies PrintControlValues(), which is easy because I just print each item in the entries.h file in the same order they appear there. But for PrintNewControlValues() I'll need to add a symbolic identifier to each string, that the code can use to scan the array and print just those elements. I'll do that if there are no objections to this idea here. Also, pg_controldata could probably something very similar or maybe the same entries.h file. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "If you want to have good ideas, you must have many ideas. Most of them will be wrong, and what you have to learn is which ones to throw away." (Linus Pauling) --6po7oomtfoqj5cjo Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Split-out-entry-names-in-pg_resetwal.patch"