Add translation support for evoque

https://wiki.openstack.org/wiki/Translations
https://wiki.openstack.org/wiki/Translations/Infrastructure

Later we can add ZANATA project for translation

Change-Id: Ida5c82bcfd129b3504f3650cbf0b4cbd3705291b
This commit is contained in:
lawrancejing 2015-11-09 13:59:56 +00:00 committed by Liuqing Jing
parent aceed3e4f1
commit 5af7ca5098
4 changed files with 24 additions and 10 deletions

0
evoque/locale/evoque.pot Normal file
View File

View File

@ -15,6 +15,8 @@ import socket
from oslo_config import cfg
from evoque.common.i18n import _
try:
default_workers = multiprocessing.cpu_count() or 1
@ -27,24 +29,23 @@ def list_opts():
("api", (
cfg.PortOpt('port',
default=8888,
help='The port for the Evoque API server.'),
help=_('The port for the Evoque API server.')),
cfg.StrOpt('host',
default='0.0.0.0',
help='The listen IP for the Evoque API server.'),
help=_('The listen IP for the Evoque API server.')),
cfg.BoolOpt('pecan_debug',
default=False,
help='Toggle Pecan Debug Middleware.'),
help=_('Toggle Pecan Debug Middleware.')),
cfg.IntOpt('workers', default=default_workers,
help='Number of workers for Evoque API server. '
'By default the available number of CPU is used.'),
help=_('Number of workers for Evoque API server.')),
cfg.IntOpt('max_limit',
default=1000,
help=('The maximum number of items returned in a '
'single response from a collection resource')),
help=_('The maximum number of items returned in a '
'single response from a collection resource')),
)),
("DEFAULT", (
cfg.StrOpt('host',
default=socket.getfqdn(),
help='The listen IP for the Evoque engine server.'),
help=_('The listen IP for the Evoque engine server.')),
)),
]

View File

@ -40,3 +40,17 @@ setup-hooks =
all_files = 1
build-dir = doc/build
source-dir = doc/source
[compile_catalog]
directory = evoque/locale
domain = evoque
[update_catalog]
domain = evoque
output_dir = sevoque/locale
input_file = evoque/locale/evoque.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = evoque/locale/evoque.pot

View File

@ -35,5 +35,4 @@ ignore = E711,E712,H404,H405
exclude = .venv,.git,.tox,dist,doc,etc,*lib/python*,*egg,build
[hacking]
import_exceptions =
evoque.i18n
import_exceptions = evoque.common.i18n