use correct function for plural forms translation

This commit is contained in:
Yann Leboulanger 2009-10-29 15:00:48 +01:00
parent fcafab60a7
commit b682cc1791
2 changed files with 9 additions and 8 deletions

View File

@ -27,6 +27,7 @@ import gobject
import gtkgui_helpers
from common import helpers
from common import i18n
class AtomWindow:
window = None
@ -106,9 +107,10 @@ class AtomWindow:
changed...'''
count = len(self.__class__.entries)
if count>0:
self.new_entry_label.set_text(
_('You have received new entries (and %(count)d not displayed):') %\
{'count': count})
self.new_entry_label.set_text(i18n.ngettext(
'You have received new entries (and %d not displayed):',
'You have received new entries (and %d not displayed):', count,
count, count))
self.next_button.set_sensitive(True)
else:
self.new_entry_label.set_text(_('You have received new entry:'))

View File

@ -43,6 +43,7 @@ import gtkgui_helpers
from common import gajim
from common import helpers
from common import latex
from common import i18n
from calendar import timegm
from common.fuzzyclock import FuzzyClock
@ -1270,12 +1271,10 @@ class ConversationTextview(gobject.GObject):
int(timegm(tim)) / 86400
if diff_day == 0:
day_str = ''
elif diff_day == 1:
day_str = _('Yesterday')
else:
#the number is >= 2
# %i is day in year (1-365), %d (1-31) we want %i
day_str = _('%i days ago') % diff_day
#%i is day in year (1-365)
day_str = i18n.ngettext('Yesterday', '%i days ago', diff_day,
replace_plural=diff_day)
if day_str:
format += day_str + ' '
timestamp_str = gajim.config.get('time_stamp')