blob: 5bbc77d3b3705551f2921a95ad34f26deaa2b32b [file] [log] [blame]
Davanum Srinivasd4f1b9a2014-11-04 08:40:59 +01001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13"""oslo.i18n integration module.
14
15See http://docs.openstack.org/developer/oslo.i18n/usage.html
16
17"""
18
19try:
Doug Hellmann583ce2c2015-03-11 14:55:46 +000020 import oslo_i18n
Davanum Srinivasd4f1b9a2014-11-04 08:40:59 +010021
22 # NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
23 # application name when this module is synced into the separate
24 # repository. It is OK to have more than one translation function
25 # using the same domain, since there will still only be one message
26 # catalog.
Doug Hellmann583ce2c2015-03-11 14:55:46 +000027 _translators = oslo_i18n.TranslatorFactory(domain='tempest')
Davanum Srinivasd4f1b9a2014-11-04 08:40:59 +010028
29 # The primary translation function using the well-known name "_"
30 _ = _translators.primary
31
32 # Translators for log levels.
33 #
34 # The abbreviated names are meant to reflect the usual use of a short
35 # name like '_'. The "L" is for "log" and the other letter comes from
36 # the level.
37 _LI = _translators.log_info
38 _LW = _translators.log_warning
39 _LE = _translators.log_error
40 _LC = _translators.log_critical
41except ImportError:
42 # NOTE(dims): Support for cases where a project wants to use
Doug Hellmann583ce2c2015-03-11 14:55:46 +000043 # code from oslo-incubator, but is not ready to be internationalized
Davanum Srinivasd4f1b9a2014-11-04 08:40:59 +010044 # (like tempest)
45 _ = _LI = _LW = _LE = _LC = lambda x: x