Debian...Debconf(3pm)
π Debian::L10n::Debconf π
okay bestie so this is Debian...Debconf, section 3pm β it's the Perl module Debian::L10n::Debconf, and it's literally here to tell you the translation status of your Debconf templates. like, who translated what, who's fuzzy, who's ghosting you entirely. we love a status report π
β¨ NAME β¨
Debian::L10n::Debconf β translation status of Debconf templates. that's the whole vibe. it's giving "I just wanna know if the French translation ate or not." π
πΈ SYNOPSIS πΈ
use Debian::L10n::Debconf;
my $tmpl = Debian::L10n::Debconf->new();
$tmpl->read_compact($file);
my @languages = $tmpl->langs();
foreach (sort @languages) {
my ($t,$f,$u) = $tmpl->stats($_);
print "$_:${t}t${f}f${u}u\n";
}
see that? that's the whole plot. make an object, read a file, get your languages, loop through them, print the tea. simple. iconic. no cap. π¦
π DESCRIPTION π
This module extracts informations about translation status of Debconf templates files.
that's it. that's the mission statement. it goes into a templates file and comes back out with receipts about who translated it. π₯
π METHODS π
okay this is the main character section. every single one of these is here, no skips, no "you get the idea" β we're listing all of them fr fr.
π new
This is the constructor. the origin story. the birth.
my $tmpl = Debian::L10n::Debconf->new();
make one of these and you've got yourself a $tmpl object ready to go. slay. β¨
π read_compact
Read a templates file containing all translations.
but wait β there's an optional second argument, and this is the part where you gotta pay attention bestie. Any non-zero value tells that this file comes with translations in other files. In such a case no warning is raised if this file contains translated fields, because maintainer is assumed to be responsible for such translations. so like, if you pass that truthy second arg, the module just trusts you and stops side-eyeing your translated fields. π
$tmpl->read_compact($file);
π read_dispatched
Read templates contained in several files. First argument is the English file, all other arguments are translated templates files. so the English one goes first, always, like the group chat admin. everyone else queues up behind it.
@trans = qw(templates.de templates.fr templates.ja templates.nl);
$tmpl->read_dispatched('templates', @trans);
π langs
Return the languages in which this templates file is translated.
my @list = $tmpl->langs();
just hand you a list of language codes. that's it. short queen. π
π filename
When templates are dispatched into several files, return the filename in which the language passed as argument is found.
my $filename = $tmpl->filename("de");
so you pass in "de" and it's like "oh bestie, that one's in this file." super handy when your templates are scattered across a million little files. π§
π count
Return the number of translatable strings in this templates file.
my $number = $tmpl->count();
how many strings are even up for translation? this tells you. the denominator of your whole situation. π
π stats
okay this one has two moods and both of them ate.
With an argument, return an array consisting of the number of translated, fuzzy and untranslated strings for the language given as argument. Without argument, return a hash array indexed by language and returning an array of the number of translated, fuzzy and untranslated strings.
so: one language in β one little array of three numbers out. no argument β the whole hash, every language, each one holding its own three-number array. π
my ($t, $f, $u) = $tmpl->stats("de");
my %stats = $tmpl->stats();
foreach (keys %stats) {
print $_.':'. $stats{$_}->[0].'t'.$stats{$_}->[1].'f'.
$stats{$_}->[2]."u\n";
}
translated, fuzzy, untranslated. t, f, u. memorize the order, it matters, don't @ me. β
π entries
Return an array containing all Debconf ids found in this templates file.
my @ids = $tmpl->entries();
every single Debconf id, right there in an array. collect them all like they're PokΓ©mon. π₯
π AUTHOR π
Copyright (C) 2001 Denis Barbier <barbier@debian.org>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
so yeah β Denis Barbier made this in 2001, absolute legend, and it's GPL'd, version 2 or later, your choice, no stress. π«Ά
and that's the whole page bestie!! π it's perl v5.32.0, dated 2021-01-05, and it lives in Debian...Debconf(3pm) β now go check your translation stats and tell me who's fuzzy, I bet it's giving β¨chaosβ¨. mwah π
π
π¦ where this page comes from
- debian bookworm: dl10n 3.00+nmu1
- ubuntu jammy: dl10n 3.00+nmu1
- ubuntu noble: dl10n 3.00+nmu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms