Some long strigs are not translated

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

Bug Description

In https://bugs.launchpad.net/horizon/+bug/1592965, extracted messages are stored with trimming. Because of this change, some strings like written with multi line won't be translated.

Tags: i18n
Kenji Ishii (ken-ishii)
Changed in horizon:
assignee: nobody → Kenji Ishii (ken-ishii)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/347725

Changed in horizon:
status: New → In Progress
Revision history for this message
Kenji Ishii (ken-ishii) wrote :

As far as I try, it seems to be difficult to address this issue with not reverting babel_extract_angular.py.
If we do under that situation, we have to replace the value of element.html() to the value of message defined as a msg_id in pot file. However, these processes are done by angular-gettext(maybe below *1)
(*1)https://github.com/rubenv/angular-gettext/blob/master/dist/angular-gettext.js#L446

On the other hand, I found that when msd_id include a 'li' tag, element.html() doesn't work well.
In *1, when I see the value of msg_id includeing 'li' tag, this value is empty.

 Expected: '<li><b>Image</b>xxxx</il>' -> Actually: ''
 Expected: 'yyyy<li><b>Image</b>xxxx</il>' -> Actually: 'yyyy'

we also need to address this.

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

Could you share more concrete example? 'some strings' in the bug description is too ambiguous.

The fix for bug 1592965 may contain some possible bug, I cannot say it is a regression of the fix for bug 15929265 or you hit some potential bug.

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

Regarding gettext-angular related thing in #3, I think it is a bug of angular-gettext.

In theory, when looking up for a translated string the extraction logic should be applied.

Revision history for this message
Kenji Ishii (ken-ishii) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Kenji Ishii (<email address hidden>) on branch: master
Review: https://review.openstack.org/347725
Reason: This patch was for #1561558 and #1606837.
Now, there are each patches for their issues, so this patch is already nnecessary.

https://review.openstack.org/#/c/349442/
https://review.openstack.org/#/c/349758/

Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → High
milestone: none → newton-3
Changed in horizon:
assignee: Kenji Ishii (ken-ishii) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/349758
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=5e00cc5e92f86264e428443e7776716c657d247a
Submitter: Jenkins
Branch: master

commit 5e00cc5e92f86264e428443e7776716c657d247a
Author: Kenji Ishii <email address hidden>
Date: Tue Aug 2 11:26:14 2016 +0900

    Revert "i18n: trim whitespaces in extracted messages"

    This reverts commit f87b58fcabf84c9b73b07b587416cc0b6cc814b1.
    In https://bugs.launchpad.net/horizon/+bug/1592965,
    extracted messages are stored with trimming.
    After this change, strings with multi lines cannot be translated.

    This change cause the difference between the real strings in html
    and a key in pot, from the view point of extra spaces and break lines.
    Message extraction is done by babel (with horizon specific extractor),
    but translation message lookup is done by angular-gettext.
    As a result, a key used in translation lookup becomes different from
    a key generated by the message extraction.
    Keys in both steps should be same.
    So this patch reverts the corresponding commit to make translation
    work, even though it may be annoying for translators again.

    Regarding the comment from i18n perspective, see Akihiro's comment
    in patch set 3 in https://review.openstack.org/#/c/347725

    Closes-Bug: #1606837
    Change-Id: I651a2f39fdc0209f702cb9cf45691c944382b897

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b3

This issue was fixed in the openstack/horizon 10.0.0.0b3 development milestone.

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.