MAKETEXT(1p)
π NAME π
maketext β okay bestie, this is the little script that translates and makes messages β¨
πΈ SYNOPSIS πΈ
maketext [OPTION] [--domain=TEXTDOMAIN] MSGKEY [PARAM...]
maketext [OPTION] -s MSGKEY [PARAM...]
π DESCRIPTION π
So, here's the tea: the maketext script takes a natural language message and translates it into your language, by looking up the translation in a message MO file, and then it processes the plural transformation with Maketext. Lowkey iconic of it. π
The maketext script is basically a command-line interface to Locale::Maketext::Gettext(3) (and Locale::Maketext(3) too, obvi). You can drop it in shell scripts, whatever, to translate, maketext and return the result. Which means β and this is the part that slays β it lets Maketext get integrated into other programming languages/systems, like bash/csh, python, PHP, C, etc. It works like the command-line program gettext, fr fr.
For example, look at this:
% maketext -s "[*,_1,virus was,viruses were] found in [*,_2,file,files]." 0 1
0 viruses were found in 1 file.
% maketext -s "[*,_1,virus was,viruses were] found in [*,_2,file,files]." 1 3
1 virus was found in 3 files.
%
See how the plurals did their whole thing? π Main character behavior.
β¨ OPTIONS β¨
-d,--domain=TEXTDOMAINβ go pull the translated messages fromTEXTDOMAIN.-sβ this one adds a new line to the end of the output so it behaves like theechoor thegettextcommand. Little glow-up for your newline needs. π-h,--helpβ shows you the help messages.-V,--versionβ shows version info and then exits, periodt.MSGKEYβ the original text used to look up the translated text.PARAM...β the parameters handed to Maketext for the plural and other text functions.
π¦ ENVIRONMENT π¦
TEXTDOMAINβTEXTDOMAINis what decides the text domain when you didn't pass the-dparameter. She'll cover for you. πTEXTDOMAINDIRβTEXTDOMAINDIRis used to search the message catalog/MO file if it doesn't live in the system locale directories.
π NOTES π
Maketext language function override, like quant or numerate, is not available here. Suggestions are welcome, bestie β slide into the inbox. π
The current system locale directory search order is: /usr/share/locale, /usr/lib/locale, /usr/local/share/locale, /usr/local/lib/locale. Suggestions are welcome. (Yes, both times. They really do want your suggestions. π«Ά)
π BUGS π
Report bugs to imacat <imacat@mail.imacat.idv.tw> β not me, I'm just the messenger π
π₯ SEE ALSO π₯
Locale::Maketext(3), Locale::Maketext::TPJ13(3), Locale::Maketext::Gettext(3), Locale::Maketext::Gettext::Functions(3), bindtextdomain(3), textdomain(3). Also, please refer to the official GNU gettext manual at <https://www.gnu.org/software/gettext/manual/>. Go read, iykyk ππ
π AUTHOR π
imacat <imacat@mail.imacat.idv.tw>
π COPYRIGHT π
Copyright (c) 2003-2021 imacat. 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 β you ate it all up π β¨
This little masterpiece shipped with perl v5.36.0, dated 2022-10-15, and yes, it is a MAKETEXT(1p) situation, courtesy of the User Contributed Perl Documentation crew. π Go translate something iconic. π¦
π¦ where this page comes from
- ubuntu noble: liblocale-maketext-gettext-perl 1.32-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblocale-maketext-gettext-perl 1.32-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblocale-maketext-gettext-perl 1.32-3 Β· 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