MAKETEXT(1p)

πŸ“¦
version 1.32 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 from TEXTDOMAIN.
  • -s β€” this one adds a new line to the end of the output so it behaves like the echo or the gettext command. 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 β€” TEXTDOMAIN is what decides the text domain when you didn't pass the -d parameter. She'll cover for you. πŸ’œ
  • TEXTDOMAINDIR β€” TEXTDOMAINDIR is 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 (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