[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: l10n-kde4/sr/internal/scripts
From: Chusslove Illich <caslav.ilic () gmx ! net>
Date: 2008-03-02 21:16:31
Message-ID: 1204492591.299647.14729.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 781437 by ilic:
Allow arguments to GUI references, strip scripts.
M +19 -0 summit_hooks.py
--- trunk/l10n-kde4/sr/internal/scripts/summit_hooks.py #781436:781437
@@ -636,6 +636,14 @@
# This distinction is important when deciding between two msgids,
# one having no context and one having a context.
+ # Split any arguments from msgid.
+ argdelim = u"^^";
+ args = []
+ if argdelim in msgid:
+ lst = msgid.split(argdelim)
+ msgid = lst[0]
+ args = lst[1:]
+
# Try to find unambiguous match to msgctxt/msgid.
rmsg = None
rcat = None
@@ -677,6 +685,17 @@
# Must force conversion to string, because the catalog is
# normalized and not monitored, so its cache is stale.
+ # Strip scripted part if any.
+ if ts_fence in rtext:
+ rtext = rtext[:rtext.find(ts_fence)]
+
+ # Replace any provided arguments.
+ if args:
+ for i in range(5): # c
+ plhold = "%" + str(i)
+ if plhold in rtext:
+ rtext = rtext.replace(plhold, args.pop(0))
+
# Strip all paired and inplace tags.
# TODO: Something smarter? (Set replacement patterns per tag?)
if "<" in rtext:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic