]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - locale/po2strings.c
Wrap all uses of notify_post with #ifdef's.
[thirdparty/cups.git] / locale / po2strings.c
index 0536c4360b49c06f8002e64cbf9aee98954ea194..88f0ef8016c097e66344e8b46241baee2b92f608 100644 (file)
@@ -303,15 +303,21 @@ normalize_string(const char *idstr,       /* I - msgid string */
 {
   char *bufptr = buffer,               /* Pointer into buffer */
        *bufend = buffer + bufsize - 3; /* End of buffer */
-  int  quote = 0;                      /* Quote direction */
+  int  quote = 0,                      /* Quote direction */
+       html = 0;                       /* HTML text */
 
 
   while (*idstr && bufptr < bufend)
   {
+    if (!strncmp(idstr, "<A ", 3))
+      html = 1;
+    else if (html && *idstr == '>')
+      html = 0;
+
     if (*idstr == '.' && idstr[1] == '.' && idstr[2] == '.')
     {
      /*
-      * Convert "..." to Unicode ellipsis...
+      * Convert ... to Unicode ellipsis...
       */
 
       *bufptr++ = (char)0xE2;
@@ -319,12 +325,12 @@ normalize_string(const char *idstr,       /* I - msgid string */
       *bufptr++ = (char)0xA6;
       idstr += 2;
     }
-    else if (*idstr == '\"')
+    else if (!html && *idstr == '\\' && idstr[1] == '\"' && (quote || strchr(idstr + 2, '\"') != NULL))
     {
       if (quote)
       {
        /*
-        * Convert " to right quote.
+        * Convert \" to Unicode right (curley) double quote.
         */
 
        *bufptr++ = (char)0xE2;
@@ -334,7 +340,7 @@ normalize_string(const char *idstr, /* I - msgid string */
       else
       {
        /*
-        * Convert " to left quote.
+        * Convert \" to Unicode left (curley) double quote.
         */
 
        *bufptr++ = (char)0xE2;
@@ -343,6 +349,7 @@ normalize_string(const char *idstr, /* I - msgid string */
       }
 
       quote = !quote;
+      idstr ++;
     }
     else
       *bufptr++ = *idstr;