From 1d2d8dce32a2557b9650b520a7974f9cbac5d6b0 Mon Sep 17 00:00:00 2001 From: YuikoTakada Date: Wed, 25 Feb 2015 04:11:33 +0000 Subject: [PATCH] Add scripts to manage translations Refer to: https://pythonhosted.org/WebCore/core/intermediate/i18n.html https://review.openstack.org/#/c/3888/ Partial-Bug: #1411272 Change-Id: Ib3e015a76189e58df82cd793952a792891209bc8 --- MANIFEST.in | 1 + babel.cfg | 1 + ironic_discoverd/common/i18n.py | 2 +- locale/ironic-discoverd.pot | 181 ++++++++++++++++++++++++++++++++ requirements.txt | 1 + setup.cfg | 13 +++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 babel.cfg create mode 100644 locale/ironic-discoverd.pot create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in index 92b782c58..9223219a0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,3 +7,4 @@ include plugin-requirements.txt include tox.ini include *.rst recursive-include functest * +recursive-include locale * diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 000000000..efceab818 --- /dev/null +++ b/babel.cfg @@ -0,0 +1 @@ +[python: **.py] diff --git a/ironic_discoverd/common/i18n.py b/ironic_discoverd/common/i18n.py index ac7cfef61..2b07a754a 100644 --- a/ironic_discoverd/common/i18n.py +++ b/ironic_discoverd/common/i18n.py @@ -15,7 +15,7 @@ import oslo_i18n -_translators = oslo_i18n.TranslatorFactory(domain='ironic_discoverd') +_translators = oslo_i18n.TranslatorFactory(domain='ironic-discoverd') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/locale/ironic-discoverd.pot b/locale/ironic-discoverd.pot new file mode 100644 index 000000000..d6926d255 --- /dev/null +++ b/locale/ironic-discoverd.pot @@ -0,0 +1,181 @@ +# Translations template for ironic-discoverd. +# Copyright (C) 2015 ORGANIZATION +# This file is distributed under the same license as the ironic-discoverd +# project. +# FIRST AUTHOR , 2015. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ironic-discoverd 1.1.0\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2015-03-02 02:49+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" + +#: ironic_discoverd/introspect.py:40 +msgid "IPMI credentials setup is disabled in configuration" +msgstr "" + +#: ironic_discoverd/introspect.py:44 +msgid "Node should be in maintenance mode to set IPMI credentials on it" +msgstr "" + +#: ironic_discoverd/introspect.py:51 +#, python-format +msgid "" +"Setting IPMI credentials requested for node %s, but neither new user name" +" nor driver_info[ipmi_username] are provided" +msgstr "" + +#: ironic_discoverd/introspect.py:58 +#, python-format +msgid "" +"Forbidden characters encountered in new IPMI password for node %(node)s: " +"\"%(chars)s\"; use only letters and numbers" +msgstr "" + +#: ironic_discoverd/introspect.py:63 +#, python-format +msgid "IPMI password length should be > 0 and <= %d" +msgstr "" + +#: ironic_discoverd/introspect.py:81 +#, python-format +msgid "Cannot find node %s" +msgstr "" + +#: ironic_discoverd/introspect.py:83 +#, python-format +msgid "Cannot get node %(node)s: %(exc)s" +msgstr "" + +#: ironic_discoverd/introspect.py:89 +#, python-format +msgid "" +"Refusing to introspect node %(node)s with provision state \"%(state)s\" " +"and maintenance mode off" +msgstr "" + +#: ironic_discoverd/introspect.py:96 +#, python-format +msgid "" +"Refusing to introspect node %(node)s with power state \"%(state)s\" and " +"maintenance mode off" +msgstr "" + +#: ironic_discoverd/introspect.py:109 +#, python-format +msgid "Failed validation of power interface for node %(node)s, reason: %(reason)s" +msgstr "" + +#: ironic_discoverd/introspect.py:124 +msgid "Unexpected exception in background introspection thread" +msgstr "" + +#: ironic_discoverd/introspect.py:158 +#, python-format +msgid "" +"Failed to power on node %(node)s, check it's power management " +"configuration:\n" +"%(exc)s" +msgstr "" + +#: ironic_discoverd/main.py:46 +msgid "Authentication required" +msgstr "" + +#: ironic_discoverd/main.py:51 +msgid "Access denied" +msgstr "" + +#: ironic_discoverd/node_cache.py:115 +#, python-format +msgid "Some or all of %(name)s's %(value)s are already on introspection" +msgstr "" + +#: ironic_discoverd/node_cache.py:202 +#, python-format +msgid "Could not find node %s in cache" +msgstr "" + +#: ironic_discoverd/node_cache.py:233 +#, python-format +msgid "Could not find a node for attributes %s" +msgstr "" + +#: ironic_discoverd/node_cache.py:236 +#, python-format +msgid "Multiple matching nodes found for attributes %(attr)s: %(found)s" +msgstr "" + +#: ironic_discoverd/node_cache.py:244 +#, python-format +msgid "" +"Could not find node %s in introspection cache, probably it's not on " +"introspection now" +msgstr "" + +#: ironic_discoverd/node_cache.py:249 +#, python-format +msgid "Introspection for node %(node)s already finished on %(finish)s" +msgstr "" + +#: ironic_discoverd/process.py:54 +#, python-format +msgid "Node UUID %s was found in cache, but is not found in Ironic" +msgstr "" + +#: ironic_discoverd/process.py:65 +msgid "Unexpected exception during processing" +msgstr "" + +#: ironic_discoverd/process.py:155 +#, python-format +msgid "" +"Failed to validate updated IPMI credentials for node %s, node might " +"require maintenance" +msgstr "" + +#: ironic_discoverd/process.py:167 +#, python-format +msgid "" +"Failed to power off node %(node)s, check it's power management " +"configuration: %(exc)s" +msgstr "" + +#: ironic_discoverd/process.py:183 +#, python-format +msgid "Timeout waiting for node %s to power off after introspection" +msgstr "" + +#: ironic_discoverd/plugins/edeploy.py:50 +msgid "edeploy plugin: no \"data\" key in the received JSON" +msgstr "" + +#: ironic_discoverd/plugins/standard.py:37 +#, python-format +msgid "The following required parameters are missing: %s" +msgstr "" + +#: ironic_discoverd/plugins/standard.py:61 +msgid "No interfaces supplied by the ramdisk" +msgstr "" + +#: ironic_discoverd/plugins/standard.py:91 +#, python-format +msgid "" +"No valid interfaces found for node with BMC %(ipmi_address)s, got " +"%(interfaces)s" +msgstr "" + +#: ironic_discoverd/plugins/standard.py:119 +#, python-format +msgid "Ramdisk reported error: %s" +msgstr "" + diff --git a/requirements.txt b/requirements.txt index 72aa7531b..e0ddde2cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ requests>=2.2.0,!=2.4.0 oslo.i18n>=1.3.0 # Apache-2.0 six>=1.7.0 stevedore>=1.1.0 +Babel>=1.3 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..819da1408 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,13 @@ +[compile_catalog] +directory = locale +domain = ironic-discoverd + +[update_catalog] +domain = ironic-discoverd +output_dir = locale +input_file = locale/ironic-discoverd.pot + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = locale/ironic-discoverd.pot