Skip to content

Commit baad3c8

Browse files
committed
Ground work for transifex-ify ceilometer.
Following http://wiki.openstack.org/Translations to integrate transifex translation into ceilometer and to fix bug 1082805. This is the ground work to enable translation jobs using transifex and Jenkin's in ceilometer. We added the empty file ceilometer/locale/ceilometer.pot to avoid the failure of the Jenkin' translation-jobs because git doesn't allow empty directory to be added into the repository. We still need to do the following things once this patch gets accepted: 1. Make the transifex ceilometer project (https://www.transifex.com/projects/p/ceilometer/) as part of the openstack transifex project hub and give access to the transifex openstack Jenkins account. 2. Add the translation-jobs into openstack/openstack-ci-puppet for ceilometer. 3. Recheck and/or clean the LOG.foobar strings in ceilometer so that only the useful and necessary strings would be extracted into the .pot file. NOTE: 1. Don't use '_' as the variable name for "don't care", since it clashes with gettext module. 2. Wrap the string with the underscore function to make it ready for translation, e.g. internationalized_string = _("I'm internationalized!") LOG.debug(_('I speak the language of %(language)s'), locals()) Change-Id: I9732e424b374afa8f0650baf4e3537109e7520d1
1 parent 07eaed2 commit baad3c8

7 files changed

Lines changed: 38 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ dist
1313
*.egg
1414
ceilometer/versioninfo
1515
doc/source/api/*.rst
16+
*.mo

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ exclude .gitreview
66

77
global-exclude *.pyc
88
recursive-include public *
9+
recursive-include ceilometer/locale *

babel.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[python: **.py]
2+

ceilometer/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright 2012 Intel Corp.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
# not use this file except in compliance with the License. You may obtain
6+
# a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
#
16+
17+
import gettext
18+
19+
gettext.install('ceilometer', unicode=1)

ceilometer/locale/ceilometer.pot

Whitespace-only changes.

setup.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@ where=tests
1111
all_files = 1
1212
build-dir = doc/build
1313
source-dir = doc/source
14+
15+
[extract_messages]
16+
keywords = _ gettext ngettext l_ lazy_gettext
17+
mapping_file = babel.cfg
18+
output_file = ceilometer/locale/ceilometer.pot
19+
20+
[compile_catalog]
21+
directory = ceilometer/locale
22+
domain = ceilometer
23+
24+
[update_catalog]
25+
domain = ceilometer
26+
output_dir = ceilometer/locale
27+
input_file = ceilometer/locale/ceilometer.pot

tools/test-requires

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ coverage
33
pep8>=1.0
44
mock
55
mox
6+
Babel>=0.9.6
67
# NOTE(dhellmann): Ming is necessary to provide the Mongo-in-memory
78
# implementation of MongoDB. The original source for Ming is at
89
# http://sourceforge.net/project/merciless but there does not seem to

0 commit comments

Comments
 (0)