Skip to content
perpetualKid edited this page May 3, 2021 · 2 revisions

ICatalog interface

ICatalog is the primary interface to provide GetText GetString* funtionality.

Where possible, GetText.NET has simplified usage over original GNU Gettext tools, i.e. removed Get*StringFmt() methods and pass parameters directly to Get*String() overloads.

GetString(string text)
GetString(string text, params object[] args)

GetPluralString(string text, string pluralText, long n)
GetPluralString(string text, string pluralText, long n, params object[] args)

GetParticularString(string context, string text)
GetParticularString(string context, string text, params object[] args)

GetParticularPluralString(string context, string text, string pluralText, long n)
GetParticularPluralString(string context, string text, string pluralText, long n, params object[] args)

FormattableString and FormattableStringAdapter

Browsing through the interface definition of ICatalog you may see slightly different overloads using FormattableString and FormattableStringAdapter instead of native string type for text and plural text parameters.

This is needed only to correctly resolve between traditional formattable strings ("{0} string format", parameter) and Interpolated string types ($"{parameter} string format") to resolve and call the correct overload for formated string, so C# would correctly pass interpoled strings. From user perspective of the interface, one only needs to pass the string of either format