The Translation Domain utility
This interface provides methods for translating text, including text with interpolation.
When we refer to text here, we mean text that follows the standard Zope 3 text representation.
The domain is used to specify which translation to use. Different products will often use a specific domain naming translations supplied with the product.
A favorite example is: How do you translate Sun
? Is it our star, the
abbreviation of Sunday or the company? Specifying the domain, such as
Stars
or DaysOfWeek
will solve this problem for us.
Also note that language tags are defined by RFC 1766.
domain
*
-
TextLine
(default =
None
)
The name of the domain this object represents.
* = required
translate(msgid, mapping=None, context=None, target_language=None, default=None)
Return the translation for the message referred to by msgid.
Return the default if no translation is found.
However, the method does a little more than a vanilla translation. The method also looks for a possible language to translate to. After a translation it also replaces any $name variable variables inside the post-translation string.
There are no specific adapters registered for this interface.
There are no extended adapters registered for this interface.