wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src gettext.cpp gettext.hpp


From: Yann Dirson
Subject: [Wesnoth-cvs-commits] wesnoth/src gettext.cpp gettext.hpp
Date: Thu, 02 Sep 2004 11:23:57 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Yann Dirson <address@hidden>    04/09/02 15:19:01

Modified files:
        src            : gettext.cpp gettext.hpp 

Log message:
        added support for using c++ files using a different domain; new 
dsgettext function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gettext.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gettext.hpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: wesnoth/src/gettext.cpp
diff -u wesnoth/src/gettext.cpp:1.3 wesnoth/src/gettext.cpp:1.4
--- wesnoth/src/gettext.cpp:1.3 Fri Aug 27 11:13:37 2004
+++ wesnoth/src/gettext.cpp     Thu Sep  2 15:19:01 2004
@@ -15,6 +15,19 @@
        return msgval;
 }
 
+const char* dsgettext (const char * domainname, const char *msgid)
+{
+       const char *msgval = dgettext (domainname, msgid);
+       if (msgval == msgid) {
+               msgval = strrchr (msgid, '^');
+               if (msgval == NULL)
+                       msgval = msgid;
+               else
+                       msgval++;
+       }
+       return msgval;
+}
+
 const char* vgettext (const char *msgid, const string_map& symbols)
 {
        const std::string orig(gettext(msgid));
Index: wesnoth/src/gettext.hpp
diff -u wesnoth/src/gettext.hpp:1.2 wesnoth/src/gettext.hpp:1.3
--- wesnoth/src/gettext.hpp:1.2 Fri Aug 27 11:13:37 2004
+++ wesnoth/src/gettext.hpp     Thu Sep  2 15:19:01 2004
@@ -6,8 +6,15 @@
 // gettext-related declarations
 #include <libintl.h>
 const char* sgettext (const char*);
+const char* dsgettext (const char * domainname, const char *msgid);
 const char* vgettext (const char*,const string_map&);
-#define _(String) gettext(String)
+
+#ifdef GETTEXT_DOMAIN
+# define _(String) dgettext(GETTEXT_DOMAIN,String)
+#else
+# define _(String) gettext(String)
+#endif
+
 #define gettext_noop(String) String
 #define N_(String) gettext_noop (String)
 




reply via email to

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