Ticket #3122: 0001-fix-gettext-strings-problem.patch

File 0001-fix-gettext-strings-problem.patch, 8.3 KB (added by AlanJAS, 11 years ago)

patch to fix problem

  • activity.py

    From 592eafa5ec19b3c7f3d998680fb66bdfa323ce85 Mon Sep 17 00:00:00 2001
    From: Alan Aguiar <alanjas@hotmail.com>
    Date: Sat, 15 Dec 2012 06:28:54 -0200
    Subject: [PATCH] fix gettext strings problem
    
    ---
     activity.py                     | 6 ++++--
     ep_colorconstraint_gray.py      | 2 +-
     ep_colorconstraint_none.py      | 8 ++++----
     ep_modifier_rectangulartile.py  | 4 ++--
     ep_sampler_affineifs.py         | 6 +++---
     ep_sampler_fermatspiral.py      | 7 ++++---
     ep_sampler_logarithmicspiral.py | 7 ++++---
     ep_sampler_rectilineargrid.py   | 4 ++--
     ep_sampler_squaregrid.py        | 4 ++--
     9 files changed, 26 insertions(+), 22 deletions(-)
    
    diff --git a/activity.py b/activity.py
    index 143ef6f..61442bd 100644
    a b class KandidActivity(activity.Activity): 
    190190        my_nick, my_csh = self._get_my_id()
    191191        self._status.set(ka_status.TOPIC_COLLABORATION,
    192192                         ka_status.SUB_ID,
    193                          _("I am '%s', my handle in that group is %u.") % (my_nick, my_csh))
     193                         _("I am '%(nick)s', my handle in that group is %(csh)u.") \
     194                                % {'nick': my_nick, 'csh': my_csh})
    194195 
    195196
    196197    def _sharing_setup(self):
    class KandidActivity(activity.Activity): 
    237238        my_nick, my_csh = self._get_my_id()
    238239        self._status.set(ka_status.TOPIC_COLLABORATION,
    239240                         ka_status.SUB_ID,
    240                          _("I am '%s', my handle in that group is %u.") % (my_nick, my_csh))
     241                         _("I am '%(nick)s', my handle in that group is %(csh)u.") \
     242                                                % {'nick': my_nick, 'csh': my_csh})
    241243
    242244        #TODO If a tube already exist, use it.
    243245        ka_debug.info('This is not my activity: waiting for a tube...')
  • ep_colorconstraint_gray.py

    diff --git a/ep_colorconstraint_gray.py b/ep_colorconstraint_gray.py
    index 78c5902..8e3e48b 100644
    a b class GrayColorConstraint(model_locus.Locus): 
    5858        pre: len(rgba) == 4
    5959        """
    6060        if alpha:
    61             return _('%d%% gray, %d%% opaque') % (100*rgba[0], 100*rgba[3])
     61            return _('%(gray)d%% gray, %(opaque)d%% opaque') % {'gray': 100*rgba[0], 'opaque': 100*rgba[3]}
    6262        else:
    6363            return _('Color is reduced to shades of gray, %d%% gray') % (100*rgba[0])
  • ep_colorconstraint_none.py

    diff --git a/ep_colorconstraint_none.py b/ep_colorconstraint_none.py
    index 753f865..b407318 100644
    a b class NoneColorConstraint(model_locus.Locus): 
    6464        pre: len(rgba) == 4
    6565        """
    6666        if alpha:
    67             return _('%d%% red, %d%% green, %d%% blue, %d%% opaque') \
    68                          % (100*rgba[0], 100*rgba[1], 100*rgba[2], 100*rgba[3])
     67            return _('%(red)d%% red, %(green)d%% green, %(blue)d%% blue, %(opaque)d%% opaque') \
     68                   % {'red': 100*rgba[0], 'green': 100*rgba[1], 'blue': 100*rgba[2], 'opaque': 100*rgba[3]}
    6969        else:
    70             return _('%d%% red, %d%% green, %d%% blue') \
    71                          % (100*rgba[0], 100*rgba[1], 100*rgba[2])
     70            return _('%(red)d%% red, %(green)d%% green, %(blue)d%% blue') \
     71                         % {'red': 100*rgba[0], 'green': 100*rgba[1], 'blue': 100*rgba[2]}
  • ep_modifier_rectangulartile.py

    diff --git a/ep_modifier_rectangulartile.py b/ep_modifier_rectangulartile.py
    index 62494bc..0355f2f 100644
    a b class RectangularTileModifier(model_allele.Allele): 
    112112                ctx.restore()
    113113
    114114    def explain(self, task, formater, single_layer, single_treenode):
    115         formater.text_item(_('Rectangular tile modifier: %d*x, %d*y')
    116                                                % (self.x_tiles, self.y_tiles))
     115        formater.text_item(_('Rectangular tile modifier: %(x_tiles)d*x, %(y_tiles)d*y')
     116                                               % {'x_tiles': self.x_tiles, 'y_tiles': self.y_tiles})
    117117        single_layer.explain(formater)
    118118        single_treenode.explain(task, formater)
    119119       
  • ep_sampler_affineifs.py

    diff --git a/ep_sampler_affineifs.py b/ep_sampler_affineifs.py
    index d2efe9a..060afc3 100644
    a b class AffineIfsSampler(model_allele.Allele): 
    467467        post: len(__return__) == 3
    468468        """
    469469        head = _('Affine iterated function system sampler')
    470         details = _('iterations=%d, transformations=%d symmetry=%d, Dn=%d: ')
    471         details = details % (self.orbits, self.num_transformations,
    472                              self.symmetry, self.Dn)
     470        details = _('iterations=%(iters)d, transformations=%(trans)d symmetry=%(sym)d, Dn=%(dn)d: ')
     471        details = details % {'iters': self.orbits, 'trans': self.num_transformations,
     472                             'sym': self.symmetry, 'dn': self.Dn}
    473473        return ka_utils.explain_points(head + ' ' + details + ': ',
    474474                                       self.get_sample_points())
    475475
  • ep_sampler_fermatspiral.py

    diff --git a/ep_sampler_fermatspiral.py b/ep_sampler_fermatspiral.py
    index 05ef68d..7be08c4 100644
    a b class FermatSpiralSampler(model_allele.Allele): 
    164164        """
    165165        post: len(__return__) == 3
    166166        """
    167         head = _("Fermat's spiral sampler: center=%f,%f, start steps=%d, end steps=%d, radian=%f, scaling=%f") \
    168                                     % (self.x_center, self.y_center,
    169                                        self.start, self.end, self.angle, self.c)
     167        head = _("Fermat's spiral sampler: center=%(x_center)f,%(y_center)f, \
     168                start steps=%(start)d, end steps=%(end)d, radian=%(rad)f, scaling=%(scaling)f") \
     169                     % {'x_center': self.x_center, 'y_center': self.y_center,
     170                        'start': self.start, 'end': self.end, 'rad': self.angle, 'scaling': self.c}
    170171        return ka_utils.explain_points(head, self.get_sample_points())
    171172
    172173    def copy(self):
  • ep_sampler_logarithmicspiral.py

    diff --git a/ep_sampler_logarithmicspiral.py b/ep_sampler_logarithmicspiral.py
    index df9917e..a29c518 100644
    a b class LogarithmicSpiralSampler(model_allele.Allele): 
    176176        """
    177177        post: len(__return__) == 3
    178178        """
    179         head = _('Logarithmic spiral sampler: center=%f,%f, revolutions=%f, steps per revolution=%d, a=%f, b=%f') \
    180                                     % (self.x_center, self.y_center,
    181                                        self.turns, self.steps, self.a, self.b)
     179        head = _('Logarithmic spiral sampler: center=%(x_center)f,%(y_center)f,\
     180                  revolutions=%(rev)f, steps per revolution=%(steps)d, a=%(a)f, b=%(b)f') \
     181                    % {'x_center': self.x_center, 'y_center': self.y_center,
     182                       'rev': self.turns, 'steps': self.steps, 'a': self.a, 'b': self.b}
    182183        return ka_utils.explain_points(head, self.get_sample_points())
    183184
    184185    def copy(self):
  • ep_sampler_rectilineargrid.py

    diff --git a/ep_sampler_rectilineargrid.py b/ep_sampler_rectilineargrid.py
    index f239cf7..f2f1804 100644
    a b class RectilinearGridSampler(model_allele.Allele): 
    114114        """
    115115        post: len(__return__) == 3
    116116        """
    117         head = _('Rectilinear grid sampler: %d*x, %d*y') \
    118                                             % (self.x_tiles, self.y_tiles)
     117        head = _('Rectilinear grid sampler: %(x_tiles)d*x, %(y_tiles)d*y') \
     118                                % {'x_tiles': self.x_tiles, 'y_tiles': self.y_tiles}
    119119        return ka_utils.explain_points(head, self.get_sample_points())
    120120
    121121    def copy(self):
  • ep_sampler_squaregrid.py

    diff --git a/ep_sampler_squaregrid.py b/ep_sampler_squaregrid.py
    index a4a7f82..0875501 100644
    a b class SquareGridSampler(model_allele.Allele): 
    9797        """
    9898        post: len(__return__) == 3
    9999        """
    100         head = _('Squarish grid sampler: %d*%d') \
    101                                             % (self.tiles, self.tiles)
     100        head = _('Squarish grid sampler: %(tiles)d*%(tiles)d') \
     101                                            % {'tiles': self.tiles}
    102102        return ka_utils.explain_points(head, self.get_sample_points())
    103103
    104104    def copy(self):