From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jcBxt6drwz2xRY for ; Sat, 28 Nov 2026 14:10:10 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jcBxk5qcBz2xGr for ; Sat, 28 Nov 2026 14:10:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4jcBxk1Vrczcl; Sat, 28 Nov 2026 14:10:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1795875002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xWdocimDBOCpwis1k0OAh1LW3enxPgREha5gwQL7oyU=; b=DtbiTt0zge8Qd2ochPjJR16MCZLx6Jv26HAnyvVPAE6ooL14bHWnNTEfp7GRlwjOqhFclE sGlWIDoJZbv+mpCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1795875002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xWdocimDBOCpwis1k0OAh1LW3enxPgREha5gwQL7oyU=; b=A2uVtwhaHDSx5pYiJ039LWnAViJA4p9KotESV3P3UrrFfCSy/N3p3NO9m/9TOePUQeXCWz VWC+Ke1E7IMTmL9uMv64FbAg32lfQAct6cUlgs1Uwe+bQ355muz+GhsyEgkGeEWnNwIQZb pZkQmRGBR9SyLvEQj9ByCYYYWzbDNAqPSQg3sE9bJdNprRkpYMCi5WWnNgwRunAsRaV01z sPNC1zkRdgDUmRvcI73MROPyZKDeGfn+nPy5rLbsdsfdin0dr2mjNCIwgL2/icFO/pRc8u d904wJQwuCPdpuRg6gZ/QsL4+fn8wSsZJff1f070XVPG6H4lj2Ko34Wd525xcw== Content-Type: text/plain; charset=us-ascii Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: How to handle the new translation method on a live system? From: Michael Tremer In-Reply-To: <393a3f97-4606-4785-bbe8-7b2e9351e7bd@ipfire.org> Date: Sat, 28 Nov 2026 14:10:01 +0000 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: <214A071B-56FD-480E-8BD3-C88D33AAB87F@ipfire.org> References: <4jWLMm6NGhzTq0T@michael.haj.ipfire.org> <393a3f97-4606-4785-bbe8-7b2e9351e7bd@ipfire.org> To: Matthias Fischer Hi Matthias, thanks for working this out, and for compile-po.sh. Good to know that = the .mo files come out bit-identical, that will be useful for testing on = a live system. I would rather not put more effort into squid-graph itself. It is an = old, unmaintained Perl tool that parses access.log every five minutes = and has its own idea of translations. Instead, I would like to port the = functionality into telemetryd, so that the proxy shows up in the new web = UI next to the DNS and time server statistics. That fits very well, and = the strings then go through the normal translation process. How we would get the data: Squid already keeps all the counters we need, = so there is no need to parse any logs. Its cache manager exposes them = over HTTP on the local Squid port (the counters report: client requests, = hits, bytes in/out on the client and server side, errors). A new = telemetryd source would fetch that once per interval, convert the = counters into RRD data and the web UI would draw requests, traffic and = hit ratio from there. The only prerequisite is that Squid allows the = manager interface from localhost, which I will check in our squid.conf. I am happy to do this work myself. Would you be happy replacing = squid-graph? Best, -Michael > On 27 Nov 2026, at 17:58, Matthias Fischer = wrote: >=20 > Hi, >=20 > in short: > Many thanks for the hint with 'mgmfmt'. I've found a solution and it = works! >=20 > In long: > E.g., I'm running a rather old tool called 'squid-graph' - unofficial. >=20 > This tools analyses squids 'access.log', writing an 'index.html' and > some PNG-graphs, showing the current proxy utilization on the Web GUI. >=20 > To do this, every five minutes a script called > '/usr/bin/squid-graph' is started. >=20 > The problem: > Nearly all translation strings for 'squid-graphs' are included in this > script. =46rom the Web GUI a 'sgraph.cgi' then calls an 'index.html' = and > the PNGs to display the results. >=20 > See https://github.com/detach8/squid-graph for details, screenshot is > attached. Its old, but its hard to give up old habits... ;-) >=20 > How would be the best way to integrate this in the new translation = process? >=20 > What I did: > - On one of my 'Devels', I edited 'tools/update-po' and added the path > "config/sgraph" to 'my @searchpaths' (line 48). >=20 > This script is started through './make.sh lang' for ""Updating > the translations of the web user interface...". >=20 > 'update.po' itself tells me (line 22f): > # Extracts all translatable strings of the web user interface into > # po/ipfire.pot and merges them into the translations in po/*.po. >=20 > Sounds good. >=20 > So I did the following: > - Edited all translations in 'squid-graph' and replaced 'lang::tr...' > with '_(...' > - Created and added the directory 'config/sgraph' to the searchpath = above > - Copied 'squid-graph' to 'config/sgraph' (found no better way) > - Finally, I started './make.sh lang' > - It worked as it should and extracted all 'lang::tr'-strings > - With some editing and fine-tuning, I added these strings on my build > system to '.../po/de.po' >=20 > Now I got the source, but how to compile? I needed 'msgfmt' for this. > Thanks again for the hint. >=20 > I found that the compiling of the *.po-files is done in > 'lfs/configroot', line 167ff: >=20 > ***SNIP*** > #!/bin/bash > # > for i in ../po/*.po; do \ > lang=3D"$$(basename $${i} .po)"; \ > mkdir -p /tmp/usr/share/locale/$${lang}/LC_MESSAGES; \ > msgfmt --check-format -o > /tmp/usr/share/locale/$${lang}/LC_MESSAGES/ipfire.mo $${i} || exit 1; = \ > done > ***SNAP*** >=20 > I wasn't as clever as these few lines - my bash programming is not so > good - so I decided to do this one by one. >=20 > I ended up with a script I called 'compile-po.sh'. See it attached, = but > please don't laugh - its just doing its job. [And: it needed the > money...! :-)] >=20 > Important: > The sources for the Web GUI are read from '../po/*.po', sources for > 'setup from '../src/setup/po/*.po'. The syntax for 'msgfmt' is easy - > but you have to follow the order: > "msgfmt --check-format -o target-path-and-file source-path-and-file". >=20 > In its current state, the script must be located in the > '.../tools'-directory. After running, I got bit-identical *.mo files > (compared to a usual build) that can be copied into a running system. > The whole thing still involves a lot of manual work, but for a start, = it > serves its purpose. I don't need to run a complete build if I want to > test some new translations or add one on the fly. >=20 > To do this, all I have to do is add the appropriate entries in the > respective po-file...: >=20 > ***SNIP*** > #: Where does this string come from > msgid "Some String In The CGI (e.g.)" > msgstr "What should the translation be?" > ***SNAP*** >=20 > ...and run the compile-script. >=20 > Improvements are possible and welcome... ;-) >=20 > Best > Matthias > = <2026-11-27-1-po-files-for-ipfire-Core206.tar.gz>