Class PoCatalog
- Namespace
- Icy.Localization
- Assembly
- IcyUI.dll
The translations of one gettext .po file: one language.
public sealed class PoCatalog
- Inheritance
-
PoCatalog
- Inherited Members
- Extension Methods
Remarks
Read by Parse(TextReader, string?), which supports:
msgctxt,msgid,msgstr, and strings continued on following lines;- the escapes
\n,\t,\r,\"and\\; #comments.
It skips the header entry (msgid ""), entries flagged #, fuzzy and untranslated ones (an empty
msgstr), as gettext does. A plural entry contributes its msgstr[0]. An entry with a context is
stored as context + '\u0004' + msgid.
Properties
Count
Gets the number of translated entries.
public int Count { get; }
Property Value
Methods
Parse(TextReader, string?)
Reads a .po file.
public static PoCatalog Parse(TextReader reader, string? sourceName = null)
Parameters
readerTextReaderThe file's text.
sourceNamestringThe file's name, for error messages.
Returns
- PoCatalog
The catalog.
Exceptions
- FormatException
The text isn't a valid
.pofile; the message starts withname(line):.
TryGetString(string, out string?)
Gets the translation of key.
public bool TryGetString(string key, out string? value)
Parameters
keystringThe
msgid, orcontext + '\u0004' + msgid.valuestringThe translation, when there is one.