Jazz2::Editor::PoFile class

Reads and writes gettext catalogs, .po and .pot files.

Only what a catalog of single texts needs — contexts, texts and their translations, comments for the translators, and the header with the language. Plural forms are read as their first form, a fuzzy translation as none, as gettext itself takes it.

Public static functions

static auto Write(ArrayView<const PoEntry> entries, StringView language, StringView projectName) -> String
Writes a catalog.
static auto Read(StringView text, SmallVectorImpl<PoEntry>& entries, String& language) -> bool
Reads a catalog, language gets the language of its header, returns false if it's damaged.

Constructors, destructors, conversion operators

PoFile() deleted

Function documentation

static String Jazz2::Editor::PoFile::Write(ArrayView<const PoEntry> entries, StringView language, StringView projectName)

Writes a catalog.

Without a language it's a template (.pot), all translations are left empty then.