Package common :: Module i18n
[hide private]
[frames] | no frames]

Module i18n

source code

Functions [hide private]
 
paragraph_direction_mark(text)
Determine paragraph writing direction according to http://www.unicode.org/reports/tr9/#The_Paragraph_Level
source code
 
Q_(text)
Translate the given text, optionally qualified with a special construction, which will help translators to disambiguate between same terms, but in different contexts.
source code
 
ngettext(s_sing, s_plural, n, replace_sing=None, replace_plural=None)
i18n.ngettext('leave room %s', 'leave rooms %s', len(rooms), 'a', 'a, b, c')
source code
Variables [hide private]
  APP = 'gajim'
  DIR = '../po'
  default_lang = locale.getdefaultlocale() [0]
  lang = locale.getdefaultlocale() [0]
  _translation = gettext.NullTranslations()

Imports: locale, gettext, os, defs, unicodedata


Function Details [hide private]

paragraph_direction_mark(text)

source code 

Determine paragraph writing direction according to http://www.unicode.org/reports/tr9/#The_Paragraph_Level

Returns either Unicode LTR mark or RTL mark.

Q_(text)

source code 

Translate the given text, optionally qualified with a special construction, which will help translators to disambiguate between same terms, but in different contexts.

When translated text is returned - this rudimentary construction will be stripped off, if it's present.

Here is the construction to use:
Q_("?vcard:Unknown")

Everything between ? and : - is the qualifier to convey the context to the translators. Everything after : - is the text itself.

ngettext(s_sing, s_plural, n, replace_sing=None, replace_plural=None)

source code 
Use as:
i18n.ngettext('leave room %s', 'leave rooms %s', len(rooms), 'a', 'a, b, c')

In other words this is a hack to ngettext() to support %s %d etc..


Variables Details [hide private]

APP

Value:
'gajim'

DIR

Value:
'../po'

default_lang

Value:
locale.getdefaultlocale() [0]

lang

Value:
locale.getdefaultlocale() [0]

_translation

Value:
gettext.NullTranslations()