alecpl
2012-04-14 9870dac30de1b8d1bdeab57af3eeb7c89b21ef76
bin/exportgettext.sh
@@ -30,20 +30,21 @@
$destdir = unslashify($argv[2]);
$layout = 'launchpad';  # or 'narro';
$langcode_map = array(
   'hy_AM' => 'am',
   'hy_AM' => 'hy',
   'ar_SA' => 'ar',
   'az_AZ' => 'az',
   'bg_BG' => 'bg',
   'bs_BA' => 'bs',
   'ca_ES' => 'ca',
   'cs_CZ' => 'cz',
   'cs_CZ' => 'cs',
   'cy_GB' => 'cy',
   'da_DK' => 'da',
   'et_EE' => 'et',
   'el_GR' => 'el',
   'eu_ES' => 'eu',
   'fa_IR' => 'fa',
   'ga_IE' => 'ga',
   'ka_GE' => 'ge',
   'ka_GE' => 'ka',
   'gl_ES' => 'gl',
   'he_IL' => 'he',
   'hi_IN' => 'hi',
@@ -106,7 +107,7 @@
   }
   else if (is_file($fn)) {
      include($fn);
      $texts = array_merge($texts, (array)$labels);
      $texts = array_merge($texts, (array)$labels, (array)$messages);
   }
   
   $GLOBALS['en_US'] = $texts;
@@ -175,7 +176,7 @@
   }
   include($fn);
   $texts = $labels ? $labels : $messages;
   $texts = array_merge($labels, $messages);
   
   // write header
   $header = <<<EOF
@@ -196,7 +197,7 @@
"Content-Transfer-Encoding: 8bit\\n"
EOF;
   
   $out = sprintf($header, $srcname, $product, $is_pot ? "POT-Creation-Date" : "PO-Revision-Date", date('c'), $lang);
   $out = sprintf($header, $srcname, $product, $is_pot ? "POT-Creation-Date" : "PO-Revision-Date", date('c'), $shortlang ? $shortlang : $lang);
   $out .= "\n";
   
   $messages = array();
@@ -226,9 +227,10 @@
{
   $out = "";
   $lines = explode("\n", wordwrap(stripslashes($str)));
   foreach ($lines as $line)
      $out .= '"' . addcslashes($line, '"') . "\"\n";
   $last = count($lines) - 1;
   foreach ($lines as $i => $line)
      $out .= '"' . addcslashes($line, '"') . ($i < $last ? ' ' : '') . "\"\n";
   return rtrim($out);
}
?>
?>