Use 'trimmed' for blocktrans with multi-line contents

blocktrans trimmed option removes newlines from contents of blocktrans
and replaces any whitespace at the beginning and end of a line into
a single space. This makes translator life easier.
More detail is described in the bug report.

Closes-Bug: #1583757
Depends-On: I534895be0d5f4bf0429b1511ee5421991386c873
Change-Id: Idb451b7688fd5533a8315399de13bac8b8078a67
This commit is contained in:
Akihiro Motoki 2016-05-20 04:27:35 +09:00
parent 6ec5dd3b53
commit 926a4513ea
25 changed files with 74 additions and 56 deletions

View File

@ -6,7 +6,7 @@
{% endcomment %}
<div class="help_text alert alert-info">
{% block websso-help-text %}
{% blocktrans %}
{% blocktrans trimmed %}
If you are not sure which authentication method to use, contact your administrator.
{% endblocktrans %}
{% endblock %}

View File

@ -44,7 +44,7 @@
</p>
<p>
{% url 'horizon:user_home' as home_url %}
{% blocktrans %}
{% blocktrans trimmed %}
Login as different user or go back to <a href="{{ home_url }}">home page</a>
{% endblocktrans %}
</p>

View File

@ -12,11 +12,11 @@
<div class="quota_title" title="{{ quota.name }}" data-toggle="tooltip"> {{ quota.name }}</div>
<div class="quota_subtitle">
{% if quota.max|quotainf != '-1' %}
{% blocktrans with used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
{% blocktrans trimmed with used=quota.used|intcomma available=quota.max|quotainf|intcomma %}
Used <span> {{ used }} </span>of<span> {{ available }} </span>
{% endblocktrans %}
{% else %}
{% blocktrans with used=quota.used|intcomma %}
{% blocktrans trimmed with used=quota.used|intcomma %}
Used <span> {{ used }} </span>(No Limit)
{% endblocktrans %}
{% endif %}

View File

@ -6,11 +6,11 @@
<form action="?" method="get" id="date_form" class="form-inline">
<h3>{% trans "Select a period of time to query its usage:" %}</h3>
<div class="datepicker form-group">
{% blocktrans with start=form.start %}
{% blocktrans trimmed with start=form.start %}
<label>From:</label> {{ start }}{% endblocktrans %}
</div>
<div class="datepicker form-group">
{% blocktrans with end=form.end %}
{% blocktrans trimmed with end=form.end %}
<label>To:</label>{{ end }}{% endblocktrans %}
</div>
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>

View File

@ -7,7 +7,7 @@
<div class="col-sm-12">
{{ tab_group.render }}
<div class="version_label pull-right">
{% blocktrans with version_info=version %}Version: {{ version_info }}
{% blocktrans trimmed with version_info=version %}Version: {{ version_info }}
{% endblocktrans %}
</div>
</div>

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
The status of a volume snapshot is normally managed automatically. In some circumstances
an administrator may need to explicitly update the status value. This is equivalent to
the <tt>cinder snapshot-reset-state</tt> command.

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
QoS Specs can be associated with volume types.
It is used to map to a set of quality of service capabilities requested
by the volume owner. This is equivalent to the

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Volume type is a type or label that can be selected at volume creation
time in OpenStack. It usually maps to a set of capabilities of the storage
back-end driver to be used for this volume. Examples: "Performance",

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Each QoS Specs entity will have a "Consumer" value which indicates where the
administrator would like the QoS policy to be enforced. This value can be "front-end"
(Nova Compute), "back-end" (Cinder back-end), or "both".

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
"Manage" an existing volume from a Cinder host. This will make the volume visible within
OpenStack.
<br>

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Migrate a volume to a specific host.
<br>
<br>

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
When a volume is "unmanaged", the volume will no longer be visible within OpenStack. Note that the
volume will not be deleted from the Cinder host.
<br>

View File

@ -3,7 +3,7 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
The status of a volume is normally managed automatically. In some circumstances an
administrator may need to explicitly update the status value. This is equivalent to
the <tt>cinder reset-state</tt> command.

View File

@ -1,4 +1,6 @@
{% load i18n horizon %}
<p>{% blocktrans %}Choose rule(s) from Available Rules to Selected Rule by push button or drag and drop,
you may change their order by drag and drop as well. {% endblocktrans %}</p>
<p>{% blocktrans trimmed %}
Choose rule(s) from Available Rules to Selected Rule by push button or
drag and drop, you may change their order by drag and drop as well.
{% endblocktrans %}</p>

View File

@ -123,7 +123,7 @@
<dt>{% trans "Attached To" %}</dt>
<dd>
{% url instance.volume_url volume.id as volume_url %}
{% blocktrans with volume_label=volume.name|default:volume.id volume_device=volume.device %}
{% blocktrans trimmed with volume_label=volume.name|default:volume.id volume_device=volume.device %}
<a href="{{ volume_url }}">{{ volume_label }}</a> on {{ volume_device }}
{% endblocktrans %}
</dd>

View File

@ -19,7 +19,7 @@
<h4>{% trans "Project Limits" %}</h4>
<div class="quota_title">
<strong class="pull-left">{% trans "Number of Instances" %}</strong>
{% blocktrans with used=usages.totalInstancesUsed|intcomma quota=usages.maxTotalInstances|intcomma|quotainf %}
{% blocktrans trimmed with used=usages.totalInstancesUsed|intcomma quota=usages.maxTotalInstances|intcomma|quotainf %}
<span class="pull-right">{{ used }} of {{ quota }} Used</span>
{% endblocktrans %}
</div>
@ -37,7 +37,7 @@
<div class="quota_title">
<strong class="pull-left">{% trans "Number of VCPUs" %}</strong>
{% blocktrans with used=usages.totalCoresUsed|intcomma quota=usages.maxTotalCores|intcomma|quotainf %}
{% blocktrans trimmed with used=usages.totalCoresUsed|intcomma quota=usages.maxTotalCores|intcomma|quotainf %}
<span class="pull-right">{{ used }} of {{ quota }} Used</span>
{% endblocktrans %}
</div>
@ -55,7 +55,7 @@
<div class="quota_title">
<strong class="pull-left">{% trans "Total RAM" %}</strong>
{% blocktrans with used=usages.totalRAMUsed|intcomma quota=usages.maxTotalRAMSize|intcomma|quotainf %}
{% blocktrans trimmed with used=usages.totalRAMUsed|intcomma quota=usages.maxTotalRAMSize|intcomma|quotainf %}
<span class="pull-right">{{ used }} of {{ quota }} MB Used</span>
{% endblocktrans %}
</div>

View File

@ -1,24 +1,27 @@
{% load i18n %}
<p>
{% blocktrans %}
{% blocktrans trimmed %}
Assign a name and description for the pool. Choose one subnet where all
members of this pool must be on. Select the protocol and load balancing
method for this pool. Admin State is UP (checked) by default.
{% endblocktrans %}
</p>
<p><label>{% blocktrans %}Load Balancing Method{% endblocktrans %}</label><br/>
{% blocktrans %}Use one of these load balancing methods to distribute incoming requests:{% endblocktrans %}
<p><label>{% blocktrans trimmed %}Load Balancing Method{% endblocktrans %}</label><br/>
{% blocktrans trimmed %}
Use one of these load balancing methods to distribute incoming requests:
{% endblocktrans %}
<div>
<dl>
<dt>{% blocktrans %}Round robin{% endblocktrans %}</dt>
<dd>{% blocktrans %}Rotates requests evenly between multiple instances.{% endblocktrans %}</dd>
<dt>{% blocktrans %}Source IP{% endblocktrans %}</dt>
<dd>{% blocktrans %}Requests from a unique source IP address are consistently
<dt>{% blocktrans trimmed %}Round robin{% endblocktrans %}</dt>
<dd>{% blocktrans trimmed %}Rotates requests evenly between multiple
instances.{% endblocktrans %}</dd>
<dt>{% blocktrans trimmed %}Source IP{% endblocktrans %}</dt>
<dd>{% blocktrans trimmed %}Requests from a unique source IP address are consistently
directed to the same instance.{% endblocktrans %}</dd>
<dt>{% blocktrans %}Least connections{% endblocktrans %}</dt>
<dd>{% blocktrans %}Allocates requests to the instance with the least number of
<dt>{% blocktrans trimmed %}Least connections{% endblocktrans %}</dt>
<dd>{% blocktrans trimmed %}Allocates requests to the instance with the least number of
active connections.{% endblocktrans %}</dd>
</dl>
</div>
</p>
</p>

View File

@ -1,15 +1,16 @@
{% load i18n %}
<p>
{% blocktrans %}
{% blocktrans trimmed %}
Create a VIP for this pool. Assign a name, description, IP address, port,
and maximum connections allowed for the VIP. Choose the protocol and session persistence
method for the VIP. Admin State is UP (checked) by default.
{% endblocktrans %}
</p>
<p><label>{% blocktrans %}IP address{% endblocktrans %}</label><br/>
{% blocktrans %}When no IP address is provided, the VIP will obtain an address from
<p><label>{% blocktrans trimmed %}IP address{% endblocktrans %}</label><br/>
{% blocktrans trimmed %}
When no IP address is provided, the VIP will obtain an address from
the selected subnet. If a specific IP address is desired, it may be provided and
must also be an address within the selected subnet.
{% endblocktrans %}
</p>
</p>

View File

@ -1,7 +1,7 @@
{% load i18n %}
<div class='description'>
{% blocktrans %}
{% blocktrans trimmed %}
Resize the canvas by scrolling up/down with your mouse/trackpad on the topology.
Pan around the canvas by clicking and dragging the space behind the topology.
{% endblocktrans %}
@ -17,5 +17,7 @@
</div>
</div>
<div id="topologyCanvasContainer" class="d3-container">
<div class="nodata">{% blocktrans %}There are no networks, routers, or connected instances to display.{% endblocktrans %}</div>
<div class="nodata">{% blocktrans trimmed %}
There are no networks, routers, or connected instances to display.
{% endblocktrans %}</div>
</div>

View File

@ -36,7 +36,7 @@
{% if subnet.ipv6_modes_desc %}
<dd>{{ subnet.ipv6_modes_desc }}</dd>
{% else %}
<dd>{% blocktrans with ra_mode=subnet.ipv6_ra_mode addr_mode=subnet.ipv6_address_mode %}
<dd>{% blocktrans trimmed with ra_mode=subnet.ipv6_ra_mode addr_mode=subnet.ipv6_address_mode %}
Other IPv6 modes: ipv6_ra_mode={{ ra_mode }}, ipv6_address_mode={{ addr_mode }}
{% endblocktrans %}</dd>
{% endif %}

View File

@ -27,7 +27,8 @@
<th>
{{ dest.networkname }}<br/>
{% if dest.subnetname|length > 0 %}
{% blocktrans with dest_subnetname=dest.subnetname %}Subnet: {{ dest_subnetname }}{% endblocktrans %}</br>
{% blocktrans trimmed with dest_subnetname=dest.subnetname %}
Subnet: {{ dest_subnetname }}{% endblocktrans %}</br>
{% endif %}
{{ dest.cidr }}
</th>
@ -42,7 +43,8 @@
<b>{{ row.source.networkname }}
{% if row.source.subnetname|length > 0 %}
<br/>
{% blocktrans with row_source_subnetname=row.source.subnetname %}Subnet: {{ row_source_subnetname }}{% endblocktrans %}
{% blocktrans trimmed with row_source_subnetname=row.source.subnetname %}
Subnet: {{ row_source_subnetname }}{% endblocktrans %}
{% endif %}
<br/>
{{ row.source.cidr }}
@ -93,7 +95,11 @@
<h3>{% trans "Rule Conflict" %}</h3>
</div>
<div class="modal-body">
<p>{% blocktrans %}A more specific rule affects a portion of this traffic so a rule cannot be automatically generated to control the behavior of the entire source/destination combination.{% endblocktrans %}</p>
<p>{% blocktrans trimmed %}
A more specific rule affects a portion of this traffic so
a rule cannot be automatically generated to control the
behavior of the entire source/destination combination.
{% endblocktrans %}</p>
<hr>
<h4>{% trans "Conflicting Rule" %}</h4>
<b>{% trans "Source:" %}</b> {{ dest.conflicting_rule.source }}<br>
@ -120,11 +126,14 @@
</tfoot>
</table>
<h3>{% trans "Description" %}</h3>
<p>{% blocktrans %}The color and icon of an intersection indicates whether or not traffic is permitted from the source (row) to the destination (column).
Clicking the <span class="fa fa-random"></span> button in the intersection will install a rule to switch the traffic behavior.<br/>
<b>Note:</b> Rules only affect one direction of traffic. The opposite direction is outlined when hovering over an intersection.
{% endblocktrans %} </p>
<p>{% blocktrans trimmed %}
The color and icon of an intersection indicates whether or not traffic is
permitted from the source (row) to the destination (column).
Clicking the <span class="fa fa-random"></span> button in the intersection
will install a rule to switch the traffic behavior.<br/>
<b>Note:</b> Rules only affect one direction of traffic.
The opposite direction is outlined when hovering over an intersection.
{% endblocktrans %} </p>
</div>
<script type="text/javascript">
function highLightMirror(td){

View File

@ -42,7 +42,7 @@
<dt>{% trans "Attached To" %}</dt>
<dd>
{% url 'horizon:project:instances:detail' attachment.server_id as instance_url %}
{% blocktrans with instance_name=attachment.instance.name device=attachment.device %}
{% blocktrans trimmed with instance_name=attachment.instance.name device=attachment.device %}
<a href="{{ instance_url }}">{{ instance_name }}</a> on {{ device }}
{% endblocktrans %}
</dd>

View File

@ -3,16 +3,16 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Change the volume type of a volume after its creation.
This is equivalent to the <tt>cinder retype</tt> command.
{% endblocktrans %}
</p>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
The "Volume Type" selected must be different from the current volume type.
{% endblocktrans %}
</p>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
The "Migration Policy" is only used if the volume retype cannot be
completed. If the "Migration Policy" is "On Demand", the back end will
perform volume migration. Note that migration may take a significant

View File

@ -3,18 +3,18 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Upload the volume to the Image Service as an image.
This is equivalent to the <tt>cinder upload-to-image</tt> command.
{% endblocktrans %}
</p>
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
Choose "Disk Format" for the image. The volume images are created with
the QEMU disk image utility.
{% endblocktrans %}
</p>
{% if volume.status == 'in-use' %}
<p>{% blocktrans %}
<p>{% blocktrans trimmed %}
When the volume status is "in-use", you can use "Force" to upload the
volume to an image.
{% endblocktrans %}

View File

@ -7,9 +7,10 @@
<div id="right_content">
<div id="page_head">
<h2 id="page_heading">{% trans "Forbidden" %}</h2>
<p id="page_description">{% blocktrans %}You do not have the required
privileges to access this content. If you believe this message to
be in error, please contact your project manager.{% endblocktrans %}
<p id="page_description">{% blocktrans trimmed %}
You do not have the required privileges to access this content.
If you believe this message to be in error, please contact your project
manager.{% endblocktrans %}
</p>
</div>
</div>