Locale::Msgfmt(3pm)
β¨ NAME β¨
Locale::Msgfmt β bestie, this compiles .po files into .mo files π
Like, it's the whole personality: po in, mo out. Periodt.
πΈ SYNOPSIS πΈ
okay so listen. This module does literally the exact same thing as msgfmt from GNU gettext-tools, except β plot twist β this one is pure Perl. No compiled C nonsense, no build drama, just vibes. π§
The interface is best explained through examples, so here's the whole group chat, message by message:
use Locale::Msgfmt;
# Compile po/fr.po into po/fr.mo
msgfmt({in => "po/fr.po", out => "po/fr.mo"});
# Compile po/fr.po into po/fr.mo and include fuzzy translations
msgfmt({in => "po/fr.po", out => "po/fr.mo", fuzzy => 1});
# Compile all the .po files in the po directory, and write the .mo
# files to the po directory
msgfmt("po/");
# Compile all the .po files in the po directory, and write the .mo
# files to the po directory, and include fuzzy translations
msgfmt({in => "po/", fuzzy => 1});
# Compile all the .po files in the po directory, and write the .mo
# files to the output directory, creating the output directory if
# it doesn't already exist
msgfmt({in => "po/", out => "output/"});
# Compile all the .po files in the po directory, and write the .mo
# files to the output directory, and include fuzzy translations
msgfmt({in => "po/", out => "output/", fuzzy => 1});
# Compile po/fr.po into po/fr.mo
msgfmt("po/fr.po");
# Compile po/fr.po into po/fr.mo and include fuzzy translations
msgfmt({in => "po/fr.po", fuzzy => 1});
π¦ a lil vibe check on those examples, iykyk
- Hand it a hashref and it uses the keys, like
in,out, andfuzzyβ very demure, very mindful. - Hand it a plain string like
"po/fr.po"or"po/"and it just knows what to do, main character energy fr fr. fuzzy => 1means include fuzzy translations too, instead of leaving them out. That's it, that's the whole flag. π- Point
inat a directory like"po/"and it rounds up all the.pofiles in there. π - Point
outat a directory and the.mofiles go there; if that output directory doesn't already exist, it gets created for you. No cap. β¨
π COPYRIGHT & LICENSE π
Copyright 2009 Ryan Niebur, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie π«Ά this one shipped as perl v5.26.2, dated 2018-05-06, under the Locale::Msgfmt(3pm) manual β you ate, go compile something iconic πβ¨
π¦ where this page comes from
- debian bookworm: liblocale-msgfmt-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liblocale-msgfmt-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: liblocale-msgfmt-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liblocale-msgfmt-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms