Setup for translation

To start translation, we need to initially import the
translation file - and place it at the proper place so that
the usual CI scripts can handle it.

The proper place is for all python projects
$PROJECT/locale/$PROJECT.pot - see setup.cfg.

Note that we should be using our own i18n.py
module per best practices:
http://docs.openstack.org/developer/oslo.i18n/usage.html#creating-an-integration-module

Further imports will be done by the OpenStack Proposal bot.

implements blueprint magnum-i18n-support
Change-Id: Id9f5b08835a4780a8448c989a878c03b70a97803
This commit is contained in:
Davanum Srinivas 2015-05-13 17:12:45 -04:00
parent 3ca59faedb
commit 4435e8ded9
3 changed files with 242 additions and 0 deletions

35
magnumclient/i18n.py Normal file
View File

@ -0,0 +1,35 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""oslo_i18n integration module for magnumclient.
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
"""
import oslo_i18n
_translators = oslo_i18n.TranslatorFactory(domain='magnumclient')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical

View File

@ -0,0 +1,206 @@
# Translations template for python-magnumclient.
# Copyright (C) 2015 ORGANIZATION
# This file is distributed under the same license as the python-magnumclient
# project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: python-magnumclient 0.2.1.dev1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-05-13 17:11-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"
#: magnumclient/common/utils.py:55
#, python-format
msgid "Attributes must be a list of PATH=VALUE not \"%s\""
msgstr ""
#: magnumclient/common/utils.py:79
#, python-format
msgid "Unknown PATCH operation: %s"
msgstr ""
#: magnumclient/openstack/common/cliutils.py:40
#, python-format
msgid "Missing arguments: %s"
msgstr ""
#: magnumclient/openstack/common/cliutils.py:158
#, python-format
msgid ""
"Field labels list %(labels)s has different number of elements than fields"
" list %(fields)s"
msgstr ""
#: magnumclient/openstack/common/apiclient/base.py:244
#: magnumclient/openstack/common/apiclient/base.py:401
#, python-format
msgid "No %(name)s matching %(args)s."
msgstr ""
#: magnumclient/openstack/common/apiclient/client.py:250
msgid "Cannot find endpoint or token for request"
msgstr ""
#: magnumclient/openstack/common/apiclient/client.py:381
#, python-format
msgid ""
"Invalid %(api_name)s client version '%(version)s'. Must be one of: "
"%(version_map)s"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:79
#, python-format
msgid "Authentication failed. Missing options: %s"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:88
#, python-format
msgid "AuthSystemNotFound: %s"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:111
#, python-format
msgid "AmbiguousEndpoints: %s"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:119
msgid "HTTP Error"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:139
msgid "HTTP Redirection"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:147
msgid "HTTP Client Error"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:156
msgid "HTTP Server Error"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:166
msgid "Multiple Choices"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:175
msgid "Bad Request"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:185
msgid "Unauthorized"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:194
msgid "Payment Required"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:204
msgid "Forbidden"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:214
msgid "Not Found"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:224
msgid "Method Not Allowed"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:234
msgid "Not Acceptable"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:243
msgid "Proxy Authentication Required"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:252
msgid "Request Timeout"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:262
msgid "Conflict"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:272
msgid "Gone"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:282
msgid "Length Required"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:292
msgid "Precondition Failed"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:301
msgid "Request Entity Too Large"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:318
msgid "Request-URI Too Long"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:328
msgid "Unsupported Media Type"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:338
msgid "Requested Range Not Satisfiable"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:347
msgid "Expectation Failed"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:357
msgid "Unprocessable Entity"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:366
msgid "Internal Server Error"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:377
msgid "Not Implemented"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:387
msgid "Bad Gateway"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:396
msgid "Service Unavailable"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:406
msgid "Gateway Timeout"
msgstr ""
#: magnumclient/openstack/common/apiclient/exceptions.py:415
msgid "HTTP Version Not Supported"
msgstr ""
#: magnumclient/openstack/common/apiclient/utils.py:86
#, python-format
msgid "No %(name)s with a name or ID of '%(name_or_id)s' exists."
msgstr ""
#: magnumclient/openstack/common/apiclient/utils.py:94
#, python-format
msgid ""
"Multiple %(name)s matches found for '%(name_or_id)s', use an ID to be "
"more specific."
msgstr ""

View File

@ -5,6 +5,7 @@ argparse
pbr>=0.11,<2.0
Babel>=1.3
oslo.config>=1.11.0 # Apache-2.0
oslo.i18n>=1.5.0 # Apache-2.0
oslo.utils>=1.4.0 # Apache-2.0
iso8601>=0.1.9
requests>=2.5.2