Table of Contents

Class JsonParser

Namespace
Tlumach.Base
Assembly
Tlumach.Base.dll

The parser for simpler JSON translation files.

public class JsonParser : BaseJsonParser
Inheritance
JsonParser
Inherited Members

Properties

TextProcessingMode

Gets or sets the text processing mode to use when decoding potentially escaped strings and when recognizing template strings in translation entries.

public static TextFormat TextProcessingMode { get; set; }

Property Value

TextFormat

Methods

CanHandleExtension(string)

Checks whether this parser can handle a translation file with the given extension.

This method is not used for configuration files.

public override bool CanHandleExtension(string fileExtension)

Parameters

fileExtension string

The extension to check.

Returns

bool

true if the extension is supported and false otherwise.

GetTextProcessingMode()

Used for internal needs.

protected override TextFormat GetTextProcessingMode()

Returns

TextFormat

The effective text processing mode.

InternalLoadTranslationEntriesFromJSON(JsonElement, Translation?, string, TextFormat?)

protected override Translation InternalLoadTranslationEntriesFromJSON(JsonElement jsonObj, Translation? translation, string groupName, TextFormat? textProcessingMode)

Parameters

jsonObj JsonElement
translation Translation
groupName string
textProcessingMode TextFormat?

Returns

Translation

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

content string

The content to parse.

textProcessingMode TextFormat?

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.

Use()

Initializes the parser class, making it available for use.

public static void Use()