C# Class NGettext.Loaders.MoLoader

A catalog loader that loads data from files in the GNU/Gettext MO file format.
Inheritance: ILoader
Mostra file Open project: neris/NGettext

Public Methods

Method Description
Load ( Catalog catalog ) : void

Loads translations to the specified catalog using catalog's culture info.

MoLoader ( Stream moStream ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.

MoLoader ( Stream moStream, IPluralRuleGenerator pluralRuleGenerator ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.

MoLoader ( Stream moStream, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.

MoLoader ( Stream moStream, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.

MoLoader ( string filePath ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.

MoLoader ( string filePath, IPluralRuleGenerator pluralRuleGenerator ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.

MoLoader ( string filePath, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.

MoLoader ( string filePath, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.

MoLoader ( string domain, string localeDir ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.

MoLoader ( string domain, string localeDir, IPluralRuleGenerator pluralRuleGenerator ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.

MoLoader ( string domain, string localeDir, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.

MoLoader ( string domain, string localeDir, MoFileParser parser ) : System

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.

Protected Methods

Method Description
FindTranslationFile ( CultureInfo cultureInfo, string domain, string localeDir ) : string

Finds corresponding translation file using specified culture info, domain and a locale directory.

GetFileName ( string localeDir, string domain, string locale ) : string

Constructs a standard path to the MO translation file using specified path to the locale directory, domain and locale's TwoLetterISOLanguageName string.

Load ( MoFile parsedMoFile, Catalog catalog ) : void

Loads translations to the specified catalog using specified MO file parser.

Load ( Stream moStream, Catalog catalog ) : void

Loads translations to the specified catalog from specified MO file stream.

Load ( string filePath, Catalog catalog ) : void

Loads translations to the specified catalog from specified MO file path.

Load ( string domain, string localeDir, Catalog catalog ) : void

Loads translations to the specified catalog using catalog's culture info from specified locale directory and specified domain.

Method Details

FindTranslationFile() protected method

Finds corresponding translation file using specified culture info, domain and a locale directory.
protected FindTranslationFile ( CultureInfo cultureInfo, string domain, string localeDir ) : string
cultureInfo System.Globalization.CultureInfo
domain string
localeDir string
return string

GetFileName() protected method

Constructs a standard path to the MO translation file using specified path to the locale directory, domain and locale's TwoLetterISOLanguageName string.
protected GetFileName ( string localeDir, string domain, string locale ) : string
localeDir string
domain string
locale string
return string

Load() public method

Loads translations to the specified catalog using catalog's culture info.
public Load ( Catalog catalog ) : void
catalog Catalog A catalog instance to load translations to.
return void

Load() protected method

Loads translations to the specified catalog using specified MO file parser.
protected Load ( MoFile parsedMoFile, Catalog catalog ) : void
parsedMoFile MoFile
catalog Catalog
return void

Load() protected method

Loads translations to the specified catalog from specified MO file stream.
protected Load ( Stream moStream, Catalog catalog ) : void
moStream Stream
catalog Catalog
return void

Load() protected method

Loads translations to the specified catalog from specified MO file path.
protected Load ( string filePath, Catalog catalog ) : void
filePath string
catalog Catalog
return void

Load() protected method

Loads translations to the specified catalog using catalog's culture info from specified locale directory and specified domain.
protected Load ( string domain, string localeDir, Catalog catalog ) : void
domain string
localeDir string
catalog Catalog
return void

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.
public MoLoader ( Stream moStream ) : System
moStream Stream
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.
public MoLoader ( Stream moStream, IPluralRuleGenerator pluralRuleGenerator ) : System
moStream Stream
pluralRuleGenerator IPluralRuleGenerator
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.
public MoLoader ( Stream moStream, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System
moStream Stream
pluralRuleGenerator IPluralRuleGenerator
parser MoFileParser
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified stream.
public MoLoader ( Stream moStream, MoFileParser parser ) : System
moStream Stream
parser MoFileParser
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.
public MoLoader ( string filePath ) : System
filePath string
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.
public MoLoader ( string filePath, IPluralRuleGenerator pluralRuleGenerator ) : System
filePath string
pluralRuleGenerator IPluralRuleGenerator
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.
public MoLoader ( string filePath, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System
filePath string
pluralRuleGenerator IPluralRuleGenerator
parser MoFileParser
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file from the specified path.
public MoLoader ( string filePath, MoFileParser parser ) : System
filePath string
parser MoFileParser
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.
public MoLoader ( string domain, string localeDir ) : System
domain string
localeDir string
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.
public MoLoader ( string domain, string localeDir, IPluralRuleGenerator pluralRuleGenerator ) : System
domain string
localeDir string
pluralRuleGenerator IPluralRuleGenerator
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.
public MoLoader ( string domain, string localeDir, IPluralRuleGenerator pluralRuleGenerator, MoFileParser parser ) : System
domain string
localeDir string
pluralRuleGenerator IPluralRuleGenerator
parser MoFileParser
return System

MoLoader() public method

Initializes a new instance of the MoLoader class which will try to load a MO file that will be located in the localeDir using the domain name and catalog's culture info.
public MoLoader ( string domain, string localeDir, MoFileParser parser ) : System
domain string
localeDir string
parser MoFileParser
return System