diff --git a/.gitignore b/.gitignore index 03506f39..8336faa9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ dist *.egg ceilometer/versioninfo doc/source/api/*.rst +*.mo diff --git a/MANIFEST.in b/MANIFEST.in index 9c8ae9ee..06333841 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,4 @@ exclude .gitreview global-exclude *.pyc recursive-include public * +recursive-include ceilometer/locale * diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..15cd6cb7 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,2 @@ +[python: **.py] + diff --git a/ceilometer/__init__.py b/ceilometer/__init__.py index e69de29b..9ed525a3 100644 --- a/ceilometer/__init__.py +++ b/ceilometer/__init__.py @@ -0,0 +1,19 @@ +# +# Copyright 2012 Intel Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +import gettext + +gettext.install('ceilometer', unicode=1) diff --git a/ceilometer/locale/ceilometer.pot b/ceilometer/locale/ceilometer.pot new file mode 100644 index 00000000..e69de29b diff --git a/setup.cfg b/setup.cfg index d8b5960b..68f85d6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,3 +11,17 @@ where=tests all_files = 1 build-dir = doc/build source-dir = doc/source + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = ceilometer/locale/ceilometer.pot + +[compile_catalog] +directory = ceilometer/locale +domain = ceilometer + +[update_catalog] +domain = ceilometer +output_dir = ceilometer/locale +input_file = ceilometer/locale/ceilometer.pot diff --git a/tools/test-requires b/tools/test-requires index 607a005c..b577956c 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -3,6 +3,7 @@ coverage pep8>=1.0 mock mox +Babel>=0.9.6 # NOTE(dhellmann): Ming is necessary to provide the Mongo-in-memory # implementation of MongoDB. The original source for Ming is at # http://sourceforge.net/project/merciless but there does not seem to