This commit is contained in:
Kovid Goyal 2009-01-21 15:48:09 -08:00
parent 1e46683819
commit 223c36f20b
2 changed files with 3 additions and 4 deletions

View File

@ -29,5 +29,5 @@ def server_config(defaults=None):
c.add_opt('develop', ['--develop'], default=False, c.add_opt('develop', ['--develop'], default=False,
help='Development mode. Server automatically restarts on file changes and serves code files (html, css, js) from the file system instead of calibre\'s resource system.') help='Development mode. Server automatically restarts on file changes and serves code files (html, css, js) from the file system instead of calibre\'s resource system.')
c.add_opt('max_cover', ['--max-cover'], default='600x800', c.add_opt('max_cover', ['--max-cover'], default='600x800',
help=_('The maximum size for displayed covers')) help=_('The maximum size for displayed covers. Default is %default.'))
return c return c

View File

@ -5,9 +5,8 @@ Dynamic language lookup of translations for user-visible strings.
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>' __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import sys
from cStringIO import StringIO from cStringIO import StringIO
from gettext import GNUTranslations, NullTranslations from gettext import GNUTranslations
from calibre.translations.compiled import translations from calibre.translations.compiled import translations
__all__ = ['translate'] __all__ = ['translate']
@ -23,5 +22,5 @@ def translate(lang, text):
trans = GNUTranslations(buf) trans = GNUTranslations(buf)
_CACHE[lang] = trans _CACHE[lang] = trans
if trans is None: if trans is None:
return _(text) return getattr(__builtins__, '_', lambda x: x)(text)
return trans.ugettext(text) return trans.ugettext(text)