Changeset 4187d41 in osmose-backend


Ignore:
Timestamp:
Oct 30, 2014 10:50:26 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
18f08eb
Parents:
59561fe
Message:

Make it possible to translate subtitle in plugins Date, Number, Structural_DuplicateNodes

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/Date.py

    r9871844 r4187d41  
    8080                    for d in tags[i].split('..'): 
    8181                        if not self.check(d): 
    82                             return [(3090, 2, {"fr": u"Date \"%s\" incorrecte" % d, "en": u"Bad date \"%s\"" % d})] 
     82                            return [(3090, 2, T_(u"Incorrect date \"%s\"", d))] 
    8383                elif not self.check(tags[i]): 
    84                     return [(3090, 1, {"fr": u"Date \"%s\" incorrecte" % tags[i], "en": u"Bad date \"%s\"" % tags[i]})] 
     84                    return [(3090, 1, T_(u"Incorrect date \"%s\"", tags[i]))] 
    8585 
    8686    def way(self, data, tags, nds): 
  • plugins/Number.py

    r02081f1 r4187d41  
    3838                m = self.Number.match(tags[i]) 
    3939                if not m and not (i=="width" and tags[i]=="narrow") and not (i=="maxspeed" and (tags[i] in self.MaxspeedExtraValue or self.MaxspeedClassValue.match(tags[i]))): 
    40                     return [(3091, 1, {"fr": u"Nombre \"%s\" incorrect" % tags[i], "en": u"Bad number \"%s\"" % tags[i]})] 
     40                    return [(3091, 1, T_(u"Incorrect number \"%s\"", tags[i]))] 
    4141                elif m and i=="height" and float(m.group(1)) > 500: 
    4242                    return [(3091, 2, {"fr": u"C'est très haut %s, voir ele=*" % m.group(1), "en": u"%s is really tall, look at ele=*" % m.group(1), "fix": {"-": ["height"], "+": {"ele": tags["height"]}} })] 
    4343                elif m and i=="maxspeed" and float(m.group(1)) < 5 and not "waterway" in tags: 
    44                     return [(3091, 3, {"fr": u"C'est très lent %s" % m.group(1), "en": u"%s is really slow" % m.group(1)})] 
     44                    return [(3091, 3, T_(u"%s is really slow", m.group(1)))] 
    4545 
    4646    def way(self, data, tags, nds): 
  • plugins/Structural_DuplicateNodes.py

    r59561fe r4187d41  
    3434            for n in set(nds): 
    3535                if nds.count(n) > 1: 
    36                     rep.append(u"nœud #" + str(n) + u" x " + str(nds.count(n))) 
    37             return [(103, 0, {"en": u", ".join(rep)})] 
     36                    rep.append(u"#" + str(n) + u" x " + str(nds.count(n))) 
     37            return [(103, 0, T_("nodes: %s", u", ".join(rep)))] 
    3838 
    3939########################################################################### 
  • po/osmose-backend.pot

    rb96b9fe r4187d41  
    10501050msgid "Bad tag %(k)s=%(v)s" 
    10511051msgstr "" 
     1052 
     1053#: ../plugins/Date.py:82 ../plugins/Date.py:84 
     1054#, python-format 
     1055msgid "Incorrect date \"%s\"" 
     1056msgstr "" 
     1057 
     1058#: ../plugins/Number.py:40 
     1059#, python-format 
     1060msgid "Incorrect number \"%s\"" 
     1061msgstr "" 
     1062 
     1063#: ../plugins/Number.py:44 
     1064#, python-format 
     1065msgid "%s is really slow" 
     1066msgstr "" 
     1067 
     1068#: ../plugins/Structural_DuplicateNodes.py:37 
     1069#, python-format 
     1070msgid "nodes: %s" 
     1071msgstr "" 
Note: See TracChangeset for help on using the changeset viewer.