← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1390167] [NEW] BatchAction pluralization never counts the items

 

Public bug reported:

Looking more closely at BatchAction it seems that it never really counts
the number of items are the passed in.  Instead it will choose a
translations based on either the number 1 (if no items are passed in),
or the number 6 (because that's the number of letters in 'plural').

For some languages, like Russian, and I think Polish, there should be
different translations used for describing 2 or 6 items.

We should make sure that when there is a known number of items we use
that in the BatchAction lookups.  We probably shouldn't have _any_
references to singular and plural in the code once this is done.

I'm looking at
horizon/tables/actions.py
def _get_action_name(self, items=None, past=False):

and the calls to it like
self.verbose_name_plural = kwargs.get(
'verbose_name_plural',
lambda: self._get_action_name('plural'))

and especially the call in update
 self.verbose_name_plural = self._get_action_name('plural')

** Affects: horizon
     Importance: Undecided
         Status: New


** Tags: i18n

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1390167

Title:
  BatchAction pluralization never counts the items

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Looking more closely at BatchAction it seems that it never really
  counts the number of items are the passed in.  Instead it will choose
  a translations based on either the number 1 (if no items are passed
  in), or the number 6 (because that's the number of letters in
  'plural').

  For some languages, like Russian, and I think Polish, there should be
  different translations used for describing 2 or 6 items.

  We should make sure that when there is a known number of items we use
  that in the BatchAction lookups.  We probably shouldn't have _any_
  references to singular and plural in the code once this is done.

  I'm looking at
  horizon/tables/actions.py
  def _get_action_name(self, items=None, past=False):

  and the calls to it like
  self.verbose_name_plural = kwargs.get(
  'verbose_name_plural',
  lambda: self._get_action_name('plural'))

  and especially the call in update
   self.verbose_name_plural = self._get_action_name('plural')

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1390167/+subscriptions


Follow ups

References