]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
KDE wishes are implemented.
authorBruno Haible <bruno@clisp.org>
Thu, 20 Apr 2006 15:19:56 +0000 (15:19 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:11 +0000 (12:13 +0200)
Admin/kde-i18n [deleted file]
Admin/plans

diff --git a/Admin/kde-i18n b/Admin/kde-i18n
deleted file mode 100644 (file)
index c3306c0..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-> But I agree with you that
-> 
->        i18n("title in dialog","Check Equations")
-> 
-> would be prettier and easier to maintain, but needs some xgettext
-> support.
-Which we added with a little hack.
-
-# This is a patch for gettext-0.10.35 to allow translated messages
-# to have a context as used in Qt and KDE. 
-# (C) 2000 Stephan Kulow <coolo@kde.org>
-
---- src/xgettext.c.orig        Sun May 14 18:16:25 2000
-+++ src/xgettext.c     Sun May 14 18:27:20 2000
-@@ -835,7 +835,8 @@
-      int is_cpp_file;
- {
-   int state;
--
-+  char *msgid = 0;
-+  
-   /* Inform scanner whether we have C++ files or not.  */
-   if (is_cpp_file)
-     xgettext_lex_cplusplus ();
-@@ -861,8 +862,11 @@
-       State 3 = seen one of our keywords with string in second parameter
-       State 4 = was in state 3 and now saw a left paren
-       State 5 = waiting for comma after being in state 4
--      State 6 = saw comma after being in state 5  */
-+      State 6 = saw comma after being in state 5  
-+      State 7 = after comma and State 2
-+     */
-      xgettext_lex (&token);
-+
-      switch (token.type)
-        {
-        case xgettext_token_type_keyword1:
-@@ -886,18 +890,51 @@
-            state = 0;
-          }
-        continue;
-+       
-+       case xgettext_token_type_rp:
-+       if (state == 2) {
-+         token.string = strdup(msgid);
-+         remember_a_message (mlp, &token);
-+         free(msgid);
-+         msgid = 0;
-+         state = 0;
-+       }
-+       continue;   
-        case xgettext_token_type_comma:
--       state = state == 5 ? 6 : 0;
-+       switch (state) {
-+       case 5:
-+         state = 6;
-+         break;
-+       case 2:
-+         state = 7;
-+         break;
-+       default:
-+         state = 0;
-+         break;
-+       }
-        continue;
-        case xgettext_token_type_string_literal:
-        if (extract_all || state == 2 || state == 6)
-          {
--           remember_a_message (mlp, &token);
--           state = 0;
-+           if (msgid)
-+             free(msgid);
-+           msgid = strdup(token.string);
-+           //      state = 0;
-+         }
-+       else if (state == 7) 
-+         {
-+           if (msgid) {
-+             char *newstring = (char*)malloc(strlen(msgid) + strlen(token.string) + 20);
-+             sprintf(newstring, "_: %s\n%s", msgid, token.string);
-+             free(msgid);
-+             free(token.string);
-+             token.string = msgid = newstring;
-+             state = 2;
-+           }
-          }
--       else
-+       else 
-          {
-            free (token.string);
-            state = (state == 4 || state == 5) ? 5 : 0;
-
-
-Also need the corresponding two-argument gettext function in libgettext.h:
-gettext2(role,msg) :=
-  msgid := "_: " + role + "\n" + msg
-  trans := gettext(msgid)
-  return (trans == msgid ? msg : trans);
index 406210152a22024d8989d49eaea4b8c49ed9468f..1d9739eddafa0cc66107a3f2219cf4de6cf84f32 100644 (file)
@@ -3,9 +3,6 @@ Things we plan to do. Comments welcome.
 - Documentation: Distinguish more clearly between gettext/xgettext,
   the Translation Project for GNU packages, and the PO mode.
 
-- KDE wants a kind of gettext2("role","msg")  function whose key is the
-  concatenation of "role" and "msg" but whose default value is only "msg".
-
 - Look at Christian Robottom Reis's manual:
   http://www.async.com.br/~kiko/gettext.html