Mono(resgen)

πŸ“¦
version 6.14.1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– resgen, resgen2 β€” Mono(resgen) πŸ’–

okay bestie, pull up a chair, because this is the Mono/CLI Resource Generator and she is lowkey iconic. two whole commands live here: resgen and resgen2, and they're your girls for turning resource files from one format into another. no cap.


✨ SYNOPSIS ✨

resgen source.ext [dest.ext]

resgen /compile source.ext[,dest.resources] [...]

resgen2

like, that's the whole vibe check right there. πŸ’…


🌸 DESCRIPTION 🌸

so the whole point of this thing is converting a resource file from one format to another. that's it. that's the girl's job.

the formats we support right now are text, resources, resx and po. let's go through them one by one, because each one has its own little personality:

πŸŽ€ .txt, .text

these are for processing text files, and the format is genuinely so simple, bestie, it's giving:

key=value

the value argument can absolutely contain special characters, as long as they're escaped. the escape sequences supported right now are \n, \r, \t, \\ (that last one gets you the escape sequence itself, cute), and with resgen2 you also get unicode escape sequences via \uXXXX, where XXXX is a four digit number. periodt.

and listen β€” any line that starts with the # or ; character? considered a comment. ignored. she doesn't see them. πŸ™ˆ

🌈 .resources

this is the binary file format implemented by the System.Resources.ResourceReader class, part of mscorlib.dll. iconic. she's built in.

πŸ¦‹ .resx

this is the binary file format implemented by the System.Resources.ResXResourceReader class. important though β€” this class is not part of mscorlib.dll, it's part of System.Windows.Forms. so like, know where your girl lives before you go knocking. πŸ’€

πŸ’œ .po.

PO files are the source files used by the Unix gettext infrastructure, which is typically what you use to internationalize applications. very main character of them.

lines starting with the # character are comment lines.

the file contains many instances of strings like this:

msgid KEY
msgstr VALUE

the KEY is typically the string to translate, and the VALUE is the translation. on PO files, instead of using codes as the KEY (which is what's customary with resource files), the KEY is typically a complete english message that applications embed in their source code β€” and it'll be used as a fallback if no translation resources are used. so it's the understudy that also knows the whole script. 🫢

now, since resources are key value pairs, the extended features in PO files are not supported β€” that's plurals and support for N-cases. soz. 😭

and to learn more about the po file format, grab your info browser and point it to the "(gettext)PO Files" node. iykyk.


okay, back to the general rules, bestie:

  • if the destination file is not specified, source.resources will be used. she'll pick for you. πŸŽ€
  • the /compile option takes a list of .resX or .txt files to convert to the output file name.

πŸ‘‘ OPTIONS πŸ‘‘

  • -compile β€” this switch instructs resgen to compile multiple files. and listen, it must appear before any resources are specified on the command line. order matters, babe, don't test her.
  • -usesourcepath β€” this option is only available for resgen2, and it instructs resgen to resolve relative paths using the directory of the resx file as current directory. yes ma'am.

πŸ“ FILES πŸ“

this program will load referenced assemblies from the Mono assembly cache. that's the tea. πŸ“


πŸ’Œ MAILING LISTS πŸ’Œ

visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details. come hang out, the group chat is right there. ✨


🌐 WEB SITE 🌐

visit: http://www.mono-project.com for details.


⭐ SEE ALSO ⭐

mcs(1), mono(1), mono-config(5) β€” go read those too, they're all part of the same friend group, fr fr.


and that's the page, bestie!! πŸ¦‹ this whole thing is Mono(resgen) β€” literally the page header said so β€” and it came from the Mono man pages, dated at the bottom with that little Mono(resgen) footer. slay, you made it to the end, we're both obsessed with you now. bye!! πŸ’–πŸ’…βœ¨
πŸ“¦ where this page comes from