MoFile

Struct representing .mo file.

Default constructed object returns untranslated messages.

Constructors

this
this(string fileName)

Read from file.

this
this(immutable(void)[] data)

Constructor from data. Data must be immutable and live as long as translated messages are used, because it's used to return strings.

Members

Functions

gettext
string gettext(string msgid)

Get translated message.

header
string header()

.mo file header that includes some info like creation date, language and translator's name.

ngettext
string ngettext(string msgid, string msgid_plural, int n)

Get translated message considering plural forms.

Meta