[gcompris] explore, piano translation fixes.



commit 277f4325fc48d4e3b53e967b5306ee654844b18c
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Wed Nov 21 00:33:59 2012 +0100

    explore, piano translation fixes.
    
    When we use destop file, we set the keys to be translated as:
    _key = The english string
    
    But intltool pick the space in front of the "The" in the po file.
    But in python we get the string as "The english string" thus the
    translation does not match and is not displayed.
    
    Since I don't want to break the translations at this stage, I just
    added the " " in the python side for the keys we are putting this
    extra space all the time.

 src/explore-activity/explore.py                    |   18 ++++++++++++------
 .../piano_composition.py                           |    5 +++--
 2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/explore-activity/explore.py b/src/explore-activity/explore.py
index d5be49d..1ea7d40 100644
--- a/src/explore-activity/explore.py
+++ b/src/explore-activity/explore.py
@@ -293,7 +293,8 @@ dialogue to\nenable the sound."), None)
             # WRITE LOCATION-SPECIFIC CONTENT TO PAGE
             # ---------------------------------------------------------------------
 
-            name = _(self.data.get(sectionNum, '_title'))
+            # FIXME Should remove the space in the data file instead
+            name = _(" " + self.data.get(sectionNum, '_title'))
             goocanvas.Text(
               parent=self.location_rootitem,
               x=410,
@@ -305,7 +306,8 @@ dialogue to\nenable the sound."), None)
               use_markup=True
               )
 
-            text = _(self.data.get(sectionNum, '_text'))
+            # FIXME Should remove the space in the data file instead
+            text = _(" " + self.data.get(sectionNum, '_text'))
             t = goocanvas.Text(
               parent=self.location_rootitem,
               x=120,
@@ -491,11 +493,14 @@ dialogue to\nenable the sound."), None)
                 except: self.author = ''
                 try: self.locationPic = self.activityDataFilePath + self.data.get('common', 'locationpic')
                 except: errors.append("Missing 'locationpic' key")
-                try: self.generalText = _(self.data.get('common', '_GeneralText'))
+                # FIXME Should remove the space in the data file instead
+                try: self.generalText = _(" " + self.data.get('common', '_GeneralText'))
                 except: errors.append("Missing '_GeneralText' key")
-                try: self.SoundMatchingGameText = _(self.data.get('common', '_SoundMatchingGameText'))
+                # FIXME Should remove the space in the data file instead
+                try: self.SoundMatchingGameText = _(" " + self.data.get('common', '_SoundMatchingGameText'))
                 except:pass
-                try: self.TextMatchingGameText = _(self.data.get('common', '_TextMatchingGameText'))
+                # FIXME Should remove the space in the data file instead
+                try: self.TextMatchingGameText = _(" " + self.data.get('common', '_TextMatchingGameText'))
                 except:pass
                 try: self.backgroundx = int(self.data.get('common', 'backgroundx'))
                 except: errors.append("Missing 'backgroundx' key")
@@ -510,7 +515,8 @@ dialogue to\nenable the sound."), None)
                     self.allSoundClips.append( (self.data.get(section, 'music'), section))
                 except:
                     pass
-                self.allTextPrompts.append( ( _(self.data.get(section, '_shortPrompt')), section))
+                # FIXME Should remove the space in the data file instead
+                self.allTextPrompts.append( ( _(" " + self.data.get(section, '_shortPrompt')), section))
 
                 self.sectionNames.append(section)
 
diff --git a/src/piano_composition-activity/piano_composition.py b/src/piano_composition-activity/piano_composition.py
index c052525..8195c03 100644
--- a/src/piano_composition-activity/piano_composition.py
+++ b/src/piano_composition-activity/piano_composition.py
@@ -445,7 +445,8 @@ dialogue to\nenable the sound."), None)
                  y=y + 18,
                  width=250,
                  font = gcompris.skin.get_font("gcompris/board/tiny"),
-                 text= _(self.data.get(section, '_origin')),
+                 # FIXME Should remove the space in the data file instead
+                 text= _(" " + self.data.get(section, '_origin')),
                  fill_color="black",
                  use_markup=True
                  )
@@ -574,7 +575,7 @@ dialogue to\nenable the sound."), None)
                        x=150,
                        y=75,
                        width=280,
-                       text='<span weight="bold" >' + _(self.data.get(section, '_origin')) + '</span>',
+                       text='<span weight="bold" >' + _(" " + self.data.get(section, '_origin')) + '</span>',
                        fill_color="black",
                        use_markup=True,
                        alignment=pango.ALIGN_CENTER,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]