Davanum Srinivas | d4f1b9a | 2014-11-04 08:40:59 +0100 | [diff] [blame] | 1 | # 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 | |
| 15 | See http://docs.openstack.org/developer/oslo.i18n/usage.html |
| 16 | |
| 17 | """ |
| 18 | |
| 19 | try: |
Doug Hellmann | 583ce2c | 2015-03-11 14:55:46 +0000 | [diff] [blame] | 20 | import oslo_i18n |
Davanum Srinivas | d4f1b9a | 2014-11-04 08:40:59 +0100 | [diff] [blame] | 21 | |
| 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 Hellmann | 583ce2c | 2015-03-11 14:55:46 +0000 | [diff] [blame] | 27 | _translators = oslo_i18n.TranslatorFactory(domain='tempest') |
Davanum Srinivas | d4f1b9a | 2014-11-04 08:40:59 +0100 | [diff] [blame] | 28 | |
| 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 |
| 41 | except ImportError: |
| 42 | # NOTE(dims): Support for cases where a project wants to use |
Doug Hellmann | 583ce2c | 2015-03-11 14:55:46 +0000 | [diff] [blame] | 43 | # code from oslo-incubator, but is not ready to be internationalized |
Davanum Srinivas | d4f1b9a | 2014-11-04 08:40:59 +0100 | [diff] [blame] | 44 | # (like tempest) |
| 45 | _ = _LI = _LW = _LE = _LC = lambda x: x |