wan24-Poedit
This library contains an adapter for using Poedit PO files with wan24-Core
translation helpers. Karambolo.PO is being
referenced for that, 'cause no PO format parsing is implemented in
wan24-Poedit
.
Usage
How to get it
This library is available as NuGet package "wan24-Poedit".
Loading a translation from Poedit PO format
// From a PO file
PoeditTranslationTerms terms = PoeditTranslationTerms.FromFile("/path/to/file.po");
PoeditTranslationTerms terms = await PoeditTranslationTerms.FromFileAsync("/path/to/file.po");
// From a PO stream
PoeditTranslationTerms terms = PoeditTranslationTerms.FromStream(poStream);
PoeditTranslationTerms terms = await PoeditTranslationTerms.FromStreamAsync(poStream);
// From a PO string
PoeditTranslationTerms terms = PoeditTranslationTerms.FromString(poString);
// From a byte array (UTF-8 encoded PO string)
PoeditTranslationTerms terms = PoeditTranslationTerms.FromBytes(poData);
// From a POCatalog
PoeditTranslationTerms terms = new(poCatalog);
The created terms
instance can be used for the wan24-Core
Translation
.
Please refer to the wan24-Core
documentation for more details about that.
Creating a PO file from source code
This library only contains PO reading helpers for working with the
wan24-Core
translation helpers. For creating a PO file you might want to use
the dotnet tool
wan24-PoeditParser, which is
able to parse C# source code (and any other source language code) and create a
PO file, which can be used with Poedit. Also the wan24-PoeditParser
can be
used as custom extractor for the Poedit GUI.