The basic way it works is that you mark user-visible strings that could use translations, e.g. "A random event." with
_"A random event."
where _"..." is a string macro provided by the package (and there are also some more explicit functions). Then, gettext looks the string up at runtime using the current locale’s language (as specified by the OS), and returns the translation if available (or the original string if not).
Separately, translators can create a .po file which gives translations. e.g. you might have a .po file for French that includes a translation for the above string:
msgid "A random event."
msgstr "Un événement aléatoire."
The whole machinery of .po files is set up by GNU Gettext, and there are various tools to help you write them. They are designed so that translations can be contributed by non-programmers. There are even scripts to auto-generate .po files using Google translate or using LLMs. This kind of tooling is a big advantage of using a well-established solution for software localization.
Gettext.jl just hooks into this pre-existing translation machinery. The only question is how best to express the API in Julia.