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: try:
api.muranoclient(request).categories.delete(obj_id) api.muranoclient(request).categories.delete(obj_id)
except exc.HTTPException: except exc.HTTPException:
LOG.exception(_('Unable to delete category')) msg = _('Unable to delete category')
LOG.exception(msg)
url = reverse('horizon:murano:categories:index') url = reverse('horizon:murano:categories:index')
exceptions.handle(request, exceptions.handle(request, msg, redirect=url)
_('Unable to delete category.'),
redirect=url)
class CategoriesTable(tables.DataTable): class CategoriesTable(tables.DataTable):

View File

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

View File

@@ -1,13 +1,13 @@
{% load i18n %} {% 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"> <div id="environment_switcher" class="header dropdown">
{% with num_of_envs=available_environments|length %} {% with num_of_envs=available_environments|length %}
{% if environment %} {% 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> <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 %} {% 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 %} {% endif %}
{% if num_of_envs > 1 %} {% if num_of_envs > 1 %}

View File

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

View File

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

View File

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

View File

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

View File

@@ -26,18 +26,18 @@
</div> </div>
<div class="right"> <div class="right">
<div class='description-by_name'> <div class='description-by_name'>
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}<strong>Bundle Name: </strong>Bundle's full name.{% endblocktrans %}</p> <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> <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>
<div class='description-by_url'> <div class='description-by_url'>
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}<strong>Bundle URL:</strong> HTTP/HTTPS URL of the bundle file.{% endblocktrans %}</p> <p><strong>{% trans "Bundle URL" %}: </strong>{% trans "HTTP/HTTPS URL of the bundle file."%}</p>
</div> </div>
<div class='description-common'> <div class='description-common'>
<p>{% blocktrans %}<strong><i>Note: </i></strong>You'll have to configure each package installed from this bundle separately. <p><strong><i>{% trans "Note" %}: </i></strong>{% trans "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. <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." %}
{% endblocktrans %}</p> </p>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -4,15 +4,15 @@
{% block form_id %}{% endblock %} {% block form_id %}{% endblock %}
{% block form_action %}{% url 'horizon:murano:packages:modify' app_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_id %}modify_package_modal{% endblock %}
{% block modal-body-right %} {% block modal-body-right %}
{% include 'packages/_package_params.html' %} {% 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 %} {% endblock %}
{% block modal-footer %} {% 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> <a href="{% url 'horizon:murano:packages:index' %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@@ -1,8 +1,8 @@
{% load i18n %} {% load i18n %}
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}<strong>Name:</strong> Set up for identifying a package.{% endblocktrans %}</p> <p><strong>{% trans "Name" %}: </strong>{% trans "Set up for identifying a package." %}</p>
<p>{% blocktrans %}<strong>Tags:</strong> Used for identifying and filtering packages.{% endblocktrans %}</p> <p><strong>{% trans "Tags" %}: </strong>{% trans "Used for identifying and filtering packages." %}</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><strong>{% trans "Public" %}: </strong>{% trans "Defines whether or not a package can be used by other tenants. (Applies to package dependencies)" %}</p>
<p>{% blocktrans %}<strong>Active:</strong> Allows to hide a package from the catalog. (Applies to package dependencies){% endblocktrans %}</p> <p><strong>{% trans "Active" %}: </strong>{% trans "Allows to hide a package from the catalog. (Applies to package dependencies)" %}</p>
<p>{% blocktrans %}<strong>Description:</strong> Allows adding additional information about a package.{% endblocktrans %}</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' %} {% if wizard.steps.prev == 'upload' %}
{% include 'packages/_package_params.html' %} {% include 'packages/_package_params.html' %}
{% elif wizard.steps.prev == 'modify' %} {% elif wizard.steps.prev == 'modify' %}
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<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>
<p>{% blocktrans %} Specifying a category helps to filter applications in the catalog {% endblocktrans %}</p> <p>{% trans "Specifying a category helps to filter applications in the catalog" %}</p>
{% else %} {% else %}
<div class='description-upload'> <div class='description-upload'>
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}Choose a Zip archive to upload into the catalog.{% endblocktrans %}</p> <p>{% trans "Choose a Zip archive to upload into the catalog." %}</p>
<p>{% blocktrans %}Packages should contain:<br> <p>{% trans "Packages should contain:" %}<br>
* Manifest file<br> * {% trans "Manifest file" context "Package requirements" %}<br>
* UI definition folder<br> * {% trans "UI definition folder" context "Package requirements" %}<br>
* Classes definition folder<br> * {% trans "Classes definition folder" context "Package requirements" %}<br>
* Execution plans folder{% endblocktrans %}</p> * {% trans "Execution plans folder" context "Package requirements" %}</p>
</div> </div>
<div class='description-by_name'> <div class='description-by_name'>
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}<strong>Package Name:</strong> Fully qualified package name.{% endblocktrans %}</p> <p><strong>{% trans "Package Name" %}: </strong>{% trans "Fully qualified package name." %}</p>
<p>{% blocktrans %}<strong>Package Version:</strong> Version of the package (optional).{% endblocktrans %}</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> <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>
<div class='description-by_url'> <div class='description-by_url'>
<h3>{% trans 'Description:' %}</h3> <h3>{% trans "Description" %}:</h3>
<p>{% blocktrans %}<strong>Package URL:</strong> HTTP/HTTPS URL of the package file.{% endblocktrans %}</p> <p><strong>{% trans "Package URL" %} :</strong>{% trans "HTTP/HTTPS URL of the package file." %}</p>
</div> </div>
<div class='description-common'> <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> </div>
{% endif %} {% endif %}
</div> </div>

View File

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

View File

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

View File

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