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 4jcFz13Jxcz2xQc for ; Sat, 28 Nov 2026 16:26:21 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jcFyx6wrBz2x9t for ; Sat, 28 Nov 2026 16:26:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4jcFyx1y9yzFc for ; Sat, 28 Nov 2026 16:26:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1795883177; 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=vwQJTauqFWD09Jc6yKNztyttSHAm6w+plxbw1SMFOjo=; b=2zNS++5k2LsT23L0sQgdYryyoB5kCicd94rGzCIeqZYmMZ39XCNwlPx1UrmxXgSFNiU+6Y CzhqVuxHpI/rA6DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1795883177; 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=vwQJTauqFWD09Jc6yKNztyttSHAm6w+plxbw1SMFOjo=; b=Q2NwORRv7m9vnYE6UG/9jNd0Ll2E/kWzlT1h12GPUQhNmqs1S6SkoULFbcbP1YQsLHEJ9u HHQuV8kBQSe0yjyjXDgHlgUhrBEzYWuIck+a08n8s6z7ADCIMPeQGOWvH5HjX5sT2IBxQg WDkgt8Z0nqv9YHbx2QnhtDoIswDmHBwMYpwmHSj/Bu8x0HFY/YyKxmquyb4dViaG9YqCqF kfAFmRTYjxSJPqiqaEG3XEl3Tfwp66E31La63nJD+Y9rzNJLmUr7Ek9IZkp7HoJo/N7Muk zD/8ZfJRe4o13XRzsUrIylshWkdZXkkueW/NTqMH/x2Zt3UKRvQZkh15s/PSmg== Message-ID: <05d222be-77fa-47aa-aa03-64d73260f7f0@ipfire.org> Date: Sat, 28 Nov 2026 17:26:11 +0100 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? To: development@lists.ipfire.org References: <4jWLMm6NGhzTq0T@michael.haj.ipfire.org> <393a3f97-4606-4785-bbe8-7b2e9351e7bd@ipfire.org> <214A071B-56FD-480E-8BD3-C88D33AAB87F@ipfire.org> Content-Language: en-US From: Matthias Fischer In-Reply-To: <214A071B-56FD-480E-8BD3-C88D33AAB87F@ipfire.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28.11.2026 15:10, Michael Tremer wrote: > Hi Matthias, Hi Michael, > 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. No problem - it was pure fun. The script may not be the most elegant code ( ;-) ), but it gets the job done. And I wanted a solution. Now I can test as I usually do... > 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? Sounds good - go ahead. As I said - no problem for me. ;-) But keep in mind that the cache manager and a few other things were removed in 'squid v7.0.1'. I must confess that I'm still in the process of refactoring the CGI. The current v7.8 is running fine here, but I still hadn't the nerve (and the skills) to remove obsolete code parts from 'proxy.cgi'. Best Matthias > Best, > -Michael > >> On 27 Nov 2026, at 17:58, Matthias Fischer wrote: >> >> Hi, >> >> in short: >> Many thanks for the hint with 'mgmfmt'. I've found a solution and it works! >> >> In long: >> E.g., I'm running a rather old tool called 'squid-graph' - unofficial. >> >> This tools analyses squids 'access.log', writing an 'index.html' and >> some PNG-graphs, showing the current proxy utilization on the Web GUI. >> >> To do this, every five minutes a script called >> '/usr/bin/squid-graph' is started. >> >> The problem: >> Nearly all translation strings for 'squid-graphs' are included in this >> script. From the Web GUI a 'sgraph.cgi' then calls an 'index.html' and >> the PNGs to display the results. >> >> See https://github.com/detach8/squid-graph for details, screenshot is >> attached. Its old, but its hard to give up old habits... ;-) >> >> How would be the best way to integrate this in the new translation process? >> >> What I did: >> - On one of my 'Devels', I edited 'tools/update-po' and added the path >> "config/sgraph" to 'my @searchpaths' (line 48). >> >> This script is started through './make.sh lang' for ""Updating >> the translations of the web user interface...". >> >> '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. >> >> Sounds good. >> >> 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' >> >> Now I got the source, but how to compile? I needed 'msgfmt' for this. >> Thanks again for the hint. >> >> I found that the compiling of the *.po-files is done in >> 'lfs/configroot', line 167ff: >> >> ***SNIP*** >> #!/bin/bash >> # >> for i in ../po/*.po; do \ >> lang="$$(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*** >> >> 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. >> >> 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...! :-)] >> >> 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". >> >> 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. >> >> To do this, all I have to do is add the appropriate entries in the >> respective po-file...: >> >> ***SNIP*** >> #: Where does this string come from >> msgid "Some String In The CGI (e.g.)" >> msgstr "What should the translation be?" >> ***SNAP*** >> >> ...and run the compile-script. >> >> Improvements are possible and welcome... ;-) >> >> Best >> Matthias >> <2026-11-27-1-po-files-for-ipfire-Core206.tar.gz>