Author: esr
Date: Mon Mar 30 00:11:52 2009
New Revision: 34267

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34267&view=rev
Log:
Encapsulate some Pango markup in WHISPER and ASIDE macros so these conventions
can be tweaked without changing translatable strings.

Modified:
    trunk/data/campaigns/Eastern_Invasion/scenarios/06.Two_Paths.cfg
    
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg
    trunk/data/campaigns/The_Rise_Of_Wesnoth/scenarios/13_Peoples_in_Decline.cfg
    trunk/data/core/macros/interface-utils.cfg
    trunk/data/tools/wmllint

Modified: trunk/data/campaigns/Eastern_Invasion/scenarios/06.Two_Paths.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Eastern_Invasion/scenarios/06.Two_Paths.cfg?rev=34267&r1=34266&r2=34267&view=diff
==============================================================================
--- trunk/data/campaigns/Eastern_Invasion/scenarios/06.Two_Paths.cfg (original)
+++ trunk/data/campaigns/Eastern_Invasion/scenarios/06.Two_Paths.cfg Mon Mar 30 
00:11:52 2009
@@ -128,11 +128,11 @@
         [/message]
         [message]
             speaker=Wak-Rano
-            message= _ "Hmm... I know. We will make a pact to destroy these 
men, and continue our fight later. (Perhaps he will die, and I will win our 
battle without fighting.)"
+            message= _ "Hmm... I know. We will make a pact to destroy these 
men, and continue our fight later. " + {ASIDE "Perhaps he will die, and I will 
win our battle without fighting."}
         [/message]
         [message]
             speaker=Mal-Arnai
-            message= _ "Very well, we are allies, for now. (This foolish orc 
will surely perish.)"
+            message= _ "Very well, we are allies, for now. " + {ASIDE _"This 
foolish orc will surely perish."}
         [/message]
     [/event]
 

Modified: 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg?rev=34267&r1=34266&r2=34267&view=diff
==============================================================================
--- 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg
 (original)
+++ 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg
 Mon Mar 30 00:11:52 2009
@@ -163,12 +163,12 @@
 
         [message]
             speaker="Aiglondur"
-            message=_"<small>(Psst, Angarthing...Karrag and those dwarves on 
the dais, they're all masked.)</small>"
-        [/message]
-
-        [message]
-            speaker="Angarthing"
-            message=_"<small>(I see it. There is something very wrong 
here.)</small>"
+            message={WHISPER _"Psst, Angarthing...Karrag and those dwarves on 
the dais, they're all <i>masked</i>."}
+        [/message]
+
+        [message]
+            speaker="Angarthing"
+            message={WHISPER _"I see it. There is something very wrong here."}
         [/message]
 
         [message]

Modified: 
trunk/data/campaigns/The_Rise_Of_Wesnoth/scenarios/13_Peoples_in_Decline.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/The_Rise_Of_Wesnoth/scenarios/13_Peoples_in_Decline.cfg?rev=34267&r1=34266&r2=34267&view=diff
==============================================================================
--- 
trunk/data/campaigns/The_Rise_Of_Wesnoth/scenarios/13_Peoples_in_Decline.cfg 
(original)
+++ 
trunk/data/campaigns/The_Rise_Of_Wesnoth/scenarios/13_Peoples_in_Decline.cfg 
Mon Mar 30 00:11:52 2009
@@ -210,7 +210,7 @@
         [/message]
         [message]
             speaker=Lady Jessica
-            message= _ "(whispered) I don't think diplomacy is going to work."
+            message={WHISPER "I don't think diplomacy is going to work."}
         [/message]
         [message]
             speaker=Gerrick

Modified: trunk/data/core/macros/interface-utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/interface-utils.cfg?rev=34267&r1=34266&r2=34267&view=diff
==============================================================================
--- trunk/data/core/macros/interface-utils.cfg (original)
+++ trunk/data/core/macros/interface-utils.cfg Mon Mar 30 00:11:52 2009
@@ -495,3 +495,14 @@
         message={TEXT}
     [/wml_message]
 #enddef
+
+# Encapsulate text in conventional markup for characters whispering.
+# We do this so whispers can be restyled by tweaking this markup
+#define WHISPER TEXT
+"<small>(" + {TEXT} + ")</small>"#enddef
+
+# Encapsulate text in conventional markup for characters speaking aside.
+# We do this so whispers can be restyled by tweaking this markup
+#define ASIDE TEXT
+"<i>(" + {TEXT} + ")</i>"#enddef
+

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=34267&r1=34266&r2=34267&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Mon Mar 30 00:11:52 2009
@@ -669,7 +669,7 @@
     "Pango conversion of old-style Wesnoth markup."
     if '&' in message:
         amper = message.find('&')
-        if message[amper:amper+5] != "&amp;":
+        if message[amper:amper+1].isspace():
             message = message[:amper] + "&amp;" + message[amper+1:]
     if re.search("<[0-9]+,[0-9]+,[0-9]+>", message):
         print '"%s", line %d: color spec in line requires manual fix.' % 
(filename, line)
@@ -1015,7 +1015,7 @@
                 # Doing a better job would require tokenizing to pick up the
                 # string boundaries. I'd do it, but AI0867 is already working
                 # on a parser-based wmllint.   
-                if '{' in value and "+" not in value:
+                if '{' in value and "+" not in value and value.find('{') > 
value.find("_"):
                     print '"%s", line %d: macro reference in translatable 
string'\
                           % (filename, i+1)
                 #if future and re.search("[.,!?]  ", lines[i]):


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to