Class Translation
- Namespace
- Dynamicweb.Rendering.Translation
- Assembly
- Dynamicweb.Core.dll
public class Translation
- Inheritance
-
Translation
- Inherited Members
Methods
GetTranslation(string, Design?)
Gets the translation.
public static string GetTranslation(string key, Design? design)
Parameters
Returns
- string
Translation or
keyif translation not found.
Remarks
The culture is current culture of frontend.
GetTranslation(string, CultureInfo, Design?)
Gets the translation.
public static string GetTranslation(string key, CultureInfo culture, Design? design)
Parameters
keystringThe key.
cultureCultureInfoThe culture.
designDesignThe design.
Returns
- string
Translation or
keyif translation not found.
GetTranslation(string, CultureInfo, KeyScope, Design?)
Gets the translation.
public static string GetTranslation(string key, CultureInfo culture, KeyScope scope, Design? design)
Parameters
keystringThe key.
cultureCultureInfoThe culture.
scopeKeyScopeThe scope.
designDesignThe design.
Returns
- string
Translation or
keyif translation not found.
GetTranslation(string, string, Design?)
Gets the translation.
public static string GetTranslation(string key, string cultureCode, Design? design)
Parameters
Returns
- string
Translation or
keyif translation not found.
GetTranslationKeys(KeyScope, Design?)
Gets the translation keys.
public static KeyCollection GetTranslationKeys(KeyScope scope, Design? design)
Parameters
Returns
- KeyCollection
The function returns a KeyCollection
Remarks
The scope parameter supports KeyScope.DesignsShared and KeyScope.DesignsLocal only.
If scope is KeyScope.DesignsShared set design parameter to null
Exceptions
- ArgumentException
designs only;scope
GetTranslations(string, KeyScope, Design?)
Gets the translations.
public static TranslationEntryCollection GetTranslations(string key, KeyScope scope, Design? design)
Parameters
Returns
- TranslationEntryCollection
The function returns a TranslationEntryCollection
Remarks
The scope parameter supports KeyScope.DesignsShared and KeyScope.DesignsLocal only.
If scope is KeyScope.DesignsShared set design parameter to null
Exceptions
- ArgumentException
designs only;scope
RemoveTranslation(string, KeyScope, Design?, string)
public static void RemoveTranslation(string key, KeyScope scope, Design? design, string cultureCode)
Parameters
SetTranslation(string, string, CultureInfo, KeyScope, Design?, string)
Sets the translation for given key and culture.
public static void SetTranslation(string key, string translation, CultureInfo culture, KeyScope scope, Design? design, string defaultValue)
Parameters
keystringThe key.
translationstringThe translation.
cultureCultureInfoThe culture.
scopeKeyScopeThe scope.
designDesigndefaultValuestring
Remarks
The scope parameter supports KeyScope.DesignsShared and KeyScope.DesignsLocal only.
If scope is KeyScope.DesignsShared the design set design parameter to null
To remove translation set translation parameter to null
Exceptions
- ArgumentException
designs only;scope
SetTranslation(string, string?, string, KeyScope, Design?, string)
Sets the translation for given key and culture.
public static void SetTranslation(string key, string? translation, string cultureCode, KeyScope scope, Design? design, string defaultValue)
Parameters
keystringThe key.
translationstringThe translation.
cultureCodestringThe culture code.
scopeKeyScopeThe scope.
designDesignThe design.
defaultValuestring
Remarks
The scope parameter supports KeyScope.DesignsShared and KeyScope.DesignsLocal only.
If scope is KeyScope.DesignsShared set design parameter to null
To remove translation set translation parameter to null
Exceptions
- ArgumentException
designs only;scope