Cannot translate help message of add/edit rule form in network qos panel

Bug #2037875 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki

Bug Description

The help message of the add-rule/edit-rule form of the network QoS panel.

More specifically, translations are NOT shown for the following paragraphs only, while the help message contains other paragraphs.

---
The maximum KBPS (kilobits per second) value. If you specify this value, must be greater than 0 otherwise max_kbps will have no value.

The maximum burst size (in kilobits). Default is 0.
---

Tags: i18n
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Looking at the corresponding file [1], <translate> tag is nested.
I wonder this is the reason these paragraphs does not show translated messages even when they are translated. As a result, strings used when translations are picked up does not match strings when extracted into PO/POT files.

[1] https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/static/app/core/network_qos/actions/rule.description.html#L6-L12

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Akihiro Motoki (amotoki) wrote :

The part discussed in rule.description.html is as follows:
---
<p translate>
    The maximum KBPS (kilobits per second) value.
    If you specify this value, must be greater than 0 otherwise max_kbps will have no value.
    <p translate>
        The maximum burst size (in kilobits). Default is 0.
    </p>
</p>
---

On the other hand, the corresponding part rendered (in Chrome) are:
---
<p translate class="ng-scope">
  "The maximum KBPS (kilobits per second) value. If you specify this value, must be greater than 0 otherwise max_kbps will have no value."
</p>
<p translate class="ng-scope">The maximum burst size (in kilobits). Default is 0.</p>
<p class="ng-scope"/>
---

These two are apparently different and the rendered text is used for translation lookup.
That is the reason that the bug here happens.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/horizon/+/896976

Changed in horizon:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/c/openstack/horizon/+/896976
Committed: https://opendev.org/openstack/horizon/commit/d31bf685799a07d9c6aa4305ac7399b267eed43c
Submitter: "Zuul (22348)"
Branch: master

commit d31bf685799a07d9c6aa4305ac7399b267eed43c
Author: Akihiro Motoki <email address hidden>
Date: Sun Oct 1 17:25:08 2023 +0900

    i18n: nested <translate> tag does not work

    rule.description.html in network QoS panel used <translated> tag
    in a nested way. As a result, strings used when looking up in a PO file
    does not match strings extracted into POT file. See [1] for details.
    This commit adjusts the help message without nested <translate> tag.

    [1] https://bugs.launchpad.net/horizon/+bug/2037875/comments/2

    Closes-Bug: #2037875
    Change-Id: I146e45681a29cb264fa40898cfc5f636143b2701

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 23.4.0

This issue was fixed in the openstack/horizon 23.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.