Module GetText::TextDomainManager
In: lib/gettext/textdomain_manager.rb

Methods

Public Instance methods

bind textdomain to the class.

Set the value whether cache messages or not. true to cache messages, otherwise false.

Default is true. If $DEBUG is false, messages are not checked even if this value is true.

Return the cached value.

Gets the output charset.

Sets the output charset.The program can have a output charset.

Find textdomain by name

This function is similar to the get_singluar_message function as it finds the message catalogs in the same way. But it takes two extra arguments for plural form. The msgid parameter must contain the singular form of the string to be converted. It is also used as the key for the search in the catalog. The msgid_plural parameter is the plural form. The parameter n is used to determine the plural form. If no message catalog is found msgid1 is returned if n == 1, otherwise msgid2. And if msgid includes "div", it returns a last part of msgid separeted "div".

  • msgid: the singular form with "div". (e.g. "Special|An apple", "An apple")
  • msgid_plural: the plural form. (e.g. "%{num} Apples")
  • n: a number used to determine the plural form.
  • div: the separator. Default is "|".
  • Returns: the localized text which key is msgid_plural if n is plural(follow plural-rule) or msgid. "plural-rule" is defined in po-file.

or

  • [msgid, msgid_plural] : msgid and msgid_plural an Array
  • n: a number used to determine the plural form.
  • div: the separator. Default is "|".

Translates msgid, but if there are no localized text, it returns a last part of msgid separeted "div" or whole of the msgid with no "div".

  • msgid: the message id.
  • div: separator or nil.
  • Returns: the localized text by msgid. If there are no localized text, it returns a last part of msgid separeted "div".

[Validate]