This struct can for the most part be considered an implementation detail of gettext.
A template instantiation like tr!"Greetings" actually results in a constructor call like
TranslatableString("Greetings") in the code. This struct is callable, so that a lookup
of the translation happens when the struct is evaluated.
The only reason that this struct is public is to make declarations of static arrays of
translatable strings less cryptic:
enumRGB {red, green, blue}
// Explicit array of translatable strings:immutableTranslatableString[Color.max + 1] colors1 = [RGB.red: tr!"Red",
RGB.green: tr!"Green",
RGB.blue: tr!"Blue"];
// Array of translatable strings where the type is derived:immutabletypeof(tr!"Red")[Color.max + 1] colors2 = [RGB.red: tr!"Red",
RGB.green: tr!"Green",
RGB.blue: tr!"Blue"];
Represents a translatable string.
This struct can for the most part be considered an implementation detail of gettext. A template instantiation like tr!"Greetings" actually results in a constructor call like TranslatableString("Greetings") in the code. This struct is callable, so that a lookup of the translation happens when the struct is evaluated.
The only reason that this struct is public is to make declarations of static arrays of translatable strings less cryptic: