C# 클래스 NGettext.Catalog

Represents a Gettext catalog instance. Loads translations from gettext *.mo files.
상속: NGettext.BaseCatalog
파일 보기 프로젝트 열기: neris/NGettext 1 사용 예제들

공개 메소드들

메소드 설명
Catalog ( ) : System

Initializes a new instance of the Catalog class that has no translations using the current UI culture info and plural rule generated by DefaultPluralRuleGenerator for the current UI culture.

Catalog ( CultureInfo cultureInfo ) : System

Initializes a new instance of the Catalog class that has no translations using given culture info and plural rule generated by DefaultPluralRuleGenerator for given culture.

Catalog ( ILoader loader ) : System

Initializes a new instance of the Catalog class using the current UI culture info and loads data using given loader.

Catalog ( ILoader loader, CultureInfo cultureInfo ) : System

Initializes a new instance of the Catalog class using given culture info and loads data using given loader.

Catalog ( Stream moStream ) : System

Initializes a new instance of the Catalog class using the current UI culture info and loads data from specified stream using a new MoLoader instance.

Catalog ( Stream moStream, CultureInfo cultureInfo ) : System

Initializes a new instance of the Catalog class using given culture info and loads data from specified stream using a new MoLoader instance.

Catalog ( string domain, string localeDir ) : System

Initializes a new instance of the Catalog class using the current UI culture info and loads data for specified domain and locale directory using a new MoLoader instance.

Catalog ( string domain, string localeDir, CultureInfo cultureInfo ) : System

Initializes a new instance of the Catalog class using given culture info and loads data for specified domain and locale directory using a new MoLoader instance.

GetParticularPluralString ( string context, string text, string pluralText, long n ) : string

Returns the plural form for n of the translation of text using given context. Similar to npgettext function.

GetParticularString ( string context, string text ) : string

Returns text translated into the selected language using given context. Similar to pgettext function.

GetPluralString ( string text, string pluralText, long n ) : string

Returns the plural form for n of the translation of text. Similar to ngettext function.

GetPluralStringDefault ( string messageId, string defaultMessage, string defaultPluralMessage, long n ) : string

Returns translated plural string for given messageId or defaultMessage or defaultPluralMessage on fail.

GetString ( string text ) : string

Returns text translated into the selected language. Similar to gettext function.

GetStringDefault ( string messageId, string defaultMessage ) : string

Returns translated string for given messageId or defaultMessage on fail.

GetTranslations ( string messageId ) : string[]

Returns all translations for given messageId.

Load ( ILoader loader ) : void

Loads data to the current catalog using specified loader instance.

메소드 상세

Catalog() 공개 메소드

Initializes a new instance of the Catalog class that has no translations using the current UI culture info and plural rule generated by DefaultPluralRuleGenerator for the current UI culture.
public Catalog ( ) : System
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class that has no translations using given culture info and plural rule generated by DefaultPluralRuleGenerator for given culture.
public Catalog ( CultureInfo cultureInfo ) : System
cultureInfo System.Globalization.CultureInfo Culture info.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using the current UI culture info and loads data using given loader.
public Catalog ( ILoader loader ) : System
loader ILoader Loader instance.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using given culture info and loads data using given loader.
public Catalog ( ILoader loader, CultureInfo cultureInfo ) : System
loader ILoader Loader instance.
cultureInfo System.Globalization.CultureInfo Culture info.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using the current UI culture info and loads data from specified stream using a new MoLoader instance.
public Catalog ( Stream moStream ) : System
moStream Stream Stream that contain binary data in the MO file format.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using given culture info and loads data from specified stream using a new MoLoader instance.
public Catalog ( Stream moStream, CultureInfo cultureInfo ) : System
moStream Stream Stream that contain binary data in the MO file format.
cultureInfo System.Globalization.CultureInfo Culture info.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using the current UI culture info and loads data for specified domain and locale directory using a new MoLoader instance.
public Catalog ( string domain, string localeDir ) : System
domain string Catalog domain name.
localeDir string Directory that contains gettext localization files.
리턴 System

Catalog() 공개 메소드

Initializes a new instance of the Catalog class using given culture info and loads data for specified domain and locale directory using a new MoLoader instance.
public Catalog ( string domain, string localeDir, CultureInfo cultureInfo ) : System
domain string Catalog domain name.
localeDir string Directory that contains gettext localization files.
cultureInfo System.Globalization.CultureInfo Culture info.
리턴 System

GetParticularPluralString() 공개 메소드

Returns the plural form for n of the translation of text using given context. Similar to npgettext function.
public GetParticularPluralString ( string context, string text, string pluralText, long n ) : string
context string Context.
text string Singular form of message to translate.
pluralText string Plural form of message to translate.
n long Value that determines the plural form.
리턴 string

GetParticularString() 공개 메소드

Returns text translated into the selected language using given context. Similar to pgettext function.
public GetParticularString ( string context, string text ) : string
context string Context.
text string Text to translate.
리턴 string

GetPluralString() 공개 메소드

Returns the plural form for n of the translation of text. Similar to ngettext function.
public GetPluralString ( string text, string pluralText, long n ) : string
text string Singular form of message to translate.
pluralText string Plural form of message to translate.
n long Value that determines the plural form.
리턴 string

GetPluralStringDefault() 공개 메소드

Returns translated plural string for given messageId or defaultMessage or defaultPluralMessage on fail.
public GetPluralStringDefault ( string messageId, string defaultMessage, string defaultPluralMessage, long n ) : string
messageId string Message ID
defaultMessage string Default message singular form
defaultPluralMessage string Default message plural form
n long Value that determines the plural form
리턴 string

GetString() 공개 메소드

Returns text translated into the selected language. Similar to gettext function.
public GetString ( string text ) : string
text string Text to translate.
리턴 string

GetStringDefault() 공개 메소드

Returns translated string for given messageId or defaultMessage on fail.
public GetStringDefault ( string messageId, string defaultMessage ) : string
messageId string Message ID
defaultMessage string Default message
리턴 string

GetTranslations() 공개 메소드

Returns all translations for given messageId.
public GetTranslations ( string messageId ) : string[]
messageId string
리턴 string[]

Load() 공개 메소드

Loads data to the current catalog using specified loader instance.
public Load ( ILoader loader ) : void
loader ILoader Loader instance.
리턴 void