[gcompris] i18n, fixed intltool warnings
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] i18n, fixed intltool warnings
- Date: Mon, 10 Sep 2012 22:02:40 +0000 (UTC)
commit 2dcfe52292202a75f4c30ed15dce8e3d68ae6c26
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Tue Sep 11 00:01:06 2012 +0200
i18n, fixed intltool warnings
We had some unamed positional params that are not swappable.
This breaks translator ability to make a clean translation.
src/gnumch-equality-activity/gnumch.py | 20 ++++++++++----------
src/guessnumber-activity/guessnumber.py | 5 +++--
src/login-activity/login.py | 4 ++--
src/missing_letter-activity/missingletter.c | 4 ++--
4 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/gnumch-equality-activity/gnumch.py b/src/gnumch-equality-activity/gnumch.py
index 67f6ee0..b4679ca 100644
--- a/src/gnumch-equality-activity/gnumch.py
+++ b/src/gnumch-equality-activity/gnumch.py
@@ -112,7 +112,7 @@ class PrimeLevelset:
self.cur_sublevel = 1
def getError(self, num):
- fmt = _('%d is divisible by %s.')
+ fmt = _('{0} is divisible by {1}.')
n = int(num.text)
if n == 1:
@@ -123,7 +123,7 @@ class PrimeLevelset:
if n % i == 0:
factors.append(i)
s = makeNumList(factors) % tuple(factors)
- return fmt % (n,s)
+ return fmt.format(str(n), s)
def getTitle(self):
return _('Primes less than %d') % ( self.level_max[self.cur_sublevel-1] + 1 )
@@ -192,7 +192,7 @@ class MultipleLevelset:
self.cur_sublevel = 1
def getError(self, num):
- fmt = _('%s are the factors of %d.')
+ fmt = _('{0} are the factors of {1}.')
n = int(num.text)
factors = []
@@ -201,7 +201,7 @@ class MultipleLevelset:
factors.append(i)
factors.append(n)
s = makeNumList(factors) % tuple(factors)
- return fmt % (s, n)
+ return fmt.format(s, str(n))
def getTitle(self):
return _('Multiples of %d') % ( self.cur_sublevel+1 )
@@ -238,8 +238,8 @@ class ExpressionLevelset(object):
self.cur_sublevel = 1
def getError(self, num):
- fmt = _('%s = %d')
- return fmt % (num.text, num.value)
+ fmt = _('{0} = {1}')
+ return fmt.format(num.text, str(num.value))
def getNumberWithAnswer(self, answer):
fn = random.choice( self.levelops[self.curlevel-1] )
@@ -249,21 +249,21 @@ class ExpressionLevelset(object):
def getPlus(self, answer):
n = random.randint(0, answer)
- num = Number( _(u'%d + %d') % (n, answer-n), 1 )
+ num = Number( _(u'{0} + {1}').format(str(n), str(answer-n)), 1 )
return num
def getMinus(self, answer):
n = random.randint(answer, answer*2)
- num = Number( _(u'%d \u2212 %d') % (n, n-answer), 1 )
+ num = Number( _(u'{0} \u2212 {1}').format(str(n), str(n-answer)), 1 )
return num
def getTimes(self, answer):
n = random.choice( getFactors(answer) )
- return Number( _(u'%d \u00d7 %d') % (n, answer/n), 1 )
+ return Number( _(u'{0} \u00d7 {1}').format(str(n), str(answer/n)), 1 )
def getDivide(self, answer):
n = random.randint(1, 5)
- return Number( _(u'%d \u00f7 %d') % (answer*n, n), 1 )
+ return Number( _(u'{0} \u00f7 {1}').format(str(answer*n), str(n)), 1 )
class EqualityLevelset(ExpressionLevelset):
def __init__(self):
diff --git a/src/guessnumber-activity/guessnumber.py b/src/guessnumber-activity/guessnumber.py
index 1c41000..96a0a45 100644
--- a/src/guessnumber-activity/guessnumber.py
+++ b/src/guessnumber-activity/guessnumber.py
@@ -200,7 +200,7 @@ class Gcompris_guessnumber:
# Select the number to find
self.solution = random.randint(self.min, self.max)
- text = _("Guess a number between %d and %d") %(self.min, self.max)
+ text = _("Guess a number between {0} and {1}").format(self.min, self.max)
goocanvas.Text(
parent = self.rootitem,
@@ -303,7 +303,8 @@ class Gcompris_guessnumber:
try:
number = int(text)
except:
- self.indicator.props.text = _("Please enter a number between %d and %d") %(self.min, self.max)
+ self.indicator.props.text = \
+ _("Please enter a number between {0} and {1}").format(self.min, self.max)
widget.set_text('')
return
diff --git a/src/login-activity/login.py b/src/login-activity/login.py
index 57e1533..7bd673b 100644
--- a/src/login-activity/login.py
+++ b/src/login-activity/login.py
@@ -477,8 +477,8 @@ class Gcompris_login:
#we can add what you want in it.
bconf = gcompris.configuration_window ( \
- _('<b>%s</b> configuration\n for profile <b>%s</b>')
- % ('Login', ( profile.name if profile else "" ) ),
+ _('<b>{0}</b> configuration\n for profile <b>{1}</b>')\
+ .format('Login', ( profile.name if profile else _("Default") ) ),
self.ok_callback
)
diff --git a/src/missing_letter-activity/missingletter.c b/src/missing_letter-activity/missingletter.c
index f9b61cf..0003d10 100644
--- a/src/missing_letter-activity/missingletter.c
+++ b/src/missing_letter-activity/missingletter.c
@@ -797,9 +797,9 @@ config_start(GcomprisBoard *agcomprisBoard,
_init(agcomprisBoard);
}
- gchar *label = g_strdup_printf(_("<b>%s</b> configuration\n for profile <b>%s</b>"),
+ gchar *label = g_strdup_printf(_("<b>%1$s</b> configuration\n for profile <b>%2$s</b>"),
agcomprisBoard->name,
- aProfile ? aProfile->name : "");
+ aProfile ? aProfile->name : _("Default"));
GcomprisBoardConf *bconf;
bconf = gc_board_config_window_display( label,
conf_ok);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]