Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.4, 2.0.5, and 2.1

stable i18n: add support for plural forms

Changeset bc05d42a6ee1

Parent 898510895102

by Andrei Polushin

Changes to 2 files · Browse files at bc05d42a6ee1 Showing diff from parent 898510895102 Diff from another changeset...

 
6
7
8
 
9
10
11
12
13
 
 
 
14
15
16
 
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@@ -6,11 +6,15 @@
 # GNU General Public License version 2, incorporated herein by reference.    from tortoisehg.util.i18n import _ as _gettext +from tortoisehg.util.i18n import ngettext as _ngettext  from tortoisehg.util.i18n import agettext    def _(message, context=''):   return unicode(_gettext(message, context), 'utf-8')   +def ngettext(singular, plural, n): + return unicode(_ngettext(singular, plural, n), 'utf-8') +  class localgettext(object):   def _(self, message, context=''):   return agettext(message, context='')
 
60
61
62
 
 
 
63
64
65
 
60
61
62
63
64
65
66
67
68
@@ -60,6 +60,9 @@
  return tmsg   return t.gettext(message)   +def ngettext(singular, plural, n): + return t.ngettext(singular, plural, n) +  def agettext(message, context=''):   """Translate message and convert to local encoding   such as 'ascii' before being returned.