www.delorie.com/gnu/docs/gettext/gettext_219.html   search  
 
Buy GNU books!


GNU gettext utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.5.4 Python

RPMs
python

File extension
py

String syntax
'abc', u'abc', r'abc', ur'abc',
"abc", u"abc", r"abc", ur"abc",
"'abc"', u"'abc"', r"'abc"', ur"'abc"',
"""abc""", u"""abc""", r"""abc""", ur"""abc"""

gettext shorthand
_('abc') etc.

gettext/ngettext functions
gettext.gettext, gettext.dgettext, also ugettext

textdomain
gettext.textdomain function, or gettext.install(domain) function

bindtextdomain
gettext.bindtextdomain function, or gettext.install(domain,localedir) function

setlocale
not used by the gettext emulation

Prerequisite
import gettext

Use or emulate GNU gettext
emulate. Bug: uses only the first found .mo file, not all of them

Extractor
xgettext

Formatting with positions
'...%(ident)d...' % { 'ident': value }

Portability
fully portable

po-mode marking
---


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003