Class BaseJsonParser
The base parser for JSON-formatted configuration and translation files.
public abstract class BaseJsonParser : BaseParser
- Inheritance
-
BaseJsonParser
- Derived
- Inherited Members
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.
public static char LocaleSeparatorChar { get; set; }
Property Value
Methods
GetLocaleSeparatorChar()
Used for internal needs.
public override char GetLocaleSeparatorChar()
Returns
- char
The character, used to separate the base file name and the locale.
InternalLoadTranslationEntriesFromJSON(JsonElement, Translation?, string, TextFormat?)
protected abstract Translation InternalLoadTranslationEntriesFromJSON(JsonElement jsonObj, Translation? translation, string groupName, TextFormat? textProcessingMode)
Parameters
jsonObjJsonElementtranslationTranslationgroupNamestringtextProcessingModeTextFormat?
Returns
InternalLoadTranslationStructure(string, TextFormat?)
Loads the keys from the default translation file and builds a tree of keys.
protected override TranslationTree? InternalLoadTranslationStructure(string content, TextFormat? textProcessingMode)
Parameters
contentstringThe content to parse.
textProcessingModeTextFormat?The mode of processing of the text of the default file.
Returns
- TranslationTree
The constructed TranslationTree upon success or null otherwise.
Exceptions
- TextParseException
Gets thrown when parsing of a default translation file fails.
LoadTranslation(string, CultureInfo?, TextFormat?)
Loads the translation information from the file and returns a translation.
public override Translation? LoadTranslation(string translationText, CultureInfo? culture, TextFormat? textProcessingMode)
Parameters
translationTextstringThe text of the file to load.
cultureCultureInfoAn 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.
textProcessingModeTextFormat?The mode of processing of the text of the translation file.
Returns
- Translation
The loaded translation or null if loading failed.
ParseConfiguration(string, Assembly?)
public override TranslationConfiguration? ParseConfiguration(string fileContent, Assembly? assembly)
Parameters
Returns
ShouldSkipObjectProperty(string)
protected virtual bool? ShouldSkipObjectProperty(string key)
Parameters
keystring
Returns
- bool?
ShouldSkipStringProperty(string)
protected virtual bool? ShouldSkipStringProperty(string key)
Parameters
keystring
Returns
- bool?