10 Feb 15:38
[PATCH Record] Use named parameters in gettext strings
<godiard <at> sugarlabs.org>
2012-02-10 14:38:53 GMT
2012-02-10 14:38:53 GMT
From: Gonzalo Odiard <godiard <at> gmail.com>
When there are more than one parameter with the same type
gettext need named parameters to enable the translators to change
the order if needed.
Pootle server complain about this format strings in Record activity,
and you can see the same error doing "./setup.py genpot"
Signed-off-by: Gonzalo Odiard <gonzalo <at> laptop.org>
---
glive.py | 3 ++-
model.py | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/glive.py b/glive.py
index fd9a5af..413dc60 100644
--- a/glive.py
+++ b/glive.py
@@ -393,7 +393,8 @@ class Glive:
stringType = constants.MEDIA_INFO[type]['istr']
# Translators: photo by photographer, e.g. "Photo by Mary"
- tl[gst.TAG_TITLE] = _('%s by %s') % (stringType, self.model.get_nickname())
+ tl[gst.TAG_TITLE] = _('%(type)s by %(name)s') % {'type': cstringType,
+ 'name': self.model.get_nickname()}
return tl
def blockedCb(self, x, y, z):
diff --git a/model.py b/model.py
index 884325b..d47671c 100644
(Continue reading)
RSS Feed