diff options
Diffstat (limited to 'ironicclient/common/i18n.py')
-rw-r--r-- | ironicclient/common/i18n.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ironicclient/common/i18n.py b/ironicclient/common/i18n.py index 90f289a..2561853 100644 --- a/ironicclient/common/i18n.py +++ b/ironicclient/common/i18n.py @@ -13,9 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. -import oslo_i18n +try: + import oslo_i18n +except ImportError: + def _(msg): + return msg +else: + _translators = oslo_i18n.TranslatorFactory(domain='ironicclient') -_translators = oslo_i18n.TranslatorFactory(domain='ironicclient') - -# The primary translation function using the well-known name "_" -_ = _translators.primary + # The primary translation function using the well-known name "_" + _ = _translators.primary |