2006-10-26 Alex Roitman <shura@gramps-project.org>

* help/gramps.pot: Regenerate manual template.
	* src/data/tips.xml.in (family): Escape quotes.
	* src/TipOfDay.py (TipParserescape): Remove: no need to escape here.
	(TipOfDay.escape): Escape here, to allow for gettext lookup. 
	(TipOfDay.next_tip_cb): Escape prior to gettext lookup.



svn: r7441
This commit is contained in:
Alex Roitman 2006-10-27 01:59:33 +00:00
parent df5bc1b0f6
commit 1134530834
4 changed files with 1295 additions and 1289 deletions

View File

@ -1,3 +1,10 @@
2006-10-26 Alex Roitman <shura@gramps-project.org>
* help/gramps.pot: Regenerate manual template.
* src/data/tips.xml.in (family): Escape quotes.
* src/TipOfDay.py (TipParserescape): Remove: no need to escape here.
(TipOfDay.escape): Escape here, to allow for gettext lookup.
(TipOfDay.next_tip_cb): Escape prior to gettext lookup.
2006-10-25 Piotr Czubaszek <pioterus@gmail.com>
* src/plugins/rel_pl.py: Update.

File diff suppressed because it is too large Load Diff

View File

@ -86,13 +86,20 @@ class TipOfDay(ManagedWindow.ManagedWindow):
window.show_all()
def next_tip_cb(self,dummy=None):
self.tip.set_text(_(self.tip_list[self.new_index[self.index]]))
tip_text = self.escape(self.tip_list[self.new_index[self.index]])
self.tip.set_text(_(tip_text))
self.tip.set_use_markup(True)
if self.index >= len(self.tip_list)-1:
self.index = 0
else:
self.index += 1
def escape(self,text):
text = text.replace('&','&amp;'); # Must be first
text = text.replace(' > ',' &gt; ') # Replace standalone > char
text = text.replace('"','&quot;') # quotes
return text
def close_cb(self,dummy=None):
Config.set(Config.USE_TIPS,self.use.get_active())
self.close()
@ -151,7 +158,7 @@ class TipParser:
def endElement(self,tag):
if tag == "tip" and not self.skip:
text = self.escape(''.join(self.tlist))
text = ''.join(self.tlist)
self.mylist.append(' '.join(text.split()))
elif tag != "tips":
# let all the other tags through, except for the "tips" tag
@ -159,11 +166,3 @@ class TipParser:
def characters(self, data):
self.tlist.append(data)
def escape(self,text):
"""
The tip's text will be interpreted as a markup, so we need to escape
some special chars.
"""
text = text.replace('&','&amp;'); # Must be first
return text

View File

@ -411,8 +411,8 @@ of how powerful GRAMPS is.
</_tip>
<_tip number="57">
Custom reports can be created by advanced users under the "plugin" system.
More information on custom reports can be found at
Custom reports can be created by advanced users under the &quot;plugin&quot;
system. More information on custom reports can be found at
http://developers.gramps-project.org
</_tip>