Language Class

Note: This API is now obsolete.
Used to be a class that made localization possible in a simple way, directly from .resx files. Use the LocalizationHelper or DynamicResourceManager classes instead.

Definition

Namespace: KGySoft.Libraries.Language
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
[ObsoleteAttribute("Use LocalizationHelper, or the DynamicResourceManager class from KGySoft.CoreLibraries instead")]
public static class Language
Inheritance
Object    Language

Remarks

  Caution

This class has been obsoleted. The way it worked was really non-professional: instead of looking up real keys from resources, it took the original untranslated terms and used them as keys to look them up in localized resources. To avoid conflicts, it supported so-called "distinction postfixes". Though it worked from .resx files, the system-provided culture hierarchy was omitted, only neutral (non-specific) cultures were supported. To overcome all these issues and still use .resx-based dynamically generated localizations you can use the LocalizationHelper class (recommended when you use the DynamicStringLocalization property of BaseForm or BaseUserControl classes), or the DynamicResourceManager class from the KGy SOFT Core Libraries package instead.

Properties

ActiveLanguage Gets or sets the currently used display language. When set, it used to save a single resource file of the previous language. Now it is redirected to get and set the DisplayLanguage property, which is now in the LanguageSettings class of the dependent KGy SOFT Core Libraries package.
Obsolete

Methods

FormatCaption Formats captions by capitalizing first letter and inserting spaces before capitals except in case of multiple capitals.
IsObjectLocalizable Gets whether an object is localizable. By default, an object is localizable. This can be changed either by making a type not localizable by LocalizableAttribute or by the MarkLocalizable(Boolean, Object) method, which works also at runtime.
IsPropertyLocalizable Gets whether a property is localizable. By default, a property is not localizable unless it is marked so by LocalizableAttribute.
MarkLocalizable Makes translation enabled or disabled for given objects.
SaveDictionary Saves the dictionary if ActiveLanguage is not the invariant culture.
Obsolete
Translate(String) Translates the given invariant text to the currently set ActiveLanguage.
Obsolete
Translate(String, Object) Translates the invariant text containing placeholders using the culture of currently set ActiveLanguage
Obsolete
Translate(CultureInfo, String, Object) Translates the invariant text containing placeholders to the currently set ActiveLanguage using the given culture.
Obsolete

Fields

DistinctionSeparator Indicates a distinction part of the string that will be removed on translation.
Obsolete

See Also