Class TranslationManager
Used to handle plugin translations.
Inheritance
Inherited Members
Namespace: Exiled.Loader
Assembly: Exiled.Loader.dll
Syntax
public static class TranslationManager
Methods
| Improve this Doc View SourceClear()
Clears the translations.
Declaration
public static bool Clear()
Returns
Type | Description |
---|---|
System.Boolean | Returns a value indicating whether translations have been cleared successfully or not. |
Load(String)
Loads all of the plugin's translations.
Declaration
public static SortedDictionary<string, ITranslation> Load(string rawTranslations)
Parameters
Type | Name | Description |
---|---|---|
System.String | rawTranslations | The raw translations to be loaded. |
Returns
Type | Description |
---|---|
System.Collections.Generic.SortedDictionary<System.String, ITranslation> | Returns a dictionary of loaded translations. |
LoadTranslation(IPlugin<IConfig>, Dictionary<String, Object>)
Loads the translations of a plugin based on the actual distribution.
Declaration
public static ITranslation LoadTranslation(this IPlugin<IConfig> plugin, Dictionary<string, object> rawTranslations = null)
Parameters
Type | Name | Description |
---|---|---|
IPlugin<IConfig> | plugin | The plugin which its translation has to be loaded. |
System.Collections.Generic.Dictionary<System.String, System.Object> | rawTranslations | The raw translations to check whether or not the plugin already has a translation config. |
Returns
Type | Description |
---|---|
ITranslation | The ITranslation of the desired plugin. |
Read()
Read all plugin translations.
Declaration
public static string Read()
Returns
Type | Description |
---|---|
System.String | Returns the read translations. |
Reload()
Reads, loads, and saves plugin translations.
Declaration
public static bool Reload()
Returns
Type | Description |
---|---|
System.Boolean | Returns a value indicating if the reloading process has been completed successfully or not. |
Save(SortedDictionary<String, ITranslation>)
Saves plugin translations.
Declaration
public static bool Save(SortedDictionary<string, ITranslation> translations)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.SortedDictionary<System.String, ITranslation> | translations | The translations to be saved. |
Returns
Type | Description |
---|---|
System.Boolean | Returns a value indicating whether the translations have been saved successfully or not. |
SaveDefaultTranslation(String)
Saves default distribution translations.
Declaration
public static bool SaveDefaultTranslation(string translations)
Parameters
Type | Name | Description |
---|---|---|
System.String | translations | The translations to be saved, already serialized in yaml format. |
Returns
Type | Description |
---|---|
System.Boolean | Returns a value indicating whether the translations have been saved successfully or not. |
SaveSeparatedTranslation(String, String)
Saves plugin translations based on the separated distribution.
Declaration
public static bool SaveSeparatedTranslation(this string pluginPrefix, string translations)
Parameters
Type | Name | Description |
---|---|---|
System.String | pluginPrefix | The prefix of the plugin which its translation is going to be saved. |
System.String | translations | The translations to be saved, already serialized in yaml format. |
Returns
Type | Description |
---|---|
System.Boolean | Returns a value indicating whether the translations have been saved successfully or not. |