--- intltool-merge	2009-04-27 00:41:36.417699226 -0400
+++ /usr/bin/intltool-merge	2009-04-27 00:28:55.867701229 -0400
@@ -68,6 +68,7 @@
 my $UTF8_ARG = 0;
 my $MULTIPLE_OUTPUT = 0;
 my $cache_file;
+my $schemas_domain;
 
 ## Handle options
 GetOptions 
@@ -87,7 +88,8 @@
  "pass-through|p" => \$PASS_THROUGH_ARG,
  "utf8|u" => \$UTF8_ARG,
  "multiple-output|m" => \$MULTIPLE_OUTPUT,
- "cache|c=s" => \$cache_file
+ "cache|c=s" => \$cache_file,
+ "schemas-domain=s" => \$schemas_domain
  ) or &error;
 
 my $PO_DIR;
@@ -1246,13 +1248,31 @@
 	my $short_string = $9 ? $9 : '';
 	my $long_string = $12 ? $12 : '';
 
-	print OUTPUT "$locale_start_spaces$c_default_block";
-
         $default_string =~ s/\s+/ /g;
-        $default_string = entity_decode($default_string);
 	$short_string =~ s/\s+/ /g;
-	$short_string = entity_decode($short_string);
 	$long_string =~ s/\s+/ /g;
+
+	if ($schemas_domain) {
+		print OUTPUT "$locale_start_spaces<gettext_domain>$schemas_domain</gettext_domain>";
+	}
+
+	print OUTPUT "$locale_start_spaces<locale name=\"C\">";
+        print OUTPUT "$default_spaces";    
+        if ($default_string) {
+            print OUTPUT "<default>$default_string</default>";
+        }
+        print OUTPUT "$short_spaces";    
+        if ($short_string) {
+            print OUTPUT "<short>$short_string</short>";
+        }
+        print OUTPUT "$long_spaces";    
+        if ($long_string) {
+            print OUTPUT "<long>$long_string</long>";
+        }
+	print OUTPUT "$locale_end_spaces</locale>";
+
+        $default_string = entity_decode($default_string);
+	$short_string = entity_decode($short_string);
 	$long_string = entity_decode($long_string);
 
 	for my $lang (sort keys %po_files_by_lang) 
@@ -1261,34 +1281,38 @@
 	    my $short_translation = $translations{$lang, $short_string};
 	    my $long_translation  = $translations{$lang, $long_string};
 
-	    next if (!$default_translation && !$short_translation && 
-                     !$long_translation);
+	    next if (!$default_translation && !$short_translation && !$long_translation);
+            next if ($schemas_domain && 
+                     (!$default_translation || ($default_translation eq $default_string)));
 
 	    print OUTPUT "\n$locale_start_spaces<locale name=\"$lang\">";
 
-        print OUTPUT "$default_spaces";    
+            print OUTPUT "$default_spaces";    
 
-        if ($default_translation)
-        {
-            $default_translation = entity_encode($default_translation);
-            print OUTPUT "<default>$default_translation</default>";
-        }
+            if ($default_translation)
+            {
+                 $default_translation = entity_encode($default_translation);
+                 print OUTPUT "<default>$default_translation</default>";
+            }
 
-	    print OUTPUT "$short_spaces";
+            if (!$schemas_domain)
+            {
+	         print OUTPUT "$short_spaces";
 
-	    if ($short_translation)
-	    {
-			$short_translation = entity_encode($short_translation);
+	         if ($short_translation)
+	         {
+		 	$short_translation = entity_encode($short_translation);
 			print OUTPUT "<short>$short_translation</short>";
-	    }
+	         }
 
-	    print OUTPUT "$long_spaces";
+	         print OUTPUT "$long_spaces";
 
-	    if ($long_translation)
-	    {
+	         if ($long_translation)
+	         {
 			$long_translation = entity_encode($long_translation);
 			print OUTPUT "<long>$long_translation</long>";
-	    }	    
+	         }
+            }	    
 
 	    print OUTPUT "$locale_end_spaces</locale>";
         }
