C# Class Serenity.Localization.JsonLocalTextRegistration

Contains helper methods for registration of local texts in hierarchical/dictionary formatted JSON files.
Exibir arquivo Open project: volkanceylan/Serenity

Public Methods

Method Description
AddFromFilesInFolder ( string path, ILocalTextRegistry registry = null ) : void
AddFromNestedDictionary ( JToken>.IDictionary nested, string prefix, string languageID, ILocalTextRegistry registry = null ) : void

Adds translation from a hierarchical local text dictionary parsed from JSON file.

AddJsonTexts ( this registry, string path ) : void

Adds translations from JSON files at specified path. File names in this directory should be in format {anyprefix}.{languageID}.json where {languageID} is a language code like 'en', 'en-GB' etc.

ProcessNestedDictionary ( JToken>.IDictionary nested, string prefix, string>.Dictionary target ) : void

Converts translation from a hierarchical local text dictionary to a simple dictionary.

Method Details

AddFromFilesInFolder() public static method

public static AddFromFilesInFolder ( string path, ILocalTextRegistry registry = null ) : void
path string
registry ILocalTextRegistry
return void

AddFromNestedDictionary() public static method

Adds translation from a hierarchical local text dictionary parsed from JSON file.
public static AddFromNestedDictionary ( JToken>.IDictionary nested, string prefix, string languageID, ILocalTextRegistry registry = null ) : void
nested JToken>.IDictionary Object parsed from local text JSON string
prefix string Prefix to prepend before local text keys
languageID string Language ID
registry ILocalTextRegistry Registry
return void

AddJsonTexts() public static method

Adds translations from JSON files at specified path. File names in this directory should be in format {anyprefix}.{languageID}.json where {languageID} is a language code like 'en', 'en-GB' etc.
public static AddJsonTexts ( this registry, string path ) : void
registry this Registry
path string Path containing JSON files
return void

ProcessNestedDictionary() public static method

Converts translation from a hierarchical local text dictionary to a simple dictionary.
public static ProcessNestedDictionary ( JToken>.IDictionary nested, string prefix, string>.Dictionary target ) : void
nested JToken>.IDictionary Object parsed from local text JSON string
prefix string Prefix to prepend before local text keys
target string>.Dictionary Target dictionary that will contain keys and translations
return void