use i18n marker for conf module
diff --git a/staffeln/conf/api.py b/staffeln/conf/api.py
index 7402740..846f959 100755
--- a/staffeln/conf/api.py
+++ b/staffeln/conf/api.py
@@ -1,26 +1,27 @@
from oslo_config import cfg
+from staffeln.i18n import _
api_group = cfg.OptGroup(
"api",
title="API options",
- help="Options under this group are used to define staffeln API.",
+ help=_("Options under this group are used to define staffeln API."),
)
connection_opts = [
cfg.StrOpt(
"host",
default="0.0.0.0",
- help="IP address on which the staffeln API will listen.",
+ help=_("IP address on which the staffeln API will listen."),
),
cfg.PortOpt(
"port",
default=8808,
- help="Staffeln API listens on this port number for incoming requests.",
+ help=_("Staffeln API listens on this port number for incoming requests."),
),
- cfg.BoolOpt("enabled_ssl", default=False, help="ssl enabled"),
- cfg.StrOpt("ssl_key_file", default=False, help="ssl key file path"),
- cfg.StrOpt("ssl_cert_file", default=False, help="ssl cert file path"),
+ cfg.BoolOpt("enabled_ssl", default=False, help=_("ssl enabled")),
+ cfg.StrOpt("ssl_key_file", default=False, help=_("ssl key file path")),
+ cfg.StrOpt("ssl_cert_file", default=False, help=_("ssl cert file path")),
]
API_OPTS = connection_opts
diff --git a/staffeln/conf/conductor.py b/staffeln/conf/conductor.py
index b83737d..9906004 100755
--- a/staffeln/conf/conductor.py
+++ b/staffeln/conf/conductor.py
@@ -1,28 +1,30 @@
from oslo_config import cfg
+from staffeln.i18n import _
+
conductor_group = cfg.OptGroup(
"conductor",
title="Conductor Options",
- help="Options under this group are used " "to define Conductor's configuration.",
+ help=_("Options under this group are used " "to define Conductor's configuration."),
)
backup_opts = [
cfg.IntOpt(
"backup_workers",
default=1,
- help="The maximum number of backup processes to "
- "fork and run. Default to number of CPUs on the host.",
+ help=_("The maximum number of backup processes to "
+ "fork and run. Default to number of CPUs on the host."),
),
cfg.IntOpt(
"backup_period",
default=10,
min=1,
- help="The time of bakup period, the unit is one minute.",
+ help=_("The time of bakup period, the unit is one minute."),
),
cfg.StrOpt(
"backup_metadata_key",
default="test",
- help="The key string of metadata the VM, which requres back up, has",
+ help=_("The key string of metadata the VM, which requres back up, has"),
),
]
@@ -30,14 +32,14 @@
cfg.IntOpt(
"rotation_workers",
default=1,
- help="The maximum number of rotation processes to "
- "fork and run. Default to number of CPUs on the host.",
+ help=_("The maximum number of rotation processes to "
+ "fork and run. Default to number of CPUs on the host."),
),
cfg.IntOpt(
"rotation_period",
default=1,
min=1,
- help="The time of rotation period, the unit is one day.",
+ help=_("The time of rotation period, the unit is one day."),
),
]
diff --git a/staffeln/conf/database.py b/staffeln/conf/database.py
index f823eae..761aa15 100644
--- a/staffeln/conf/database.py
+++ b/staffeln/conf/database.py
@@ -1,6 +1,7 @@
from oslo_config import cfg
from oslo_db import options as oslo_db_options
from staffeln.conf import paths
+from staffeln.i18n import _
_DEFAULT_SQL_CONNECTION = "sqlite:///{0}".format(
paths.state_path_def("staffeln.sqlite")
@@ -9,11 +10,11 @@
database = cfg.OptGroup(
"database",
title="Database options",
- help="Options under this group are used for defining database.",
+ help=_("Options under this group are used for defining database."),
)
SQL_OPTS = [
- cfg.StrOpt("mysql_engine", default="InnoDB", help="MySQL engine to use."),
+ cfg.StrOpt("mysql_engine", default="InnoDB", help=_("MySQL engine to use.")),
]
diff --git a/staffeln/conf/notify.py b/staffeln/conf/notify.py
index 85207b3..20f1ede 100644
--- a/staffeln/conf/notify.py
+++ b/staffeln/conf/notify.py
@@ -1,10 +1,11 @@
from oslo_config import cfg
from staffeln.i18n import _
+
notify_group = cfg.OptGroup(
"notification",
title="Notification options",
- help="Options under this group are used to define notification settings.",
+ help=_("Options under this group are used to define notification settings."),
)
email_opts = [
diff --git a/staffeln/conf/paths.py b/staffeln/conf/paths.py
index 3007619..8d403c5 100644
--- a/staffeln/conf/paths.py
+++ b/staffeln/conf/paths.py
@@ -1,4 +1,6 @@
from oslo_config import cfg
+from staffeln.i18n import _
+
import os
@@ -6,17 +8,17 @@
cfg.StrOpt(
"pybasedir",
default=os.path.abspath(os.path.join(os.path.dirname(__file__), "../")),
- help="Directory where the staffeln python module is installed.",
+ help=_("Directory where the staffeln python module is installed."),
),
cfg.StrOpt(
"bindir",
default="$pybasedir/bin",
- help="Directory where staffeln binaries are installed.",
+ help=_("Directory where staffeln binaries are installed."),
),
cfg.StrOpt(
"state_path",
default="$pybasedir",
- help="Top-level directory for maintaining staffeln's state.",
+ help=_("Top-level directory for maintaining staffeln's state."),
),
]