Skip to main content

MultiLanguage

The MultiLanguage class represents a multilingual text structure, storing key-value pairs for different language cultures.

Properties

NameDescription
this[string culture]Gets or sets the word associated with a specific culture.

Constructors

NameDescription
MultiLanguage()Initializes a new instance of the MultiLanguage class with an empty dictionary.
MultiLanguage(words)Initializes a new instance of the MultiLanguage class from a dictionary.
MultiLanguage(dictionaryJson)Initializes a new instance of the MultiLanguage class from a JSON string.

Methods

NameDescription
GetWord(words)Merges a given dictionary of culture-word pairs into the existing collection. Updates existing words or adds new ones if the culture key is valid.
AddWord(culture, word)Adds a word for a specific culture if it does not already exist.
AsDictionary()Returns a copy of the internal dictionary of culture-word pairs.
ContainsKey(value, stringComparison)Checks if the dictionary contains a value that matches the given value.
Clone()Creates a deep copy of the MultiLanguage instance.
ContainsValue(value, stringComparison)Checks if the dictionary contains a value that matches the given value.
RemoveWord(culture)Removes the word associated with a given culture.
GetWord(culture, defaultCulture, defaultValue)Adds a word for a specific culture if it does not already exist.