C# Class Open.Core.Common.LocalizationExtensions

Extensions for performing localization on strings.
显示文件 Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
GetStringLibrary ( this assembly ) : ResourceManager

Gets the 'StringLibrary' resource for the given assembly.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

ToLocalString ( this key ) : string

Converts the given key to it's localized form.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

ToLocalString ( this key, Assembly assembly ) : string

Converts the given key to it's localized form.

This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.

Private Methods

Method Description
GetLocalStringValue ( string key, Assembly assembly ) : string

Method Details

GetStringLibrary() public static method

Gets the 'StringLibrary' resource for the given assembly.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static GetStringLibrary ( this assembly ) : ResourceManager
assembly this The assembly containing the resource.
return System.Resources.ResourceManager

ToLocalString() public static method

Converts the given key to it's localized form.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static ToLocalString ( this key ) : string
key this The key to lookup in the asset library.
return string

ToLocalString() public static method

Converts the given key to it's localized form.
This method assumes that the resource file is named 'StringLibrary.resx' (or standard regional variant, such as 'StringLibrary.de.resx' or 'StringLibrary.de-DE.resx') and placed within the project.
This can be placed anywhere within the project, but only one file with this name should be present.
public static ToLocalString ( this key, Assembly assembly ) : string
key this The key to lookup in the asset library.
assembly System.Reflection.Assembly The assembly to use as a content lookup.
return string