Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-09-25 19:25:43 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-09-25 19:25:43 (GMT)
commitd7eb57fe22a8ef293dc78f93b9db4d3de783d7eb (patch)
tree34a19ca5df7a59ebd4180ef52f5c82adde3ce8d7 /tawindow.py
parent28c22a1f558f8048111efb590adb6bd53c05aab6 (diff)
fix i18n problem with block names in hover help
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py47
1 files changed, 11 insertions, 36 deletions
diff --git a/tawindow.py b/tawindow.py
index bb6567e..0424093 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -45,38 +45,9 @@ from taturtle import *
from taproject import *
from sugar.graphics.objectchooser import ObjectChooser
-from palettes import ContentInvoker
from tahoverhelp import *
from gettext import gettext as _
-class PopupHandler():
-
- def __init__(self):
- self.table = {}
-
- def getInvoker(self, block_name):
- if block_name in self.table:
- return self.table[block_name]
-
- msg = self._getHelpMessage(block_name)
- if msg != "":
- self.table[block_name] = ContentInvoker(msg)
- return self.table[block_name]
-
- print("no invoker for " + block_name)
- return None
-
- def _getHelpMessage(self, block_name):
- try:
- return (hover_dict[block_name])
- except:
- print("no dictionary entry for " + block_name)
- return("")
-
-popupHandler = PopupHandler()
-
-timeout_tag = [0]
-
# dead key dictionaries
dead_grave = {'A':192,'E':200,'I':204,'O':210,'U':217,'a':224,'e':232,'i':236,\
'o':242,'u':249}
@@ -89,6 +60,10 @@ dead_diaeresis = {'A':196,'E':203,'I':207,'O':211,'U':218,'a':228,'e':235,\
'i':239,'o':245,'u':252}
dead_abovering = {'A':197,'a':229}
+# Time out for triggering help
+timeout_tag = [0]
+
+
#
# Setup
#
@@ -783,10 +758,15 @@ def xy(event):
def showPopup(block_name,tw):
if hasattr(tw,"activity"):
+ if block_name in blocks_dict:
+ block_name_s = _(blocks_dict[block_name])
+ else:
+ block_name_s = _(block_name)
+
try:
- label = _(block_name) + ": " + hover_dict[block_name]
+ label = block_name_s + ": " + hover_dict[block_name]
except:
- label = _(block_name)
+ label = block_name_s
try:
# Use new toolbar
tw.activity.hover_help_label.set_text(label)
@@ -795,9 +775,4 @@ def showPopup(block_name,tw):
# Use old toolbar
tw.activity.helpToolbar.hover_help_label.set_text(label)
tw.activity.helpToolbar.hover_help_label.show()
- """
- i = popupHandler.getInvoker(block_name)
- if i:
- return gobject.timeout_add(500, i.showPopup, "")
- """
return 0