Back: I18N.LcMessagesCatalog Up: Iconv/I18N packages Forward: I18N.LcMessagesDomain class-opening MO files   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

5.12 I18N.LcMessagesDomain

Defined in namespace I18N
Superclass: I18N.LocaleData
Category: i18n-Messages
This object is an abstract superclass for message domains (catalogs). It contains methods to create instances of its subclasses, but they are commonly used only by LcMessages.

Translations are accessed using either #at: or the shortcut binary messages `?'. This way, common idioms to access translated strings will be

string := NLS? 'abc'. string := self? 'abc'.

(in the first case NLS is a class variable, in the second the receiver implements #? through delegation) which is only five or six characters longer than the traditional

string := 'abc'.

(cfr. the _("abc") idiom used by GNU gettext)

5.12.1 I18N.LcMessagesDomain class: opening MO files  (class)
5.12.2 I18N.LcMessagesDomain: handling the cache  (instance)
5.12.3 I18N.LcMessagesDomain: querying  (instance)


5.12.1 I18N.LcMessagesDomain class: opening MO files

id: anArray on: aFileName
Create an instance of the receiver with a given locale identifier from a path to the MO file


5.12.2 I18N.LcMessagesDomain: handling the cache

flush
Flush the receiver's cache of translations

shouldCache
Answer whether translations should be cached. Never override this method to always answer false, because that would cause bugs when transliteration is being used.


5.12.3 I18N.LcMessagesDomain: querying

? aString
Answer the translation of `aString', or answer aString itself if none is available.

at: aString
Answer the translation of `aString', or answer aString itself if none is available.

at: singularString plural: pluralString with: n
Answer either the translation of pluralString with `%1' replaced by n if n ~= 1, or the translation of singularString if n = 1.

at: aString put: anotherString
This method should not be called for instances of this class.

translatorInformation
Answer information on the translation, or nil if there is none. This information is stored as the `translation' of an empty string.

translatorInformationAt: key
Answer information on the translation associated to a given key

translatorInformationAt: key at: subkey
Answer information on the translation associated to a given key and to a subkey of the key



Back: I18N.LcMessagesDomain-handling the cache Up: I18N.LcMessagesDomain Forward: I18N.LcMessagesDummyDomain   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on April, 16 2013 using texi2html