Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#14449) Citystyle names should use Q_() macro
Home

[Freeciv-Dev] (PR#14449) Citystyle names should use Q_() macro

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: evyscr@xxxxxxxxx, himasaram@xxxxxxxx
Subject: [Freeciv-Dev] (PR#14449) Citystyle names should use Q_() macro
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 9 Mar 2006 20:41:47 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14449 >

Here's a final version of the patch.  It adds prefixes to all city styles.

-jason

Index: utility/fcintl.h
===================================================================
--- utility/fcintl.h    (revision 11743)
+++ utility/fcintl.h    (working copy)
@@ -48,6 +48,11 @@
 
 #endif
 
+/* This provides an untranslated version of Q_ that allows the caller to
+ * get access to the original string.  This may be needed for comparisons,
+ * for instance. */
+#define Qn_(String) skip_intl_qualifier_prefix(String)
+
 const char *skip_intl_qualifier_prefix(const char *str);
 
 #endif  /* FC__FCINTL_H */
Index: data/default/cities.ruleset
===================================================================
--- data/default/cities.ruleset (revision 11743)
+++ data/default/cities.ruleset (working copy)
@@ -71,7 +71,7 @@
 ; replaced_by = which style replaced this one
 
 [citystyle_european]
-name        = _("European")
+name        = _("?citystyle:European")
 graphic     = "city.european"
 graphic_alt = "-"
 citizens_graphic     = "ancient"
@@ -80,7 +80,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_classical]
-name        = _("Classical")
+name        = _("?citystyle:Classical")
 graphic     = "city.classical"
 graphic_alt = "-"
 citizens_graphic     = "ancient"
@@ -89,7 +89,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_tropical]
-name        = _("Tropical")
+name        = _("?citystyle:Tropical")
 graphic     = "city.tropical"
 graphic_alt = "city.european"
 citizens_graphic     = "ancient"
@@ -98,7 +98,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_asian]
-name        = _("Asian")
+name        = _("?citystyle:Asian")
 graphic     = "city.asian"
 graphic_alt = "city.classical"
 citizens_graphic     = "ancient"
@@ -107,7 +107,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_babylonian]
-name        = _("Babylonian")
+name        = _("?citystyle:Babylonian")
 graphic     = "city.babylonian"
 graphic_alt = "city.classical"
 citizens_graphic     = "ancient"
@@ -116,7 +116,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_celtic]
-name        = _("Celtic")
+name        = _("?citystyle:Celtic")
 graphic     = "city.celtic"
 graphic_alt = "city.european"
 citizens_graphic     = "ancient"
@@ -125,7 +125,7 @@
 replaced_by = "Renaissance"
 
 [citystyle_renaissance]
-name        = _("Renaissance")
+name        = _("?citystyle:Renaissance")
 graphic     = "city.renaissance"
 graphic_alt = "city.industrial"
 citizens_graphic     = "renaissance"
@@ -136,7 +136,7 @@
 replaced_by = "Industrial"
 
 [citystyle_industrial]
-name        = _("Industrial")
+name        = _("?citystyle:Industrial")
 graphic     = "city.industrial"
 graphic_alt = "-"
 citizens_graphic     = "industrial"
@@ -147,7 +147,7 @@
 replaced_by = "Modern"
 
 [citystyle_modern]
-name        = _("Modern")
+name        = _("?citystyle:Modern")
 graphic     = "city.modern"
 graphic_alt = "-"
 citizens_graphic     = "modern"
@@ -158,7 +158,7 @@
 replaced_by = "PostModern"
 
 [citystyle_postmodern]
-name        = _("PostModern")
+name        = _("?citystyle:PostModern")
 graphic     = "city.postmodern"
 graphic_alt = "-"
 citizens_graphic     = "postmodern"
Index: common/city.c
===================================================================
--- common/city.c       (revision 11743)
+++ common/city.c       (working copy)
@@ -1106,7 +1106,9 @@
   int i;
 
   for (i = 0; i < game.control.styles_count; i++) {
-    if (strcmp(style_name, city_styles[i].name) == 0) {
+    /* City styles use Q_ so a city style may be called "?citystyle:Asian".
+     * We use Qn_ so that this string will match against "Asian". */
+    if (strcmp(Qn_(style_name), Qn_(city_styles[i].name)) == 0) {
       break;
     }
   }

[Prev in Thread] Current Thread [Next in Thread]