Project

General

Profile

Bug #2495

Paginator does not properly pluralize when more than one organization exists.

Added by Bryan Kearney about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internationalization
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Description of problem:
If more than one org exists, and user goes to org view in foreman, the counter on the org view reads incorrectly.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a new org in katello, "Second_Org"
2. Navigate to Org view in /foreman
3. View summary box below the org list

Actual results:

Displaying all 2 Organization

Expected results:

Displaying all 2 Organization(s)

Additional info:

See https://bugzilla.redhat.com/show_bug.cgi?id=961595


Related issues

Has duplicate Foreman - Bug #2534: paginator has i18n issuesDuplicate2013-05-21

Associated revisions

Revision 1bf7cc35 (diff)
Added by Amos Benari about 6 years ago

fixed #2534 fixes #2495 paginator has i18n issues

Revision ce81cfda (diff)
Added by Amos Benari about 6 years ago

fixed #2534 fixes #2495 paginator has i18n issues
(cherry picked from commit 1bf7cc358e00092d2cee38cc83cb753ed31ffa89)

History

#1 Updated by Bryan Kearney about 6 years ago

  • Target version changed from Bug scrub to 1.3.0

#2 Updated by Dominic Cleal about 6 years ago

There are a number of issues with will_paginate, as both the strings we pass to it (i.e. model names, "Selected" etc) need translation with pluralisation, as do the strings it uses internally.

In case it helps the next person, I was looking into the internal strings it uses, which are based on Rails i18n (we use gettext_i18n_rails instead). I was trying to extract them with gettext by adding the i18n keys to a ruby file underneath locale/, which the extractor would then find, e.g.

# TRANSLATORS: ← Previous
N_('will_paginate.previous_label')

And also adding the English to the en/foreman.po file.

It didn't work though with pluralisation in the way I expected and I didn't solve this at the time. The plural support had only just been added to the Rails i18n to gettext_i18n_rails bridge inside the latter project, so note that you need the very latest version I think for it to even work. I was trying to do this:

# TRANSLATORS: 0: "No %{model} found" 
# 1: "Displaying 1 %{model}" 
# 2+: "Displaying all %{count} %{model}" 
Nn_('will_paginate.page_entries_info.single_page', 'will_paginate.page_entries_info.single_page.plural')

And then adding the originals to en/foreman.po again.

#3 Updated by Dominic Cleal about 6 years ago

  • Subject changed from Foreman UI does not properly pluralize when more than one organization exists. to Paginator does not properly pluralize when more than one organization exists.

#4 Updated by Dominic Cleal about 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Amos Benari

#5 Updated by Dominic Cleal about 6 years ago

  • Target version changed from 1.3.0 to 1.2.0

#6 Updated by Amos Benari about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF