Class BaseJsonParser
The base parser for JSON-formatted configuration and translation files.
Inheritance
BaseJsonParser
Assembly: Tlumach.Base.dll
Syntax
public abstract class BaseJsonParser : BaseParser
Properties
LocaleSeparatorChar
Gets or sets the character that is used to separate the locale name from the base name in the names of locale-specific translation files.
Declaration
public static char LocaleSeparatorChar { get; set; }
Property Value
Methods
GetLocaleSeparatorChar()
Declaration
public override char GetLocaleSeparatorChar()
Returns
Overrides
InternalLoadTranslationEntriesFromJSON(JsonElement, Translation?, string)
Declaration
protected abstract Translation InternalLoadTranslationEntriesFromJSON(JsonElement jsonObj, Translation? translation, string groupName)
Parameters
Returns
InternalLoadTranslationStructure(string)
Loads the keys from the default translation file and builds a tree of keys.
Declaration
protected override TranslationTree? InternalLoadTranslationStructure(string content)
Parameters
| Type |
Name |
Description |
| string |
content |
The content to parse.
|
Returns
Overrides
Exceptions
| Type |
Condition |
| TextParseException |
Gets thrown when parsing of a default translation file fails.
|
LoadTranslation(string, CultureInfo?)
Loads the translation information from the file and returns a translation.
Declaration
public override Translation? LoadTranslation(string translationText, CultureInfo? culture)
Parameters
| Type |
Name |
Description |
| string |
translationText |
The text of the file to load.
|
| CultureInfo |
culture |
An optional reference to the locale, whose translation is to be loaded. Makes sense for CSV and TSV formats that may contain multiple translations in one file.
|
Returns
| Type |
Description |
| Translation |
The loaded translation or null if loading failed.
|
Overrides
ParseConfiguration(string, Assembly?)
Declaration
public override TranslationConfiguration? ParseConfiguration(string fileContent, Assembly? assembly)
Parameters
Returns
Overrides
ShouldSkipObjectProperty(string)
Declaration
protected virtual bool? ShouldSkipObjectProperty(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns
ShouldSkipStringProperty(string)
Declaration
protected virtual bool? ShouldSkipStringProperty(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns