Cleanup translation markups

This patch cleans up strings marked for translations from unnecessary
html markup and removes near-identical strings.
Blocktrans django tag is now used only if it is necessary to pass a
context variable and results are trimmed.
Includes minor spelling and grammar corrections

Closes-Bug: #1543734
Change-Id: I0dc1edcdcc7f24a0d406ec4189000e0855c37131
This commit is contained in:
Kirill Zaitsev 2016-02-09 18:05:48 +03:00
parent bc9f749416
commit 4a41b271b4
14 changed files with 89 additions and 95 deletions

View File

@ -46,11 +46,10 @@ class DeleteCategory(tables.DeleteAction):
try:
api.muranoclient(request).categories.delete(obj_id)
except exc.HTTPException:
LOG.exception(_('Unable to delete category'))
msg = _('Unable to delete category')
LOG.exception(msg)
url = reverse('horizon:murano:categories:index')
exceptions.handle(request,
_('Unable to delete category.'),
redirect=url)
exceptions.handle(request, msg, redirect=url)
class CategoriesTable(tables.DataTable):

View File

@ -3,12 +3,12 @@
{% block page_header %}
<div class='page-header'>
<h1>
{% blocktrans %}Application details: {{ name }}{% endblocktrans %}
{% trans "Application details"}: {{ name }}
</h1>
<h3>
<a href=" {% url 'horizon:murano:catalog:index' %}">
{% blocktrans %}Applications{% endblocktrans %}
{% trans "Applications" %}
</a> > {{ name }}
</h3>
</div>

View File

@ -1,13 +1,13 @@
{% load i18n %}
<h3 class="heading_switcher env_switcher">{% trans "Environment:" %}
<h3 class="heading_switcher env_switcher">{% trans "Environment" %}:
<div id="environment_switcher" class="header dropdown">
{% with num_of_envs=available_environments|length %}
{% if environment %}
<a href="#environment_switcher" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">{{ environment.name|truncatechars:30}} {% if num_of_envs > 1 %} <b class="caret"></b>{% endif %}</a>
{% else %}
<a href="{% url 'horizon:murano:environments:create_environment' %}?next={{ view.current_page_url|urlencode }}" title="{% trans 'Click to create an environment' %}" class="btn btn-default ajax-modal">{% trans "Create Environment" %}</a>
<a href="{% url 'horizon:murano:environments:create_environment' %}?next={{ view.current_page_url|urlencode }}" title="{% trans 'Click to create new environment' %}" class="btn btn-default ajax-modal">{% trans "Create Environment" %}</a>
{% endif %}
{% if num_of_envs > 1 %}

View File

@ -107,17 +107,16 @@
{% else %}
<p class="col-xs-12 alert alert-info">
{% if no_apps %}
{% blocktrans %} There are no applications in the catalog.
You can import apps from<a href="{{ repo_url }}"
target="_blank"> {{ repo_url }}</a>.
<br><br>
Go to
<b><a href={{ pkg_def_url }}>Packages</a></b>,
click 'Import Package' and select <i>Repository</i> as a
<i>Package Source</i>. {% endblocktrans %}
{% else %}
{% blocktrans %} No applications matching your criteria.
{% trans "There are no applications in the catalog. You can import apps from" %}
<a href="{{ repo_url }}" target="_blank"> {{ repo_url }}</a>.
<br><br>
{% blocktrans trimmed %}Go to
<b>
<a href={{ pkg_def_url }}>Packages</a>
</b>, click 'Import Package' and select <i>Repository</i> as <i>Package Source</i>.
{% endblocktrans %}
{% else %}
{% trans "There are no applications matching your criteria." %}
{% endif %}
</p>
{% endif %}

View File

@ -2,12 +2,11 @@
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans 'Description:' %}</h3>
<p>{% trans 'Add new category to the application catalog. ' %}</p>
<h3>{% trans 'Description' %}:</h3>
<p>{% trans 'Add new category to the application catalog.' %}</p>
<p>
<strong>{% trans 'Name' %}:</strong>
{% blocktrans %}Provide desired name for a new
category{% endblocktrans %}
{% trans "Provide desired name for a new category" %}
</p>
{% endblock %}

View File

@ -2,13 +2,12 @@
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans 'Description:' %}</h3>
<h3>{% trans "Description" %}:</h3>
<p>
<strong>{% trans 'Environment Name' %}:</strong>
{% blocktrans %}Create a name for the environment{% endblocktrans %}
<strong>{% trans "Environment Name" %}:</strong>
{% trans "Choose a name for the environment" %}
</p>
<p>
{% blocktrans %} An environment is a collection of instances that
are meant to operate under similar conditions.{% endblocktrans %}
{% trans "An environment is a collection of applications that are meant to operate under similar conditions." %}
</p>
{% endblock %}

View File

@ -2,21 +2,19 @@
{% load i18n %}
{% block modal-body-right %}
<h3>{% trans 'Description:' %}</h3>
<p>{% trans 'Mark an image with Murano specific metadata to be added to the selected image.' %}</p>
<h3>{% trans "Description" %}:</h3>
<p>{% trans "Mark an image with Murano specific metadata to be added to the selected image." %}</p>
<p>
<strong>{% trans 'Image' %}:</strong>
{% blocktrans %}Select an image registered in Glance Image
Services.{% endblocktrans %}
<strong>{% trans "Image" %}:</strong>
{% trans "Select an image registered in Glance Image Services." %}
</p>
<p>
<strong>{% trans 'Image Title' %}:</strong>
{% blocktrans %}Create a title for an image.{% endblocktrans %}
<strong>{% trans "Image Title" %}:</strong>
{% trans "Create a title for an image." %}
</p>
<p>
<strong>{% trans 'Image Type' %}:</strong>
{% blocktrans %}Select an image type supported by
Murano.{% endblocktrans %}
<strong>{% trans "Image Type" %}:</strong>
{% trans "Select an image type supported by Murano." %}
</p>
{% endblock %}

View File

@ -26,18 +26,18 @@
</div>
<div class="right">
<div class='description-by_name'>
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Bundle Name: </strong>Bundle's full name.{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Bundle Name" %}: </strong>{% trans "Bundle's full name."%}</p>
<p>{% blocktrans %}The bundle is going to be installed from <a href="{{murano_repo_url}}" target="_blank">{{murano_repo_url}}</a> repository.{% endblocktrans %}</p>
</div>
<div class='description-by_url'>
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Bundle URL:</strong> HTTP/HTTPS URL of the bundle file.{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Bundle URL" %}: </strong>{% trans "HTTP/HTTPS URL of the bundle file."%}</p>
</div>
<div class='description-common'>
<p>{% blocktrans %}<strong><i>Note: </i></strong>You'll have to configure each package installed from this bundle separately.
<br>If packages depend upon other packages and/or require specific glance images, those are going to be installed with them from murano repository.
{% endblocktrans %}</p>
<p><strong><i>{% trans "Note" %}: </i></strong>{% trans "You'll have to configure each package installed from this bundle separately." %}
<br>{% trans "If packages depend upon other packages and/or require specific glance images, those are going to be installed with them from murano repository." %}
</p>
</div>
</div>
{% endblock %}

View File

@ -4,15 +4,15 @@
{% block form_id %}{% endblock %}
{% block form_action %}{% url 'horizon:murano:packages:modify' app_id %}{% endblock %}
{% block modal-header %}{% trans 'Modify Package' %}{% endblock %}
{% block modal-header %}{% trans "Modify Package" %}{% endblock %}
{% block modal_id %}modify_package_modal{% endblock %}
{% block modal-body-right %}
{% include 'packages/_package_params.html' %}
<p>{% blocktrans %}<strong>Categories</strong> Select one or more categories for a package.{% endblocktrans %}</p>
<p><strong>{% trans "Categories" %}. </strong>{% trans "Select one or more categories for a package." %}</p>
{% endblock %}
{% block modal-footer %}
<input type='submit' class='btn btn-primary pull-right' value='{% trans 'Update' %}' />
<input type='submit' class='btn btn-primary pull-right' value='{% trans "Update" %}' />
<a href="{% url 'horizon:murano:packages:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,8 @@
{% load i18n %}
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Name:</strong> Set up for identifying a package.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Tags:</strong> Used for identifying and filtering packages.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Public:</strong> Defines whether or not a package can be used by other tenants. (Applies to package dependencies){% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Active:</strong> Allows to hide a package from the catalog. (Applies to package dependencies){% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Description:</strong> Allows adding additional information about a package.{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Name" %}: </strong>{% trans "Set up for identifying a package." %}</p>
<p><strong>{% trans "Tags" %}: </strong>{% trans "Used for identifying and filtering packages." %}</p>
<p><strong>{% trans "Public" %}: </strong>{% trans "Defines whether or not a package can be used by other tenants. (Applies to package dependencies)" %}</p>
<p><strong>{% trans "Active" %}: </strong>{% trans "Allows to hide a package from the catalog. (Applies to package dependencies)" %}</p>
<p><strong>{% trans "Description" %}: </strong>{% trans "Allows adding additional information about a package." %}</p>

View File

@ -29,31 +29,32 @@
{% if wizard.steps.prev == 'upload' %}
{% include 'packages/_package_params.html' %}
{% elif wizard.steps.prev == 'modify' %}
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Categories</strong> Select one or more categories for a package{% endblocktrans %}</p>
<p>{% blocktrans %} Specifying a category helps to filter applications in the catalog {% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Categories" %} </strong>{% trans "Select one or more categories for a package"</p>
<p>{% trans "Specifying a category helps to filter applications in the catalog" %}</p>
{% else %}
<div class='description-upload'>
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}Choose a Zip archive to upload into the catalog.{% endblocktrans %}</p>
<p>{% blocktrans %}Packages should contain:<br>
* Manifest file<br>
* UI definition folder<br>
* Classes definition folder<br>
* Execution plans folder{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p>{% trans "Choose a Zip archive to upload into the catalog." %}</p>
<p>{% trans "Packages should contain:" %}<br>
* {% trans "Manifest file" context "Package requirements" %}<br>
* {% trans "UI definition folder" context "Package requirements" %}<br>
* {% trans "Classes definition folder" context "Package requirements" %}<br>
* {% trans "Execution plans folder" context "Package requirements" %}</p>
</div>
<div class='description-by_name'>
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Package Name:</strong> Fully qualified package name.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Package Version:</strong> Version of the package (optional).{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Package Name" %}: </strong>{% trans "Fully qualified package name." %}</p>
<p><strong>{% trans "Package Version" %}: </strong>{% trans "Version of the package (optional)." %}</p>
<p>{% blocktrans %}The package is going to be imported from <a href="{{murano_repo_url}}" target="_blank">{{murano_repo_url}}</a> repository.{% endblocktrans %}</p>
</div>
<div class='description-by_url'>
<h3>{% trans 'Description:' %}</h3>
<p>{% blocktrans %}<strong>Package URL:</strong> HTTP/HTTPS URL of the package file.{% endblocktrans %}</p>
<h3>{% trans "Description" %}:</h3>
<p><strong>{% trans "Package URL" %} :</strong>{% trans "HTTP/HTTPS URL of the package file." %}</p>
</div>
<div class='description-common'>
<p>{% blocktrans %}<strong><i>Note: </i></strong>If the package depends upon other packages and/or requires specific glance images, those are going to be installed with it from murano repository.{% endblocktrans %}</p>
<p><strong><i>{% trans "Note" %}: </i></strong>
{% trans "If the package depends upon other packages and/or requires specific glance images, those are going to be installed with it from murano repository." %}</p>
</div>
{% endif %}
</div>

View File

@ -16,7 +16,7 @@
<div class="row row-header">
<div class="col-xs-5">
<h3 class="table_title extra_title table_title">
{% blocktrans %}Application&nbsp;Components{% endblocktrans %}</h3>
{% trans "Application&nbsp;Components" %}</h3>
</div>
<h4 class="category-title">{% trans 'App category' %}</h4>
<div class="col-xs-3">
@ -63,22 +63,21 @@
{% else %}
<p id="no_apps_in_catalog_message" class="col-xs-12 alert alert-info ">
{% with repo_url=table.get_repo_url pkg_def_url=table.get_pkg_def_url %}
{% blocktrans %} There are no applications in the
catalog.
You can import apps from
{% trans "There are no applications in the catalog. You can import apps from" %}
<a href="{{ repo_url }}" target="_blank"> {{ repo_url }}</a>.
<br><br>
Go to
<b><a href={{ pkg_def_url }}>Packages</a></b>,
click 'Import Package' and select
<i>Repository</i> as a <i>Package Source</i>.
{% endblocktrans %}
{% blocktrans trimmed %}Go to
<b>
<a href={{ pkg_def_url }}>Packages</a>
</b>, click 'Import Package' and select <i>Repository</i> as <i>Package Source</i>.
{% endblocktrans %}
{% endwith %}
</p>
{% endif %}
<div class="clearfix"></div>
<p id="no_apps_found_message" class="alert alert-info">No applications matching your criteria</p>
<p id="no_apps_found_message" class="alert alert-info">
{% trans "There are no applications matching your criteria." %}</p>
<div id="apps_carousel" class="carousel">
<input type="hidden" id="apps_carousel_contents"
value="{{ apps }}">

View File

@ -2,35 +2,35 @@
<h3>{% trans "Component Details" %}</h3>
<div class="status_detail">
<h4>{% blocktrans %}Info {% endblocktrans %}</h4>
<h4>{% trans "Info" %}</h4>
<dl>
{% for key, value in service.items %}
{% if key == 'Instance' %}
<dt>Instance name</dt>
{% if key == 'Instance' %}
<dt>{% trans "Instance name" %}</dt>
<dd>
<a href=" {% url 'horizon:project:instances:detail' value.id %}">
{{ value.name }}
</a>
</dd><br>
{% elif key == 'Instances' %}
{% elif key == 'Instances' %}
{% for instance in value %}
<dt>Instance{{forloop.counter}} name</dt>
<dt>{% blocktrans %}Instance{{forloop.counter}} name{% endblocktrans %}</dt>
<dd>
<a href=" {% url 'horizon:project:instances:detail' instance.id %}">
{{ instance.name }}
</a>
</dd><br>
{% endfor %}
{% elif key == 'Stack'%}
<dt>Heat Orchestration stack name</dt>
{% elif key == 'Stack'%}
<dt>{% trans "Heat Orchestration stack name" %}</dt>
<dd>
<a href=" {% url 'horizon:project:stacks:detail' value.id %}">
{{ value.name }}
</a>
</dd><br>
{% elif key == 'Stacks'%}
{% elif key == 'Stacks'%}
{% for stack in value %}
<dt>Heat Orchestration stack{{forloop.counter}} name</dt>
<dt>{% blocktrans %}Heat Orchestration stack{{forloop.counter}} name{% endblocktrans %}</dt>
<dd>
<a href=" {% url 'horizon:project:stacks:detail' stack.id %}">
{{ stack.name }}
@ -38,8 +38,8 @@
</dd><br>
{% endfor %}
{% else %}
<dt>{% blocktrans %} {{ key }} {% endblocktrans %}</dt>
<dd>{% blocktrans %} {{ value }} {% endblocktrans %}</dd>
<dt>{{ key }}</dt>
<dd>{{ value }}</dd>
<br>
{% endif %}
{% endfor %}

View File

@ -8,7 +8,7 @@
{% block modal-header %}
<span class="wizard_title">
<img src="{% url 'horizon:murano:catalog:images' app_id %}" height="25" width="25"/>
{% trans "Configure Application: " %}{{ service_name }}
{% trans "Configure Application" %}: {{ service_name }}
</span>
{% endblock %}
{% block steps-list %}
@ -42,18 +42,18 @@
{% endwith %}
</fieldset>
{% endif %}
<p>{% blocktrans %} {{ extended_description }} {% endblocktrans %}</p>
<p>{{ extended_description }}</p>
</div>
<div class="right">
<h3> {% blocktrans %} {{ service_name }} {% endblocktrans %} </h3>
<h3>{{ service_name }}</h3>
{% for name, title, description in field_descriptions %}
<p>
{% if title %}
<strong data-field-name="{{ wizard.steps.step0 }}-{{ name }}">
{% blocktrans %}{{ title }}:{% endblocktrans %}
{{ title }}:
</strong>
{% endif %}
{% blocktrans with description|linebreaksbr as desc %}{{ desc }}{% endblocktrans %}
{{ description|linebreaksbr }}
</p>
{% endfor %}
</div>