Class Translation
Contains translation entries that belong to one locale. Each entry is identified by the unique key, which is composed of the key name and the names of all its parent group names joined by dot ".", e.g., "group.subgroup.key". Key names are stored without case conversion but are searched for in a case-insensitive manner.
public class Translation : Dictionary<string, TranslationEntry>, IDictionary<string, TranslationEntry>, ICollection<KeyValuePair<string, TranslationEntry>>, IReadOnlyDictionary<string, TranslationEntry>, IReadOnlyCollection<KeyValuePair<string, TranslationEntry>>, IEnumerable<KeyValuePair<string, TranslationEntry>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable
- Inheritance
-
Translation
- Implements
- Inherited Members
Constructors
Translation(string?, string?)
Initializes a new instance of the Translation class.
public Translation(string? locale, string? context = null)
Parameters
localestringAn optional locale if one was specified in the translation file.
contextstringAn optional value of the Context property if one was specified in the translation file.
Properties
Author
May contain the value of the @@author key of an ARB file.
public string? Author { get; set; }
Property Value
Context
Contains the context of the file, from which the translation was loaded, if this context was specified in the file. Contexts are specified in ARB files and are supported and preserved by Tlumach converters.
public string? Context { get; }
Property Value
CustomProperties
Gets the container that stores custom properties of an ARB file.
public Dictionary<string, string> CustomProperties { get; }
Property Value
IsBasicCulture
Gets or sets the indicator that the translation belongs to the "basic" culture. Basic cultures are the ones to which neutral cultures resolve. E.g.: "de-DE" is the basic culture for "de-AT" because "de" resolves to specific culture "de-DE".
public bool IsBasicCulture { get; set; }
Property Value
LastModified
May contain the value of the @@last_modified key of an ARB file.
public DateTime? LastModified { get; set; }
Property Value
Locale
Contains the locale of the file, from which the translation was loaded, if this locale was specified in the file.
public string? Locale { get; }
Property Value
OriginalAssembly
Optionally contains a reference to the assembly, from which the translation was loaded.
public Assembly? OriginalAssembly { get; }
Property Value
OriginalFile
Optionally contains the path to the original file, from which the translation was loaded.
public string? OriginalFile { get; }
Property Value
Methods
SetOrigin(Assembly?, string?)
Sets the source of the translation.
public Translation SetOrigin(Assembly? originalAssembly, string? originalFile)
Parameters
originalAssemblyAssemblymay specify an assembly if the translation was loaded from assembly resources.
originalFilestringmay specify the file if the translation was loaded from a file (and not obtained via the event).
Returns
- Translation
The object, for which the method was called.