[gcompris/gcomprisbraille] Translatable strings for all activities|



commit e55b210e03a8f1b59a9b6de91c4d30d3b8c7fe85
Author: SrishAkaTux <srishakatux gmail com>
Date:   Thu Jul 28 01:01:19 2011 +0530

    Translatable strings for all activities|

 src/braille_alphabets-activity/BrailleChar.py      |    4 +-
 .../braille_alphabets.py                           |   18 ++++-
 src/dicey_dicey-activity/dicey_dicey.py            |    6 +-
 src/louis_braille-activity/louis_braille.py        |   19 +++---
 .../resources/louis_braille/activity.desktop       |   69 ++++++++++----------
 src/rhymes_riddles-activity/rhymes_riddles.py      |   43 ++++++------
 6 files changed, 84 insertions(+), 75 deletions(-)
---
diff --git a/src/braille_alphabets-activity/BrailleChar.py b/src/braille_alphabets-activity/BrailleChar.py
index 9369c26..8a44e10 100644
--- a/src/braille_alphabets-activity/BrailleChar.py
+++ b/src/braille_alphabets-activity/BrailleChar.py
@@ -71,8 +71,8 @@ class BrailleChar:
                           y=y,
                           width=width,
                           height=height,
-                          stroke_color=self.stroke,
-                          fill_color=self.fill,
+                          stroke_color = self.stroke,
+                          fill_color = self.fill,
                           line_width=2.0)
 
 
diff --git a/src/braille_alphabets-activity/braille_alphabets.py b/src/braille_alphabets-activity/braille_alphabets.py
index 6cc1b44..c5c3492 100644
--- a/src/braille_alphabets-activity/braille_alphabets.py
+++ b/src/braille_alphabets-activity/braille_alphabets.py
@@ -39,9 +39,9 @@ CIRCLE_STROKE = "blue"
 MAP_STROKE = "black"
 MAP_FILL = "light blue"
 
-braille_desc = _("A system of writing for the blinds that uses characters made of raised dots.\n\n"
- "The braille Cell is composed of 6 dot cells organized in form of two vertical columns with 3 dots"
- "{1,2,3} side by side on left and 3 dots side by side on right {4,5,6}")
+braille_intro = _("A system of writing for the blinds that uses characters made of raised dots.")
+braille_desc = _("The braille cell is composed of 6 dot cells organized in form of two vertical columns"
+                 " with 3 dots {1,2,3} side by side on left and 3 dots side by side on right {4,5,6}")
 
 #Array Declaration
 letter_arr_one = ['A','B','C','D','E','F','G']
@@ -177,16 +177,26 @@ class Gcompris_braille_alphabets:
                                  font="Sans 15",
                                  anchor=gtk.ANCHOR_CENTER,
                                  text=_("Braille : Unlocking the Code"))
+        #Braille Intro
+        goocanvas.Text(parent=self.rootitem,
+                                 x=520,
+                                 y=200,
+                                 fill_color="dark blue",
+                                 font="Sans 15",
+                                 width = 400,
+                                 anchor=gtk.ANCHOR_CENTER,
+                                 text=braille_intro)
         #Braille Description
         goocanvas.Text(parent=self.rootitem,
                                  x=520,
-                                 y=260,
+                                 y=300,
                                  fill_color="dark blue",
                                  font="Sans 15",
                                  width = 400,
                                  anchor=gtk.ANCHOR_CENTER,
                                  text=braille_desc)
 
+
         #TUX svghandle
         svghandle = gcompris.utils.load_svg("braille_alphabets/braille_tux.svgz")
         self.tuxitem = goocanvas.Svg(
diff --git a/src/dicey_dicey-activity/dicey_dicey.py b/src/dicey_dicey-activity/dicey_dicey.py
index 06bc397..6c74685 100644
--- a/src/dicey_dicey-activity/dicey_dicey.py
+++ b/src/dicey_dicey-activity/dicey_dicey.py
@@ -122,7 +122,7 @@ class Gcompris_dicey_dicey:
     goocanvas.Text(parent = self.rootitem,
                    x=400.0,
                    y=100.0,
-                   text="Dicey - Dicey",
+                   text=_("Dicey - Dicey"),
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
@@ -139,7 +139,7 @@ class Gcompris_dicey_dicey:
           ok = goocanvas.Svg(parent = self.rootitem,
                          svg_handle = gcompris.skin.svg_get(),
                          svg_id = "#OK",
-                         tooltip = "Click to confirm your selection of dots"
+                         tooltip = _("Click to confirm your selection of dots")
                          )
           ok.translate(40,-30)
           ok.connect("button_press_event", self.ok_event,level)
@@ -231,7 +231,7 @@ class Gcompris_dicey_dicey:
       goocanvas.Text(parent = self.rootitem,
                      x=300.0,
                      y=358.0,
-                     text="Choose an operator to indicate the question mark",
+                     text = _("Choose an operator to indicate the question mark"),
                      anchor = gtk.ANCHOR_CENTER,
                      font='SANS 12')
 
diff --git a/src/louis_braille-activity/louis_braille.py b/src/louis_braille-activity/louis_braille.py
index a3e2011..7d08244 100644
--- a/src/louis_braille-activity/louis_braille.py
+++ b/src/louis_braille-activity/louis_braille.py
@@ -119,7 +119,7 @@ class Gcompris_louis_braille:
           goocanvas.Text(parent = self.rootitem,
                    x=350.0,
                    y=33,
-                   text="Arrange the sequence of story",
+                   text = _("Arrange the sequence of story"),
                    fill_color="blue",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
@@ -128,7 +128,7 @@ class Gcompris_louis_braille:
           ok = goocanvas.Svg(parent = self.rootitem,
                          svg_handle = gcompris.skin.svg_get(),
                          svg_id = "#OK",
-                         tooltip = "Click to confirm your sequence"
+                         tooltip = _("Click to confirm your sequence")
                          )
           ok.translate(200,15)
           ok.connect("button_press_event", self.ok_event)
@@ -159,7 +159,7 @@ class Gcompris_louis_braille:
               goocanvas.Text(parent = self.rootitem,
                    x=350.0,
                    y=(index - 9) * 37.8,
-                   text=str(self.dataset.get(str(NUMBER_SEQUENCE[index - 11][0]),"story")),
+                   text=str(self.dataset.get(str(NUMBER_SEQUENCE[index - 11][0]),"_story")),
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
@@ -220,7 +220,7 @@ class Gcompris_louis_braille:
           ok = goocanvas.Svg(parent = self.rootitem,
                          svg_handle = gcompris.skin.svg_get(),
                          svg_id = "#PREVIOUS",
-                         tooltip = "Click to move to previous story page"
+                         tooltip = _("Click to move to previous story page")
                          )
           ok.translate(-300,50)
           ok.connect("button_press_event", self.previous_event, self.gcomprisBoard.level)
@@ -230,7 +230,7 @@ class Gcompris_louis_braille:
           ok = goocanvas.Svg(parent = self.rootitem,
                          svg_handle = gcompris.skin.svg_get(),
                          svg_id = "#NEXT",
-                         tooltip = "Click to move to next story page"
+                         tooltip = _("Click to move to next story page")
                          )
           ok.translate(75,-58)
           ok.connect("button_press_event", self.next_event, self.gcomprisBoard.level)
@@ -246,9 +246,7 @@ class Gcompris_louis_braille:
                              20, 50, LOUIS_BRAILLE_NAME[index] ,COLOR_ON, COLOR_OFF,
                              CIRCLE_FILL, CIRCLE_FILL,True,False ,False, None)
 
-          #Checking for newline in activity.desktop
-          story = self.dataset.get(str(level),"story")
-          story = story.replace("\\n", "\n")
+          story = self.dataset.get(str(level),"_story")
 
           #Rectangle for YEAR
           goocanvas.Rect(parent=self.rootitem,
@@ -264,7 +262,7 @@ class Gcompris_louis_braille:
           goocanvas.Text(parent = self.rootitem,
                    x=420.0,
                    y=395.0,
-                   text=str(self.dataset.get(str(level),"year")),
+                   text=str(self.dataset.get(str(level),"_year")),
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
@@ -283,12 +281,13 @@ class Gcompris_louis_braille:
 
           #Displaying the STORY
           goocanvas.Text(parent = self.rootitem,
-                   x=433.0,
+                   x=400.0,
                    y=455.0,
                    text=str(story),
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
+                   width = 700,
                    font = 'SANS 17'
                    )
 
diff --git a/src/louis_braille-activity/resources/louis_braille/activity.desktop b/src/louis_braille-activity/resources/louis_braille/activity.desktop
index 9e3cf13..82b91a1 100644
--- a/src/louis_braille-activity/resources/louis_braille/activity.desktop
+++ b/src/louis_braille-activity/resources/louis_braille/activity.desktop
@@ -1,88 +1,87 @@
 [1]
-year = 1809
-story = Born January 4th at Coupvary near Paris in France.
+_year = 1809
+_story = Born January 4th at Coupvary near Paris in France.
 image = louis_braille/louis.jpg
 
 [2]
-year = 1812
-story = Louis Braille injured his left eye with a stitching awl \n from  his fathers workshop.
+_year = 1812
+_story = Louis Braille injured his left eye with a stitching awl from his fathers workshop.
 image = louis_braille/workshop.jpg
 
 [3]
-year = 1812
-story = At the age of three Louis became blind due to \n sympathetic ophthalmia.
+_year = 1812
+_story = At the age of three Louis became blind due to sympathetic ophthalmia.
 image = louis_braille/fireplace.jpg
 
 [4]
-year = 1819
-story = At the age of 10 he was sent to Paris to study \n at the Royal Institute for Blind Youth.
+_year = 1819
+_story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
 image = louis_braille/rnib.jpg
 
 [5]
-year = 1820
-story = He began to impress his classmates and began to \n play piano and the organ.
+_year = 1820
+_story = He began to impress his classmates and began to play piano and the organ.
 image = louis_braille/piano.jpg
 
 [6]
-year = 1821
-story = Charles Barbier, a french soldier visited school and shared \n invention of night writing ,a code of 12 raised dots \n that let soldiers share secret information on battlefield.
+_year = 1821
+_story = Charles Barbier, a french soldier visited school and shared invention of night writing ,a code of 12 raised dots that let soldiers share secret information on battlefield.
 image = louis_braille/night_printing.jpg
-  
+
 [7]
-year = 1824
-story = Louis trimmed Barbier's 12 dots into 6 and \n invented Braille.
+_year = 1824
+_story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
 image = louis_braille/braile.jpg
 
 [8]
-year = 1828
-story = He became a professor after graduating and secretly \n taught his method.
+_year = 1828
+_story = He became a professor after graduating and secretly taught his method.
 image = louis_braille/teach.jpg
 
 [9]
-year = 1837
-story = He revised and extended braille to include mathematics,\n symbols, punctuations and music notations.
+_year = 1837
+_story = He revised and extended braille to include mathematics, symbols, punctuations and music notations.
 image = louis_braille/chart.png
 
 [10]
-year = 1852
-story = He died of tuberculosis.He is burried in the Pantheon \n in Paris.A monument is erected to honor him.
+_year = 1852
+_story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
 image = louis_braille/statue.jpg
 
 [11]
-year = After his Death
-story = Braille got accepted as a world wide standard.Louis proved\nif you have motivation you can do incredible things.
+_year = After his Death
+_story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
 image = louis_braille/braille_ball.jpg
 
 [12]
-story = Born January 4th at Coupvary near Paris in France.
+_story = Born January 4th at Coupvary near Paris in France.
 
 [13]
-story =  Louis Braille injured his left eye with a stitching awl from  his fathers workshop.
+_story =  Louis Braille injured his left eye with a stitching awl from  his fathers workshop.
 
 [14]
-story = At the age of three Louis became blind due to sympathetic ophthalmia.
+_story = At the age of three Louis became blind due to sympathetic ophthalmia.
 
 [15]
-story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
+_story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
 
 [16]
-story = He began to impress his classmates and began to play piano and the organ.
+_story = He began to impress his classmates and began to play piano and the organ.
 
 [17]
-story = Charles Barbier, a french soldier visited school and shared invention of night writing.
+_story = Charles Barbier, a french soldier visited school and shared invention of night writing.
 
 [18]
-story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
+_story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
 
 [19]
-story = He became a professor after graduating and secretly taught his method.
+_story = He became a professor after graduating and secretly taught his method.
 
 [20]
-story = He revised and extended braille to include mathematics,symbols, punctuations and music notations.
+_story = He revised and extended braille to include mathematics,symbols, punctuations and music notations.
 
 [21]
-story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
+_story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
 
 [22]
-story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
-
+_story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
\ No newline at end of file
diff --git a/src/rhymes_riddles-activity/rhymes_riddles.py b/src/rhymes_riddles-activity/rhymes_riddles.py
index f9063f5..1178d10 100644
--- a/src/rhymes_riddles-activity/rhymes_riddles.py
+++ b/src/rhymes_riddles-activity/rhymes_riddles.py
@@ -38,32 +38,32 @@ CIRCLE_STROKE = "black"
 CELL_WIDTH = 30
 RHYMES_RIDDLES_LIST = [
       [ # Level 1
-      ["What goes up white and comes down \n" "yellow and white?","egg"],
-      ["What rises and waves all day?","flag"],
-      ["What has two wheels and speeds up \n " "hills for a hike?","bike"],
-      ["What hides in shoes and crosses \n" "the street?","feet"],
-      ["What falls from the sky without \n" "hurting your brain?","rain"]
+      [_("What goes up white and comes down yellow and white?"),"egg"],
+      [_("What rises and waves all day?"),"flag"],
+      [_("What has two wheels and speeds up hills for a hike?"),"bike"],
+      [_("What hides in shoes and crosses the street?"),"feet"],
+      [_("What falls from the sky without hurting your brain?"),"rain"]
       ],
       [# Level 2
-  ["This is a word which rhymes with cat, It \n" "grows on your head because it's a :","hat"],
-  ["I'm useful for journey when you are going\n"" far, I need lots of petrol because I'm a :","car"],
-  ["This is a word which rhymes with up.\n""You can drink out of me because I'm a :","cup"],
-  ["This is a word which rhymes with bake,\n""I'm nice to eat because I'm a : ","cake"],
-  ["This is a word which rhymes with spoon,\n""I shine at night because I'm a :","moon"]
+  [_("This is a word which rhymes with cat, It grows on your head because it's a :"),"hat"],
+  [_("I'm useful for journey when you are going far, I need lots of petrol because I'm a :"),"car"],
+  [_("This is a word which rhymes with up.You can drink out of me because I'm a :"),"cup"],
+  [_("This is a word which rhymes with bake, I'm nice to eat because I'm a : "),"cake"],
+  [_("This is a word which rhymes with spoon, I shine at night because I'm a :"),"moon"]
   ],
   [# Level 3
-  ["A never ending circle,a brightly shiny \n""thing,It's on my fourth finger because its a :","ring"],
-  ["The more I dry,The wetter I get","towel"],
-  ["What has roots as nobody sees, Is taller than \n""trees,up it goes and yet never grows","mountain"],
-  ["You hear my sound you feel me when I \n""move,But see me when you never will","wind"],
-  ["You'll find us near ponds or sitting on logs, we\n"" jump and we cloak because we are : ","frogs"]
+  [_("A never ending circle,a brightly shiny thing,It's on my fourth finger because its a :"),"ring"],
+  [_("The more I dry,The wetter I get"),"towel"],
+  [_("What has roots as nobody sees, Is taller than trees,up it goes and yet never grows"),"mountain"],
+  [_("You hear my sound you feel me when I move,But see me when you never will"),"wind"],
+  [_("You'll find us near ponds or sitting on logs, we jump and we cloak because we are : "),"frogs"]
   ],
  [# Level 4
-  ["What do you get when you put a car and a\n"" pet together?","carpet"],
-  ["What can speak in every language , but \n""never went to school ?","echo"],
-  ["What's expensive and floats through the room?","perfume"],
-  ["What got loose and spoiled the race","shoelace"],
-  ["Some fly, some sting, some hide in rugs","bugs"]
+  [_("What do you get when you put a car and a pet together?"),"carpet"],
+  [_("What can speak in every language , but never went to school ?"),"echo"],
+  [_("What's expensive and floats through the room?"),"perfume"],
+  [_("What got loose and spoiled the race"),"shoelace"],
+  [_("Some fly, some sting, some hide in rugs"),"bugs"]
   ]
 ]
 class Gcompris_rhymes_riddles:
@@ -126,12 +126,13 @@ class Gcompris_rhymes_riddles:
 
   def rhymes_rhymes(self, level):
       goocanvas.Text(parent = self.rootitem,
-                   x=290.0,
+                   x=270.0,
                    y=270.0,
                    text=RHYMES_RIDDLES_LIST[level - 1][self.counter][0],
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
+                   width = 500 ,
                    font = 'SANS 17'
                    )
       str = RHYMES_RIDDLES_LIST[level - 1][self.counter][1]



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