Remove test string from translation files

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

Bug Description

To test dashboard customisations, we have a few Cats and Dogs dashboard in the tests:

https://github.com/openstack/horizon/tree/master/horizon/test/test_dashboards
https://github.com/openstack/horizon/tree/master/horizon/test/customization

We should remove the i18n strings from the test files and make them regular strings instead, as otherwise they show up in the PO message files and create unnecessary work for the translators.

Julie Pichon (jpichon)
Changed in horizon:
importance: Undecided → Medium
Changed in horizon:
status: New → Confirmed
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Is it better to remove all I18N string from the unit tests?

By grepping the code, I found many _(xxx) in test directories.
For example, please run "grep -r '_(' horizon/test".

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

After grepping the code, I found out it is really small fix. I take it.

for dir in horizon openstack_dashboard; do
  grep '_(' `find $dir -type f | grep test` | grep -v '__('
  grep 'trans' `find $dir -type f | grep test` | grep -v '__('
done

Revision history for this message
Floren (florenllanos) wrote :

In *.po files are the file reference where the string are replaced. We can follow this references for tests files to make the changes. Finally we can find, with grep like Akihiro says, in files directly if all have been done succesfully.

Changed in horizon:
assignee: nobody → floren (florenllanos)
Akihiro Motoki (amotoki)
Changed in horizon:
assignee: floren (florenllanos) → Akihiro Motoki (amotoki)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Hi floren,

It seems I took the bug just after you assigned yourself. I clicked "assign me" without reloading the page :-(

Do you already have a fix? I already have and confirm it works. If not, i will post the fix.

Revision history for this message
Floren (florenllanos) wrote :

Don't worry Akihiro :-)

Post you the fix.

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/45382

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

Reviewed: https://review.openstack.org/45382
Committed: http://github.com/openstack/horizon/commit/a2d6c1f1434b5e529b2a902c3e75003bbb7f2aa5
Submitter: Jenkins
Branch: master

commit a2d6c1f1434b5e529b2a902c3e75003bbb7f2aa5
Author: Akihiro MOTOKI <email address hidden>
Date: Fri Sep 6 14:13:37 2013 +0900

    Remove test string from translation files

    Closes-Bug: #1221123

    Removing unnecessary translation strings reduces translation work.
    String Freeze is enabled so this patch also update en PO files.

    Change-Id: Ie69c8d0b990e53678262457094852b1ef4966b8b

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → havana-rc1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-rc1 → 2013.2
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.