~ubuntu-branches/ubuntu/precise/gcompris/precise

« back to all changes in this revision

Viewing changes to src/hangman-activity/hangman.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-01-10 01:37:41 UTC
  • mto: This revision was merged to the branch mainline in revision 48.
  • Revision ID: package-import@ubuntu.com-20120110013741-q90ulmfrj910igm3
Tags: upstream-12.01
ImportĀ upstreamĀ versionĀ 12.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    self.rootitem = goocanvas.Group(parent =
96
96
                                    self.backitem)
97
97
 
98
 
    self.wordlist = gcompris.get_wordlist("wordsgame/default-$LOCALE.xml")
 
98
    # Get the name of the language for the current locale
 
99
    self.wordlist = None
 
100
    try:
 
101
      self.language = gcompris.gcompris_gettext( gcompris.get_locale_name(gcompris.get_locale()) )
 
102
      self.wordlist = gcompris.get_wordlist("wordsgame/default-$LOCALE.xml")
 
103
    except:
 
104
      pass
 
105
 
99
106
    if not self.wordlist:
100
107
      # Fallback to english
101
108
      self.wordlist = gcompris.get_wordlist("wordsgame/default-en.xml")
 
109
      self.language = _("English")
102
110
 
103
111
    if not self.wordlist:
104
112
      gcompris.utils.dialog(_("Could not find the list of words."),
226
234
                                 self.word[i],
227
235
                                 self.get_equiv(self.word[i])))
228
236
 
 
237
    # Display the language
 
238
    goocanvas.Text(
 
239
      parent = self.rootitem,
 
240
      x = gcompris.BOARD_WIDTH / 2,
 
241
      y = gcompris.BOARD_HEIGHT / 2 - 30,
 
242
      text = self.language,
 
243
      fill_color = "white",
 
244
      anchor = gtk.ANCHOR_CENTER,
 
245
      alignment = pango.ALIGN_CENTER
 
246
      )
 
247
 
229
248
    # Display the virtual keyboard
230
249
    (group_vowels, y_vowels) = self.display_letter_set(self.vowels, 0,
231
250
                                                       0xFF6633AAL, 0xFF33CCBBL)