]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - locale/translate.c
Update svn:keyword properties.
[thirdparty/cups.git] / locale / translate.c
index f5f2001b02c29f456773d6f1cbe523e89a34caa2..13228d27a2552f593d14b08235d7c939e998751a 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * "$Id: translate.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id$"
  *
- *   HTTP-based translation program for the Common UNIX Printing System (CUPS).
+ *   HTTP-based translation program for CUPS.
  *
  *   This program uses Google to translate the CUPS template (cups.pot) to
  *   several different languages.  The translation isn't perfect, but it's
  *   a start (better than working from scratch.)
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  * Include necessary headers...
  */
 
-#include <cups/string.h>
-#include <cups/file.h>
-#include <cups/http.h>
-#include <cups/i18n.h>
-#include <stdlib.h>
+#include <cups/cups-private.h>
 #include <unistd.h>
 
 
@@ -63,9 +59,9 @@ main(int  argc,                               /* I - Number of command-line arguments */
   }
 
   if (access(argv[1], 0))
-    cat = _cupsMessageLoad("cups.pot");
+    cat = _cupsMessageLoad("cups.pot", 1);
   else
-    cat = _cupsMessageLoad(argv[1]);
+    cat = _cupsMessageLoad(argv[1], 1);
 
   if (!cat)
   {
@@ -293,16 +289,16 @@ translate_messages(cups_array_t *cat,     /* I - Message catalog */
       *bufptr = '\0';
 
      /*
-      * Find the first textarea element - that will have the translation data...
+      * Find the div containing translation
       */
 
-      if ((bufptr = strstr(buffer, "<textarea")) == NULL)
+      if ((bufptr = strstr(buffer, "<div id=result_box")) == NULL)
       {
        /*
         * No textarea, abort!
        */
 
-        puts("NO TEXTAREA!");
+        puts("NO div id=result_box!");
        ret = 0;
        break;
       }
@@ -313,20 +309,20 @@ translate_messages(cups_array_t *cat,     /* I - Message catalog */
         * textarea doesn't end, abort!
        */
 
-        puts("TEXTAREA SHORT DATA!");
+        puts("DIV SHORT DATA!");
        ret = 0;
        break;
       }
 
       bufptr ++;
 
-      if ((bufend = strstr(bufptr, "</textarea>")) == NULL)
+      if ((bufend = strstr(bufptr, "</div>")) == NULL)
       {
        /*
         * textarea doesn't close, abort!
        */
 
-        puts("/TEXTAREA SHORT DATA!");
+        puts("/DIV SHORT DATA!");
        ret = 0;
        break;
       }
@@ -439,5 +435,5 @@ write_string(cups_file_t *fp,               /* I - File to write to */
 
 
 /*
- * End of "$Id: translate.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id$".
  */