Port Perl code to translatable strings format supported by GNU gettext
Context: #17568 (closed), https://github.com/jwilk/i18nspector/issues/5
We should switch from String::Errf
+ gettext
to https://metacpan.org/pod/Locale::TextDomain, and then i18nspector upstream is open to add checks about this translatable strings format. This would allow detecting, for example, missing placeholders or mistakenly translated placeholders in translated strings.
This will also allow fully checking that placeholders match in translated strings, using msgfmt --check
.
All the code that needs adjusting lives in config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm
.
But while we're at it, let's also port:
-
config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/*.pm
to this translatable strings format: I see 3 instances ofsprintf
+gettext
with positional placeholders, that translators cannot reorder. - other Perl programs that use
Locale::gettext
Edited by intrigeri