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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
{% block modal-body-right %} {% block modal-body-right %}
<h3>{% trans "Description:" %}</h3> <h3>{% trans "Description:" %}</h3>
<p>{% blocktrans %} <p>{% blocktrans trimmed %}
Volume type is a type or label that can be selected at volume creation 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 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", back-end driver to be used for this volume. Examples: "Performance",

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
{% block modal-body-right %} {% block modal-body-right %}
<h3>{% trans "Description:" %}</h3> <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 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. volume will not be deleted from the Cinder host.
<br> <br>

View File

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

View File

@ -1,4 +1,6 @@
{% load i18n horizon %} {% load i18n horizon %}
<p>{% blocktrans %}Choose rule(s) from Available Rules to Selected Rule by push button or drag and drop, <p>{% blocktrans trimmed %}
you may change their order by drag and drop as well. {% endblocktrans %}</p> 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> <dt>{% trans "Attached To" %}</dt>
<dd> <dd>
{% url instance.volume_url volume.id as volume_url %} {% 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 }} <a href="{{ volume_url }}">{{ volume_label }}</a> on {{ volume_device }}
{% endblocktrans %} {% endblocktrans %}
</dd> </dd>

View File

@ -19,7 +19,7 @@
<h4>{% trans "Project Limits" %}</h4> <h4>{% trans "Project Limits" %}</h4>
<div class="quota_title"> <div class="quota_title">
<strong class="pull-left">{% trans "Number of Instances" %}</strong> <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> <span class="pull-right">{{ used }} of {{ quota }} Used</span>
{% endblocktrans %} {% endblocktrans %}
</div> </div>
@ -37,7 +37,7 @@
<div class="quota_title"> <div class="quota_title">
<strong class="pull-left">{% trans "Number of VCPUs" %}</strong> <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> <span class="pull-right">{{ used }} of {{ quota }} Used</span>
{% endblocktrans %} {% endblocktrans %}
</div> </div>
@ -55,7 +55,7 @@
<div class="quota_title"> <div class="quota_title">
<strong class="pull-left">{% trans "Total RAM" %}</strong> <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> <span class="pull-right">{{ used }} of {{ quota }} MB Used</span>
{% endblocktrans %} {% endblocktrans %}
</div> </div>

View File

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

View File

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

View File

@ -1,7 +1,7 @@
{% load i18n %} {% load i18n %}
<div class='description'> <div class='description'>
{% blocktrans %} {% blocktrans trimmed %}
Resize the canvas by scrolling up/down with your mouse/trackpad on the topology. 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. Pan around the canvas by clicking and dragging the space behind the topology.
{% endblocktrans %} {% endblocktrans %}
@ -17,5 +17,7 @@
</div> </div>
</div> </div>
<div id="topologyCanvasContainer" class="d3-container"> <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> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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