Hard to translate "Displaying %s of %s items" (cannot control the order of substitutions)

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

Bug Description

horizon/locale/djangojs.pot has the following string.

#: static/framework/util/filters/filters.js:177
#, python-format
msgid "Displaying %s of %s items"
msgstr ""

In some languages, there is a need to swap the order of the two %s.
%s should be replaced by %(keyword)s (keyword substitution).

The current horizon/static/framework/util/filters/filters.js is as follows:

    176 var total = ensureNonNegative(totalInput);
    177 var format = gettext('Displaying %s of %s items');
    178 return interpolate(format, [count, total]);

L.177 should be:

     var format = gettext('Displaying %(count)s of %(total)s items');

Tags: i18n
Changed in horizon:
status: New → In Progress
Revision history for this message
Akihiro Motoki (amotoki) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/223432
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=917ae1e8e9a67e0055f7552d38e21e324f9bab8e
Submitter: Jenkins
Branch: master

commit 917ae1e8e9a67e0055f7552d38e21e324f9bab8e
Author: Akihiro Motoki <email address hidden>
Date: Tue Sep 15 15:31:26 2015 +0900

    Use keyword substitution in horizon framework filters.js

    Keyword substitution is important for translators.
    It allows them to control the word order natural to their language.

    Change-Id: I0649cb079d2c928bbdf99e037aabb4c318da488c
    Closes-Bug: #1495815

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-rc1 → 8.0.0
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.