Loco Translate - Version 1.4.1

Version Description

  • Cache invalidation
  • Magic quotes stripping from po save
Download this release

Release Info

Developer timwhitlock
Plugin Icon 128x128 Loco Translate
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.4 to 1.4.1

languages/loco-translate-de_DE.mo CHANGED
Binary file
languages/loco-translate-de_DE.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: Loco Translate\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Jan 02 2014 17:30:57 GMT+0000 (GMT)\n"
6
- "PO-Revision-Date: Sat Jan 04 2014 20:45:42 GMT+0000 (GMT)\n"
7
  "Last-Translator: admin <support@localise.biz>\n"
8
  "Language-Team: \n"
9
  "Language: German\n"
@@ -22,6 +22,14 @@ msgstr ""
22
  "X-Generator: Loco - https://localise.biz/\n"
23
  "X-Loco-Target-Locale: de_DE"
24
 
 
 
 
 
 
 
 
 
25
  #. Translators: Bold text label in admin error messages
26
  #: ../lib/loco-admin.php:15 ../pub/js/lang/dummy.php:7
27
  msgctxt "Message label"
@@ -237,10 +245,6 @@ msgstr "Erstellen der MO-Datei fehlgeschlagen."
237
  msgid "Cannot overwrite MO file"
238
  msgstr "Überschreiben der MO-Datei fehlgeschlagen"
239
 
240
- #: ../php/loco-posave.php:98
241
- msgid "Failed to write MO file"
242
- msgstr ""
243
-
244
  #: ../php/loco-posync.php:53
245
  msgid "No strings could be extracted from source files"
246
  msgstr "Es konnten keine Zeichenketten aus der Quelle extrahiert werden"
@@ -267,11 +271,11 @@ msgstr "Aus Quelle zusammengeführt"
267
 
268
  #: ../pub/js/lang/dummy.php:13
269
  msgid "Already up to date with %s"
270
- msgstr "Bereit auf dem aktuellen Stand mit %s"
271
 
272
  #: ../pub/js/lang/dummy.php:14
273
  msgid "Already up to date with source code"
274
- msgstr "Bereit mit der Quelle auf dem aktuellen Stand"
275
 
276
  #: ../pub/js/lang/dummy.php:15
277
  msgid "1 new string added"
@@ -368,10 +372,6 @@ msgstr "Benutze externes Befehlsprogramm:"
368
  msgid "Enter path to msgfmt on server"
369
  msgstr "Pfad zum msgfmt-Programm"
370
 
371
- #: ../tpl/admin-opts.tpl.php:54
372
- msgid "Generate hash tables"
373
- msgstr ""
374
-
375
  #: ../tpl/admin-opts.tpl.php:63
376
  msgid "Save settings"
377
  msgstr "Einstellungen speichern"
3
  "Project-Id-Version: Loco Translate\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Jan 02 2014 17:30:57 GMT+0000 (GMT)\n"
6
+ "PO-Revision-Date: Wed Jan 15 2014 00:10:04 GMT+0000 (GMT)\n"
7
  "Last-Translator: admin <support@localise.biz>\n"
8
  "Language-Team: \n"
9
  "Language: German\n"
22
  "X-Generator: Loco - https://localise.biz/\n"
23
  "X-Loco-Target-Locale: de_DE"
24
 
25
+ #: ../php/loco-posave.php:98
26
+ msgid "Failed to write MO file"
27
+ msgstr "Fehler beim Schreiben der MO-Datei"
28
+
29
+ #: ../tpl/admin-opts.tpl.php:54
30
+ msgid "Generate hash tables"
31
+ msgstr "Erzeuge Hashtabellen"
32
+
33
  #. Translators: Bold text label in admin error messages
34
  #: ../lib/loco-admin.php:15 ../pub/js/lang/dummy.php:7
35
  msgctxt "Message label"
245
  msgid "Cannot overwrite MO file"
246
  msgstr "Überschreiben der MO-Datei fehlgeschlagen"
247
 
 
 
 
 
248
  #: ../php/loco-posync.php:53
249
  msgid "No strings could be extracted from source files"
250
  msgstr "Es konnten keine Zeichenketten aus der Quelle extrahiert werden"
271
 
272
  #: ../pub/js/lang/dummy.php:13
273
  msgid "Already up to date with %s"
274
+ msgstr "Bereits auf dem aktuellen Stand mit %s"
275
 
276
  #: ../pub/js/lang/dummy.php:14
277
  msgid "Already up to date with source code"
278
+ msgstr "Bereits mit der Quelle auf dem aktuellen Stand"
279
 
280
  #: ../pub/js/lang/dummy.php:15
281
  msgid "1 new string added"
372
  msgid "Enter path to msgfmt on server"
373
  msgstr "Pfad zum msgfmt-Programm"
374
 
 
 
 
 
375
  #: ../tpl/admin-opts.tpl.php:63
376
  msgid "Save settings"
377
  msgstr "Einstellungen speichern"
languages/loco-translate-nl_BE.mo CHANGED
Binary file
languages/loco-translate-nl_BE.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: Loco Translate\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Jan 02 2014 17:30:57 GMT+0000 (GMT)\n"
6
- "PO-Revision-Date: Sat Jan 04 2014 20:46:00 GMT+0000 (GMT)\n"
7
  "Last-Translator: admin <support@localise.biz>\n"
8
  "Language-Team: \n"
9
  "Language: Dutch (Belgium)\n"
3
  "Project-Id-Version: Loco Translate\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Jan 02 2014 17:30:57 GMT+0000 (GMT)\n"
6
+ "PO-Revision-Date: Wed Jan 15 2014 00:21:44 GMT+0000 (GMT)\n"
7
  "Last-Translator: admin <support@localise.biz>\n"
8
  "Language-Team: \n"
9
  "Language: Dutch (Belgium)\n"
lib/build/gettext-compiled.php CHANGED
@@ -2,6 +2,6 @@
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
- * @date Sat, 04 Jan 2014 20:28:03 +0000
6
  */
7
- class LocoArray implements Iterator { private $i; private $length; private $keys; private $vals; private $index; public function __construct( array $data = array() ){ $this->keys = array_keys( $data ); $this->vals = array_values( $data ); $this->index = array_flip( array_map( 'strtolower', $this->keys ) ); $this->length = count( $this->keys ); $this->rewind(); } public function add( $key, $val ){ $k = strtolower($key); if( isset($this->index[$k]) ){ $this->keys[ $this->index[$k] ] = $key; $this->vals[ $this->index[$k] ] = $val; } else { $this->index[$k] = $this->length++; $this->keys[] = $key; $this->vals[] = $val; } return $this; } public function to_array(){ return array_combine( $this->keys, $this->vals ); } function __toString(){ $pairs = array(); foreach( $this->keys as $i => $key ){ $pairs[] = trim($key).': '.$this->vals[$i]; } return implode("\n", $pairs ); } public function count(){ return $this->length; } public function trimmed( $prop ){ return trim( $this->__get($prop) ); } public function has( $key ){ return isset( $this->index[ strtolower($key) ] ); } public function __get( $key ){ $key = strtolower( $key ); return isset($this->index[$key]) ? $this->vals[ $this->index[$key] ] : null; } public function rewind(){ $this->i = reset( $this->index ); } public function key(){ return is_int($this->i) ? $this->keys[$this->i] : null; } public function current(){ return is_int($this->i) ? $this->vals[$this->i] : null; } public function valid(){ return is_int($this->i); } public function next(){ $this->i = next( $this->index ); } } define( 'LOCO_FLAG_OK', 0 ); define( 'LOCO_FLAG_ERROR', 1 ); define( 'LOCO_FLAG_REVIEW', 2 ); define( 'LOCO_FLAG_PENDING', 3 ); define( 'LOCO_FLAG_FUZZY', 4 ); function loco_flags(){ static $flags = array ( LOCO_FLAG_OK => 'Translated', LOCO_FLAG_ERROR => 'Incorrect', LOCO_FLAG_REVIEW => 'Needs review', LOCO_FLAG_PENDING => 'Pending sign-off', LOCO_FLAG_FUZZY => 'Fuzzy', ); return $flags; } function loco_flag( $f ){ $flags = loco_flags(); if( ! isset($flags[$f]) ){ throw new Exception('Invalid LOCO_FLAG_ constant ', var_export($f,1) ); } return $flags[$f]; } function loco_po_flags(){ static $map = array ( LOCO_FLAG_FUZZY => '#, fuzzy', ); return $map; } function loco_parse_po( $src ){ $i = -1; $key = ''; $entries = array(); $template = array( '#' => array(), 'id' => array(), 'str' => array(), 'ctxt' => array() ); foreach( preg_split('/[\r\n]+/', $src) as $line ){ while( $line = trim($line) ){ $c = $line{0}; if( '"' === $c ){ if( $key && isset($entry) ){ $entry[$key][$idx][] = loco_po_unquote( $line ); } } else if( '#' === $c ){ if( isset($entry['i']) ){ unset( $entry ); $entry = $template; } $f = empty($line{1}) ? ' ' : $line{1}; $entry['#'][$f][] = trim( substr( $line, 1+strlen($f) ), "/ \n\r\t" ); } else if( preg_match('/^msg(id|str|ctxt|id_plural)(?:\[(\d+)\])?[ \t]+/', $line, $r ) ){ $key = $r[1]; $idx = isset($r[2]) ? (int) $r[2] : 0; if( 'str' === $key ){ if( ! isset($entry['i']) ){ $entry['i'] = ++$i; $entries[$i] = &$entry; } } else if( ! isset($entry) || isset($entry['i']) ){ unset( $entry ); $entry = $template; } $line = substr( $line, strlen($r[0]) ); continue; } continue 2; } } unset( $entry ); $assets = array(); foreach( $entries as $i => $entry ){ $asset = array ( 'id' => '', 'source' => implode('',$entry['id'][0]), 'target' => implode('',$entry['str'][0]), ); if( isset($entry['ctxt'][0]) ){ $asset['context'] = implode('',$entry['ctxt'][0]); } $comments = array(); isset($entry['#'][' ']) and $comments = array_merge( $comments, $entry['#'][' ']); isset($entry['#']['.']) and $comments = array_merge( $comments, $entry['#']['.']); $comments and $asset['comment'] = implode("\n", $comments); if( isset($entry['#'][':']) ){ $asset['refs'] = implode( "\n", $entry['#'][':'] ); } if( isset($entry['#'][',']) ){ foreach( $entry['#'][','] as $flag ){ if( $flag = loco_po_parse_flag($flag) ){ $asset['flag'] = $flag; break; } } } $pidx = count($assets); $assets[] = $asset; if( isset($entry['id_plural']) || isset($entry['str'][1]) ){ $idx = 0; $num = max( 2, count($entry['str']) ); while( ++$idx < $num ){ $assets[] = array ( 'id' => '', 'parent' => $pidx, 'plural' => $idx, 'source' => isset($entry['id_plural'][0]) ? implode('',$entry['id_plural'][0]) : '', 'target' => isset($entry['str'][$idx]) ? implode('',$entry['str'][$idx]) : '', ); } } } return $assets; } function loco_po_parse_flag( $text, $flag = 0 ){ $map = loco_po_flags(); foreach( explode(',',$text) as $needle ){ if( $needle = trim($needle) ){ foreach( $map as $loco_flag => $haystack ){ if( false !== stripos($haystack, $needle) ){ $flag |= $loco_flag; break; } } } } return $flag; } function loco_po_unquote( $str ){ return substr( stripcslashes($str), 1, -1 ); } function loco_parse_po_headers( $str ){ $headers = new LocoArray( array() ); foreach( explode("\n",$str) as $line ){ $i = strpos($line,':') and $key = trim( substr($line,0,$i) ) and $headers->add( $key, trim( substr($line,++$i) ) ); } return $headers; } final class PHPTokens implements Iterator { private $tokens; private $i; private $skip_tokens = array(); private $skip_strings = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function ignore(){ foreach( func_get_args() as $t ){ if( is_int($t) ){ $this->skip_tokens[$t] = true; } else { $this->skip_strings[$t] = true; } } return $this; } public function advance(){ $this->next(); return $this->current(); } public function rewind(){ $this->i = false === reset($this->tokens) ? null : key($this->tokens); } public function valid(){ return isset($this->i); } public function key(){ return $this->i; } public function next(){ $this->i = false === next($this->tokens) ? null : key($this->tokens); } public function current(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( is_array($tok) ){ if( isset($this->skip_tokens[$tok[0]]) ){ $this->next(); } else { return $tok; } } else if( isset($this->skip_strings[$tok]) ){ $this->next(); } else { return $tok; } } return false; } } function loco_parse_comment($comment){ if( '*' === $comment{1} ){ $lines = array(); foreach( explode("\n", $comment) as $line ){ $line and $lines[] = trim($line,"/* \r\t"); } $comment = implode("\n", $lines); } return trim( $comment,"/ \n\r\t" ); } function decapse_string( $s ){ if( empty($s) ){ return ''; } $q = $s{0}; switch( $q ){ case "'": case '"': $s = substr( $s, 1, -1 ); if( '"' === $q ){ return stripcslashes($s); } return str_replace( array( '\\'.$q, '\\\\' ), array( $q, '\\' ), $s ); default: trigger_error( "Bad quote character ($q) at offset 0", E_USER_NOTICE ); return $s; } } function loco_extract_php( array $tokens, $fileref = '' ){ $extractor = new LocoPHPExtractor; return $extractor->extract( $tokens, $fileref ); } final class LocoPHPExtractor { private static $rules = array ( '_' => 's', 'gettext' => 's', 'dgettext' => '_s', 'ngettext' => 'sp', 'dngettext' => '_sp', '__' => 's', '_e' => 's', '_c' => 's', '_n' => 'sp', '_n_noop' => 'sp', '_nc' => 'sp', '__ngettext' => 'sp', '__ngettext_noop' => 'sp', '_x' => 'sc', '_ex' => 'sc', '_nx' => 'sp_c', '_nx_noop' => 'spc', '_n_js' => 'sp', '_nx_js' => 'spc', 'esc_attr__' => 's', 'esc_html__' => 's', 'esc_attr_e' => 's', 'esc_html_e' => 's', 'esc_attr_x' => 'sc', 'esc_html_x' => 'sc', 'comments_number_link' => '_sp', 't' => 's', 'st' => 's', 'trans' => 's', 'transChoice' => 'sp', ); private $exp = array(); private $reg = array(); public function extract( array $tokens, $fileref = '' ){ $tokens = new PHPTokens( $tokens ); $tokens->ignore( T_WHITESPACE ); $comment = ''; foreach( $tokens as $tok ){ if( isset($args) ){ if( ')' === $tok ){ isset($arg) and $arg and $args[] = $arg; $this->push( $rule, $args, $comment, $ref ); unset($args,$arg); $comment = ''; } else if( ',' === $tok ){ isset($arg) and $arg and $args[] = $arg; unset($arg); } else if( isset($arg) ){ $arg[] = $tok; } else { $arg = array( $tok ); } } else if( is_array($tok) ){ list($t,$s) = $tok; if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $comment = $s; } else if( T_STRING === $t && isset(self::$rules[$s]) && '(' === $tokens->advance() ){ $rule = self::$rules[$s]; $args = array(); $ref = $fileref ? $fileref.':'.$tok[2]: ''; } else if( $comment && false === stripos($comment, 'translators') ){ $comment = ''; } } } return $this->exp; } private function push( $rule, array $args, $comment = '', $ref = '' ){ $s = strpos( $rule, 's'); $p = strpos( $rule, 'p'); $c = strpos( $rule, 'c'); foreach( $args as $i => $tokens ){ if( 1 === count($tokens) && is_array($tokens[0]) && T_CONSTANT_ENCAPSED_STRING === $tokens[0][0] ){ $args[$i] = decapse_string( $tokens[0][1] ); } else { $args[$i] = null; } } $key = $msgid = $args[$s]; if( ! $msgid ){ return null; } $entry = array ( 'id' => '', 'source' => $msgid, 'target' => '', ); if( $c && isset($args[$c]) ){ $entry['context'] = $args[$c]; $key .= "\0". $args[$c]; } if( $ref ){ $entry['refs'] = $ref; } if( $comment ){ $entry['comment'] = loco_parse_comment($comment); } if( isset($this->reg[$key]) ){ $index = $this->reg[$key]; $a = array(); isset($this->exp[$index]['refs']) and $a[] = $this->exp[$index]['refs']; isset($entry['refs']) and $a[] = $entry['refs']; $a && $this->exp[$index]['refs'] = implode(" ", $a ); $a = array(); isset($this->exp[$index]['comment']) and $a[] = $this->exp[$index]['comment']; isset($entry['comment']) and $a[] = $entry['comment']; $a && $this->exp[$index]['comment'] = implode("\n", $a ); } else { $index = count($this->exp); $this->reg[$key] = $index; $this->exp[] = $entry; } if( $p && isset($args[$p]) ){ $msgid_plural = $args[$p]; $entry = array ( 'id' => '', 'source' => $msgid_plural, 'target' => '', 'plural' => 1, 'parent' => $index, ); $key = $msgid_plural."\0\0"; if( isset($this->reg[$key]) ){ $plural_index = $this->reg[$key]; $this->exp[$plural_index] = $entry; } else { $plural_index = count($this->exp); $this->reg[$key] = $plural_index; $this->exp[] = $entry; } } return $index; } public function get_xgettext( $input = '-' ){ $cmd = defined('WHICH_XGETTEXT') ? WHICH_XGETTEXT : 'xgettext'; $cmd.= ' -LPHP -c -o-'; if( $k = $this->get_xgettext_keywords() ){ $cmd.= ' -k'.implode(' -k', $k ); } return $cmd.' '.$input; } public function get_xgettext_keywords(){ $ks = array(); foreach( self::$rules as $word => $rule ){ $s = strpos( $rule, 's'); $k = $word.':'.++$s; if( false !== $p = strpos( $rule, 'p') ){ $k.= ','.++$p; } if( false !== $p = strpos( $rule, 'c') ){ $k.= ','.++$p.'c'; } $ks[] = $k; } return $ks; } } function loco_relative_path( $source_path, $target_path ){ $rel = ''; $common = false; $src = preg_split('!/+!', $source_path, -1, PREG_SPLIT_NO_EMPTY ); $dst = preg_split('!/+!', $target_path, -1, PREG_SPLIT_NO_EMPTY ); while( $src && $dst ){ if( current($src) !== current($dst) ){ break; } $common = true; array_shift($src); array_shift($dst); } if( ! $common ){ return $target_path; } if( $src ){ $up = array_fill( 0, count($src), '..' ); $rel = implode('/', $up ); } if( $dst ){ $rel && $rel .= '/'; $rel .= implode('/', $dst ); } return $rel; } class LocoMo { private $bin; private $msgs; private $head; private $hash; public function __construct( array $export, LocoArray $head = null ){ if( ! $head ){ $head = new LocoArray( array( 'Project-Id-Version' => 'None', 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '8bit', 'X-Generator' => 'Loco '.PLUG_HTTP_ADDR, ) ); } $this->head = $head; $this->msgs = $export; $this->bin = ''; } public function enableHash(){ return $this->hash = new LocoMoTable; } public function setHeader( $key, $val ){ $this->head->add($key, $val); return $this; } public function setProject( LocoProject $Proj ){ return $this ->setHeader( 'Project-Id-Version', $Proj->proj_name ) ->setHeader($key, $val) ; } public function setLocale( LocoProjectLocale $Loc ){ return $this ->setHeader( 'Language', $Loc->label ) ->setHeader( 'Plural-Forms', 'nplurals='.$Loc->nplurals.'; plural='.$Loc->pluraleq.';' ) ; } public function count(){ return count($this->msgs); } public function compile(){ $table = array(''); $sources = array(''); $targets = array( $this->head->__toString() ); foreach( $this->msgs as $r ){ $msgid = $r['key']; if( isset($r['context']) && $r['context'] ){ $msgid or $msgid = "(".$r['context'].')'; $msgid = $r['context']."\x04".$msgid; } if( ! $msgid ){ continue; } $msgstr = $r['translation']; if( ! $msgstr ){ continue; } $table[] = $msgid; if( isset($r['plurals']) ){ foreach( $r['plurals'] as $i => $p ){ if( $i === 0 ){ $msgid .= "\0".$p['key']; } $msgstr .= "\0".$p['translation']; } } $sources[] = $msgid; $targets[] = $msgstr; } asort( $sources, SORT_STRING ); $this->bin = ''; $this->writeInteger( 0x950412de ); $this->writeInteger( 0 ); $n = count($sources); $this->writeInteger( $n ); $offset = 28; $this->writeInteger( $offset ); $offset += $n * 8; $this->writeInteger( $offset ); if( $this->hash ){ sort( $table, SORT_STRING ); $this->hash->compile( $table ); $s = $this->hash->count(); } else { $s = 0; } $this->writeInteger( $s ); $offset += $n * 8; $this->writeInteger( $offset ); if( $s ){ $offset += $s * 4; } $source = ''; foreach( $sources as $i => $str ){ $source .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } $target = ''; foreach( array_keys($sources) as $i ){ $str = $targets[$i]; $target .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } if( $this->hash ){ $this->bin .= $this->hash->__toString(); } $this->bin .= $source; $this->bin .= $target; return $this->bin; } private function writeInteger( $num ){ $this->bin .= pack( 'V', $num ); return $this; } } class LocoMoTable { private $size = 0; private $bin = ''; private $map; public function __construct( $data = null ){ if( is_array($data) ){ $this->compile( $data ); } else if( $data ){ $this->parse( $data ); } } public function count(){ if( ! isset($this->size) ){ if( $this->bin ){ $this->size = (int) ( strlen( $this->bin ) / 4 ); } else if( is_array($this->map) ){ $this->size = count($this->map); } if( ! self::is_prime($this->size) || $this->size < 3 ){ throw new Exception('Size expected to be prime number above 2'); } } return $this->size; } public function bytes(){ return $this->count() * 4; } public function __toString(){ return $this->bin; } public function export(){ if( ! is_array($this->map) ){ $this->parse( $this->bin ); } return $this->map; } private function reset( $length ){ $this->size = max( 3, self::next_prime ( $length * 4 / 3 ) ); $this->bin = null; $this->map = array(); return $this->size; } public function compile( array $msgids ){ $hash_tab_size = $this->reset( count($msgids) ); $packed = array_fill( 0, $hash_tab_size, "\0\0\0\0" ); $j = 0; foreach( $msgids as $msgid ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $hash_tab_size; if( array_key_exists($idx, $this->map) ){ $incr = 1 + ( $hash_val % ( $hash_tab_size - 2 ) ); do { $idx += $incr; if( $hash_val === $idx ){ throw new Exception('Unable to find empty slot in hash table'); } $idx %= $hash_tab_size; } while( array_key_exists($idx, $this->map ) ); } $this->map[$idx] = $j; $packed[$idx] = pack('V', ++$j ); } return $this->bin = implode('',$packed); } public function lookup( $msgid, array $msgids ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $this->size; $incr = 1 + ( $hash_val % ( $this->size - 2 ) ); while( true ){ if( ! array_key_exists($idx, $this->map) ){ break; } $j = $this->map[$idx]; if( isset($msgids[$j]) && $msgid === $msgids[$j] ){ return $j; } $idx += $incr; if( $idx === $hash_val ){ break; } $idx %= $this->size; } return -1; } public function parse( $bin ){ $this->bin = (string) $bin; $this->size = null; $hash_tab_size = $this->count(); $this->map = array(); $idx = -1; $byte = 0; while( ++$idx < $hash_tab_size ){ $word = substr( $this->bin, $byte, 4 ); if( "\0\0\0\0" !== $word ){ list(,$j) = unpack('V', $word ); $this->map[$idx] = $j - 1; } $byte += 4; } return $this->map; } public static function hashpjw( $str ){ $i = -1; $hval = 0; $len = strlen($str); while( ++$i < $len ){ $ord = ord( $str{$i} ); $hval = ( $hval << 4 ) + $ord; $g = $hval & 0xf0000000; if( $g !== 0 ){ $hval ^= $g >> 24; $hval ^= $g; } } return $hval; } private static function next_prime( $seed ){ $seed |= 1; while ( ! self::is_prime($seed) ){ $seed += 2; } return $seed; } private static function is_prime( $num ) { if ($num === 1 ){ return false; } if( $num === 2 ){ return true; } if( $num % 2 == 0 ) { return false; } for( $i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if($num % $i == 0 ){ return false; } } return true; } } function loco_msgfmt( $po, $withhash = false ){ if( ! is_array($po) ){ $po = loco_parse_po( $po ); } $head = null; if( isset($po[0]) && '' === $po[0]['source'] ){ $head = loco_parse_po_headers( $po[0]['target'] ); $po[0] = null; } $export = array(); foreach( $po as $i => $r ){ if( ! $r ){ continue; } $msg = array ( 'key' => $r['source'], 'translation' => $r['target'], ); if( isset($r['parent']) ){ unset( $parent ); $parent = &$export[ $r['parent'] ]; isset($parent['plurals']) or $parent['plurals'] = array(); $parent['plurals'][] = $msg; } else { isset($r['context']) and $msg['context'] = $r['context']; $export[$i] = $msg; } } $mo = new LocoMo( $export, $head ); if( $withhash ){ $mo->enableHash(); } return $mo->compile(); } function loco_po_stats( array $po ){ $t = $n = $f = $u = 0; foreach( $po as $r ){ if( ! isset($r['source']) || '' === $r['source'] ){ continue; } if( isset($r['parent']) && is_int($r['parent']) ){ continue; } $t++; if( '' === $r['target'] ){ $u++; } else if( isset($r['flag']) && LOCO_FLAG_FUZZY === $r['flag'] ){ $f++; } else { $n++; } } $r = $t && $n ? $n / $t : 0; $p = (string) round( $r * 100 ); return compact('t','p','f','u'); }
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
+ * @date Tue, 14 Jan 2014 22:51:56 +0000
6
  */
7
+ class LocoArray implements Iterator { private $i; private $length; private $keys; private $vals; private $index; public function __construct( array $data = array() ){ $this->keys = array_keys( $data ); $this->vals = array_values( $data ); $this->index = array_flip( array_map( 'strtolower', $this->keys ) ); $this->length = count( $this->keys ); $this->rewind(); } public function add( $key, $val ){ $k = strtolower($key); if( isset($this->index[$k]) ){ $this->keys[ $this->index[$k] ] = $key; $this->vals[ $this->index[$k] ] = $val; } else { $this->index[$k] = $this->length++; $this->keys[] = $key; $this->vals[] = $val; } return $this; } public function to_array(){ return array_combine( $this->keys, $this->vals ); } function __toString(){ $pairs = array(); foreach( $this->keys as $i => $key ){ $pairs[] = trim($key).': '.$this->vals[$i]; } return implode("\n", $pairs ); } public function count(){ return $this->length; } public function trimmed( $prop ){ return trim( $this->__get($prop) ); } public function has( $key ){ return isset( $this->index[ strtolower($key) ] ); } public function __get( $key ){ $key = strtolower( $key ); return isset($this->index[$key]) ? $this->vals[ $this->index[$key] ] : null; } public function rewind(){ $this->i = reset( $this->index ); } public function key(){ return is_int($this->i) ? $this->keys[$this->i] : null; } public function current(){ return is_int($this->i) ? $this->vals[$this->i] : null; } public function valid(){ return is_int($this->i); } public function next(){ $this->i = next( $this->index ); } } define( 'LOCO_FLAG_OK', 0 ); define( 'LOCO_FLAG_ERROR', 1 ); define( 'LOCO_FLAG_REVIEW', 2 ); define( 'LOCO_FLAG_PENDING', 3 ); define( 'LOCO_FLAG_FUZZY', 4 ); function loco_flags(){ static $flags = array ( LOCO_FLAG_OK => 'Translated', LOCO_FLAG_ERROR => 'Incorrect', LOCO_FLAG_REVIEW => 'Needs review', LOCO_FLAG_PENDING => 'Pending sign-off', LOCO_FLAG_FUZZY => 'Fuzzy', ); return $flags; } function loco_flag( $f ){ $flags = loco_flags(); if( ! isset($flags[$f]) ){ throw new Exception('Invalid LOCO_FLAG_ constant ', var_export($f,1) ); } return $flags[$f]; } function loco_po_flags(){ static $map = array ( LOCO_FLAG_FUZZY => '#, fuzzy', ); return $map; } function loco_parse_po( $src ){ $i = -1; $key = ''; $entries = array(); $template = array( '#' => array(), 'id' => array(), 'str' => array(), 'ctxt' => array() ); foreach( preg_split('/[\r\n]+/', $src) as $line ){ while( $line = trim($line) ){ $c = $line{0}; if( '"' === $c ){ if( $key && isset($entry) ){ $entry[$key][$idx][] = loco_po_unquote( $line ); } } else if( '#' === $c ){ if( isset($entry['i']) ){ unset( $entry ); $entry = $template; } $f = empty($line{1}) ? ' ' : $line{1}; $entry['#'][$f][] = trim( substr( $line, 1+strlen($f) ), "/ \n\r\t" ); } else if( preg_match('/^msg(id|str|ctxt|id_plural)(?:\[(\d+)\])?[ \t]+/', $line, $r ) ){ $key = $r[1]; $idx = isset($r[2]) ? (int) $r[2] : 0; if( 'str' === $key ){ if( ! isset($entry['i']) ){ $entry['i'] = ++$i; $entries[$i] = &$entry; } } else if( ! isset($entry) || isset($entry['i']) ){ unset( $entry ); $entry = $template; } $line = substr( $line, strlen($r[0]) ); continue; } continue 2; } } unset( $entry ); $assets = array(); foreach( $entries as $i => $entry ){ $asset = array ( 'id' => '', 'source' => implode('',$entry['id'][0]), 'target' => implode('',$entry['str'][0]), ); if( isset($entry['ctxt'][0]) ){ $asset['context'] = implode('',$entry['ctxt'][0]); } $comments = array(); isset($entry['#'][' ']) and $comments = array_merge( $comments, $entry['#'][' ']); isset($entry['#']['.']) and $comments = array_merge( $comments, $entry['#']['.']); $comments and $asset['comment'] = implode("\n", $comments); if( isset($entry['#'][':']) ){ $asset['refs'] = implode( "\n", $entry['#'][':'] ); } if( isset($entry['#'][',']) ){ foreach( $entry['#'][','] as $flag ){ if( $flag = loco_po_parse_flag($flag) ){ $asset['flag'] = $flag; break; } } } $pidx = count($assets); $assets[] = $asset; if( isset($entry['id_plural']) || isset($entry['str'][1]) ){ $idx = 0; $num = max( 2, count($entry['str']) ); while( ++$idx < $num ){ $assets[] = array ( 'id' => '', 'parent' => $pidx, 'plural' => $idx, 'source' => isset($entry['id_plural'][0]) ? implode('',$entry['id_plural'][0]) : '', 'target' => isset($entry['str'][$idx]) ? implode('',$entry['str'][$idx]) : '', ); } } } return $assets; } function loco_po_parse_flag( $text, $flag = 0 ){ $map = loco_po_flags(); foreach( explode(',',$text) as $needle ){ if( $needle = trim($needle) ){ foreach( $map as $loco_flag => $haystack ){ if( false !== stripos($haystack, $needle) ){ $flag |= $loco_flag; break; } } } } return $flag; } function loco_po_unquote( $str ){ return substr( stripcslashes($str), 1, -1 ); } function loco_parse_po_headers( $str ){ $headers = new LocoArray( array() ); foreach( explode("\n",$str) as $line ){ $i = strpos($line,':') and $key = trim( substr($line,0,$i) ) and $headers->add( $key, trim( substr($line,++$i) ) ); } return $headers; } final class PHPTokens implements Iterator { private $tokens; private $i; private $skip_tokens = array(); private $skip_strings = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function ignore(){ foreach( func_get_args() as $t ){ if( is_int($t) ){ $this->skip_tokens[$t] = true; } else { $this->skip_strings[$t] = true; } } return $this; } public function advance(){ $this->next(); return $this->current(); } public function rewind(){ $this->i = false === reset($this->tokens) ? null : key($this->tokens); } public function valid(){ return isset($this->i); } public function key(){ return $this->i; } public function next(){ $this->i = false === next($this->tokens) ? null : key($this->tokens); } public function current(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( is_array($tok) ){ if( isset($this->skip_tokens[$tok[0]]) ){ $this->next(); } else { return $tok; } } else if( isset($this->skip_strings[$tok]) ){ $this->next(); } else { return $tok; } } return false; } } function loco_parse_comment($comment){ if( '*' === $comment{1} ){ $lines = array(); foreach( explode("\n", $comment) as $line ){ $line and $lines[] = trim($line,"/* \r\t"); } $comment = implode("\n", $lines); } return trim( $comment,"/ \n\r\t" ); } function decapse_string( $s ){ if( empty($s) ){ return ''; } $q = $s{0}; switch( $q ){ case "'": case '"': $s = substr( $s, 1, -1 ); if( '"' === $q ){ return stripcslashes($s); } return str_replace( array( '\\'.$q, '\\\\' ), array( $q, '\\' ), $s ); default: trigger_error( "Bad quote character ($q) at offset 0", E_USER_NOTICE ); return $s; } } function loco_extract_php( array $tokens, $fileref = '' ){ $extractor = new LocoPHPExtractor; return $extractor->extract( $tokens, $fileref ); } final class LocoPHPExtractor { private static $rules = array ( '_' => 's', 'gettext' => 's', 'dgettext' => '_s', 'ngettext' => 'sp', 'dngettext' => '_sp', '__' => 's', '_e' => 's', '_c' => 's', '_n' => 'sp', '_n_noop' => 'sp', '_nc' => 'sp', '__ngettext' => 'sp', '__ngettext_noop' => 'sp', '_x' => 'sc', '_ex' => 'sc', '_nx' => 'sp_c', '_nx_noop' => 'spc', '_n_js' => 'sp', '_nx_js' => 'spc', 'esc_attr__' => 's', 'esc_html__' => 's', 'esc_attr_e' => 's', 'esc_html_e' => 's', 'esc_attr_x' => 'sc', 'esc_html_x' => 'sc', 'comments_number_link' => '_sp', 't' => 's', 'st' => 's', 'trans' => 's', 'transChoice' => 'sp', ); private $exp = array(); private $reg = array(); public function extract( array $tokens, $fileref = '' ){ $tokens = new PHPTokens( $tokens ); $tokens->ignore( T_WHITESPACE ); $comment = ''; foreach( $tokens as $tok ){ if( isset($args) ){ if( ')' === $tok ){ isset($arg) and $arg and $args[] = $arg; $this->push( $rule, $args, $comment, $ref ); unset($args,$arg); $comment = ''; } else if( ',' === $tok ){ isset($arg) and $arg and $args[] = $arg; unset($arg); } else if( isset($arg) ){ $arg[] = $tok; } else { $arg = array( $tok ); } } else if( is_array($tok) ){ list($t,$s) = $tok; if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $comment = $s; } else if( T_STRING === $t && isset(self::$rules[$s]) && '(' === $tokens->advance() ){ $rule = self::$rules[$s]; $args = array(); $ref = $fileref ? $fileref.':'.$tok[2]: ''; } else if( $comment && false === stripos($comment, 'translators') ){ $comment = ''; } } } return $this->exp; } private function push( $rule, array $args, $comment = '', $ref = '' ){ $s = strpos( $rule, 's'); $p = strpos( $rule, 'p'); $c = strpos( $rule, 'c'); foreach( $args as $i => $tokens ){ if( 1 === count($tokens) && is_array($tokens[0]) && T_CONSTANT_ENCAPSED_STRING === $tokens[0][0] ){ $args[$i] = decapse_string( $tokens[0][1] ); } else { $args[$i] = null; } } $key = $msgid = $args[$s]; if( ! $msgid ){ return null; } $entry = array ( 'id' => '', 'source' => $msgid, 'target' => '', ); if( $c && isset($args[$c]) ){ $entry['context'] = $args[$c]; $key .= "\0". $args[$c]; } if( $ref ){ $entry['refs'] = $ref; } if( $comment ){ $entry['comment'] = loco_parse_comment($comment); } if( isset($this->reg[$key]) ){ $index = $this->reg[$key]; $a = array(); isset($this->exp[$index]['refs']) and $a[] = $this->exp[$index]['refs']; isset($entry['refs']) and $a[] = $entry['refs']; $a && $this->exp[$index]['refs'] = implode(" ", $a ); $a = array(); isset($this->exp[$index]['comment']) and $a[] = $this->exp[$index]['comment']; isset($entry['comment']) and $a[] = $entry['comment']; $a && $this->exp[$index]['comment'] = implode("\n", $a ); } else { $index = count($this->exp); $this->reg[$key] = $index; $this->exp[] = $entry; } if( $p && isset($args[$p]) ){ $msgid_plural = $args[$p]; $entry = array ( 'id' => '', 'source' => $msgid_plural, 'target' => '', 'plural' => 1, 'parent' => $index, ); $key = $msgid_plural."\0\0"; if( isset($this->reg[$key]) ){ $plural_index = $this->reg[$key]; $this->exp[$plural_index] = $entry; } else { $plural_index = count($this->exp); $this->reg[$key] = $plural_index; $this->exp[] = $entry; } } return $index; } public function get_xgettext( $input = '-' ){ $cmd = defined('WHICH_XGETTEXT') ? WHICH_XGETTEXT : 'xgettext'; $cmd.= ' -LPHP -c -o-'; if( $k = $this->get_xgettext_keywords() ){ $cmd.= ' -k'.implode(' -k', $k ); } return $cmd.' '.$input; } public function get_xgettext_keywords(){ $ks = array(); foreach( self::$rules as $word => $rule ){ $s = strpos( $rule, 's'); $k = $word.':'.++$s; if( false !== $p = strpos( $rule, 'p') ){ $k.= ','.++$p; } if( false !== $p = strpos( $rule, 'c') ){ $k.= ','.++$p.'c'; } $ks[] = $k; } return $ks; } } function loco_relative_path( $source_path, $target_path ){ $rel = ''; $common = false; $src = preg_split('!/+!', $source_path, -1, PREG_SPLIT_NO_EMPTY ); $dst = preg_split('!/+!', $target_path, -1, PREG_SPLIT_NO_EMPTY ); while( $src && $dst ){ if( current($src) !== current($dst) ){ break; } $common = true; array_shift($src); array_shift($dst); } if( ! $common ){ return $target_path; } if( $src ){ $up = array_fill( 0, count($src), '..' ); $rel = implode('/', $up ); } if( $dst ){ $rel && $rel .= '/'; $rel .= implode('/', $dst ); } return $rel; } class LocoMo { private $bin; private $msgs; private $head; private $hash; public function __construct( array $export, LocoArray $head = null ){ if( ! $head ){ $head = new LocoArray( array( 'Project-Id-Version' => 'Loco', 'Language' => 'English', 'Plural-Forms' => 'nplurals=2; plural=(n!=1);', 'MIME-Version' => '1.0', 'Content-Type' => 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding' => '8bit', 'X-Generator' => 'Loco '.PLUG_HTTP_ADDR, ) ); } $this->head = $head; $this->msgs = $export; $this->bin = ''; } public function enableHash(){ return $this->hash = new LocoMoTable; } public function setHeader( $key, $val ){ $this->head->add($key, $val); return $this; } public function setProject( LocoProject $Proj ){ return $this ->setHeader( 'Project-Id-Version', $Proj->proj_name ) ->setHeader($key, $val) ; } public function setLocale( LocoProjectLocale $Loc ){ return $this ->setHeader( 'Language', $Loc->label ) ->setHeader( 'Plural-Forms', 'nplurals='.$Loc->nplurals.'; plural='.$Loc->pluraleq.';' ) ; } public function count(){ return count($this->msgs); } public function compile(){ $table = array(''); $sources = array(''); $targets = array( $this->head->__toString() ); foreach( $this->msgs as $r ){ $msgid = $r['key']; if( isset($r['context']) && $r['context'] ){ $msgid or $msgid = "(".$r['context'].')'; $msgid = $r['context']."\x04".$msgid; } if( ! $msgid ){ continue; } $msgstr = $r['translation']; if( ! $msgstr ){ continue; } $table[] = $msgid; if( isset($r['plurals']) ){ foreach( $r['plurals'] as $i => $p ){ if( $i === 0 ){ $msgid .= "\0".$p['key']; } $msgstr .= "\0".$p['translation']; } } $sources[] = $msgid; $targets[] = $msgstr; } asort( $sources, SORT_STRING ); $this->bin = ''; $this->writeInteger( 0x950412de ); $this->writeInteger( 0 ); $n = count($sources); $this->writeInteger( $n ); $offset = 28; $this->writeInteger( $offset ); $offset += $n * 8; $this->writeInteger( $offset ); if( $this->hash ){ sort( $table, SORT_STRING ); $this->hash->compile( $table ); $s = $this->hash->count(); } else { $s = 0; } $this->writeInteger( $s ); $offset += $n * 8; $this->writeInteger( $offset ); if( $s ){ $offset += $s * 4; } $source = ''; foreach( $sources as $i => $str ){ $source .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } $target = ''; foreach( array_keys($sources) as $i ){ $str = $targets[$i]; $target .= $str."\0"; $this->writeInteger( $strlen = strlen($str) ); $this->writeInteger( $offset ); $offset += $strlen + 1; } if( $this->hash ){ $this->bin .= $this->hash->__toString(); } $this->bin .= $source; $this->bin .= $target; return $this->bin; } private function writeInteger( $num ){ $this->bin .= pack( 'V', $num ); return $this; } } class LocoMoTable { private $size = 0; private $bin = ''; private $map; public function __construct( $data = null ){ if( is_array($data) ){ $this->compile( $data ); } else if( $data ){ $this->parse( $data ); } } public function count(){ if( ! isset($this->size) ){ if( $this->bin ){ $this->size = (int) ( strlen( $this->bin ) / 4 ); } else if( is_array($this->map) ){ $this->size = count($this->map); } else { return 0; } if( ! self::is_prime($this->size) || $this->size < 3 ){ throw new Exception('Size expected to be prime number above 2, got '.$this->size); } } return $this->size; } public function bytes(){ return $this->count() * 4; } public function __toString(){ return $this->bin; } public function export(){ if( ! is_array($this->map) ){ $this->parse( $this->bin ); } return $this->map; } private function reset( $length ){ $this->size = max( 3, self::next_prime ( $length * 4 / 3 ) ); $this->bin = null; $this->map = array(); return $this->size; } public function compile( array $msgids ){ $hash_tab_size = $this->reset( count($msgids) ); $packed = array_fill( 0, $hash_tab_size, "\0\0\0\0" ); $j = 0; foreach( $msgids as $msgid ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $hash_tab_size; if( array_key_exists($idx, $this->map) ){ $incr = 1 + ( $hash_val % ( $hash_tab_size - 2 ) ); do { $idx += $incr; if( $hash_val === $idx ){ throw new Exception('Unable to find empty slot in hash table'); } $idx %= $hash_tab_size; } while( array_key_exists($idx, $this->map ) ); } $this->map[$idx] = $j; $packed[$idx] = pack('V', ++$j ); } return $this->bin = implode('',$packed); } public function lookup( $msgid, array $msgids ){ $hash_val = self::hashpjw( $msgid ); $idx = $hash_val % $this->size; $incr = 1 + ( $hash_val % ( $this->size - 2 ) ); while( true ){ if( ! array_key_exists($idx, $this->map) ){ break; } $j = $this->map[$idx]; if( isset($msgids[$j]) && $msgid === $msgids[$j] ){ return $j; } $idx += $incr; if( $idx === $hash_val ){ break; } $idx %= $this->size; } return -1; } public function parse( $bin ){ $this->bin = (string) $bin; $this->size = null; $hash_tab_size = $this->count(); $this->map = array(); $idx = -1; $byte = 0; while( ++$idx < $hash_tab_size ){ $word = substr( $this->bin, $byte, 4 ); if( "\0\0\0\0" !== $word ){ list(,$j) = unpack('V', $word ); $this->map[$idx] = $j - 1; } $byte += 4; } return $this->map; } public static function hashpjw( $str ){ $i = -1; $hval = 0; $len = strlen($str); while( ++$i < $len ){ $ord = ord( $str{$i} ); $hval = ( $hval << 4 ) + $ord; $g = $hval & 0xf0000000; if( $g !== 0 ){ $hval ^= $g >> 24; $hval ^= $g; } } return $hval; } private static function next_prime( $seed ){ $seed |= 1; while ( ! self::is_prime($seed) ){ $seed += 2; } return $seed; } private static function is_prime( $num ) { if ($num === 1 ){ return false; } if( $num === 2 ){ return true; } if( $num % 2 == 0 ) { return false; } for( $i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if($num % $i == 0 ){ return false; } } return true; } } function loco_msgfmt( $po, $withhash = false ){ if( ! is_array($po) ){ $po = loco_parse_po( $po ); } $head = null; if( isset($po[0]) && '' === $po[0]['source'] ){ $head = loco_parse_po_headers( $po[0]['target'] ); $po[0] = null; } $export = array(); foreach( $po as $i => $r ){ if( ! $r ){ continue; } $msg = array ( 'key' => $r['source'], 'translation' => $r['target'], ); if( isset($r['parent']) ){ unset( $parent ); $parent = &$export[ $r['parent'] ]; isset($parent['plurals']) or $parent['plurals'] = array(); $parent['plurals'][] = $msg; } else { isset($r['context']) and $msg['context'] = $r['context']; $export[$i] = $msg; } } $mo = new LocoMo( $export, $head ); if( $withhash ){ $mo->enableHash(); } return $mo->compile(); } function loco_po_stats( array $po ){ $t = $n = $f = $u = 0; foreach( $po as $r ){ if( ! isset($r['source']) || '' === $r['source'] ){ continue; } if( isset($r['parent']) && is_int($r['parent']) ){ continue; } $t++; if( '' === $r['target'] ){ $u++; } else if( isset($r['flag']) && LOCO_FLAG_FUZZY === $r['flag'] ){ $f++; } else { $n++; } } $r = $t && $n ? $n / $t : 0; $p = (string) round( $r * 100 ); return compact('t','p','f','u'); }
lib/build/locales-compiled.php CHANGED
@@ -2,6 +2,6 @@
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
- * @date Sat, 04 Jan 2014 20:28:03 +0000
6
  */
7
  return unserialize('a:130:{s:5:"af_ZA";s:24:"Afrikaans (South Africa)";s:5:"ar_AE";s:29:"Arabic (United Arab Emirates)";s:5:"ar_IL";s:15:"Arabic (Israel)";s:5:"az_TR";s:20:"Azerbaijani (Turkey)";s:5:"bg_BG";s:9:"Bulgarian";s:5:"bn_BD";s:20:"Bengali (Bangladesh)";s:5:"bs_BA";s:30:"Bosnian (Bosnia & Herzegovina)";s:5:"cs_CZ";s:5:"Czech";s:5:"cy_GB";s:5:"Welsh";s:5:"da_DK";s:6:"Danish";s:5:"de_AT";s:16:"German (Austria)";s:5:"de_CH";s:20:"German (Switzerland)";s:5:"de_DE";s:6:"German";s:5:"el_CY";s:14:"Greek (Cyprus)";s:5:"el_GR";s:5:"Greek";s:5:"en_AE";s:30:"English (United Arab Emirates)";s:5:"en_AU";s:19:"English (Australia)";s:5:"en_CA";s:16:"English (Canada)";s:5:"en_GB";s:12:"English (UK)";s:5:"en_HK";s:19:"English (Hong Kong)";s:5:"en_IE";s:17:"English (Ireland)";s:5:"en_IN";s:15:"English (India)";s:5:"en_NZ";s:21:"English (New Zealand)";s:5:"en_SG";s:19:"English (Singapore)";s:5:"en_US";s:13:"English (USA)";s:5:"en_ZA";s:22:"English (South Africa)";s:5:"es_AR";s:19:"Spanish (Argentina)";s:5:"es_BO";s:17:"Spanish (Bolivia)";s:5:"es_CL";s:15:"Spanish (Chile)";s:5:"es_CO";s:18:"Spanish (Colombia)";s:5:"es_CR";s:20:"Spanish (Costa Rica)";s:5:"es_CU";s:14:"Spanish (Cuba)";s:5:"es_DO";s:28:"Spanish (Dominican Republic)";s:5:"es_EC";s:17:"Spanish (Ecuador)";s:5:"es_ES";s:7:"Spanish";s:5:"es_GT";s:19:"Spanish (Guatemala)";s:5:"es_HN";s:18:"Spanish (Honduras)";s:5:"es_MX";s:16:"Spanish (Mexico)";s:5:"es_NI";s:19:"Spanish (Nicaragua)";s:5:"es_PA";s:16:"Spanish (Panama)";s:5:"es_PE";s:14:"Spanish (Peru)";s:5:"es_PY";s:18:"Spanish (Paraguay)";s:5:"es_SV";s:21:"Spanish (El Salvador)";s:5:"es_UY";s:17:"Spanish (Uruguay)";s:5:"es_VE";s:19:"Spanish (Venezuela)";s:5:"et_EE";s:8:"Estonian";s:5:"fa_AF";s:21:"Persian (Afghanistan)";s:5:"fa_IR";s:14:"Persian (Iran)";s:5:"fi_FI";s:7:"Finnish";s:5:"fo_DK";s:17:"Faroese (Denmark)";s:5:"fo_FO";s:23:"Faroese (Faroe Islands)";s:5:"fr_BE";s:16:"French (Belgium)";s:5:"fr_CA";s:15:"French (Canada)";s:5:"fr_CH";s:20:"French (Switzerland)";s:5:"fr_FR";s:6:"French";s:5:"fr_HT";s:14:"French (Haiti)";s:5:"ga_IE";s:15:"Irish (Ireland)";s:5:"gl_ES";s:16:"Galician (Spain)";s:5:"gn_PY";s:18:"Guarani (Paraguay)";s:5:"he_IL";s:15:"Hebrew (Israel)";s:5:"hi_IN";s:13:"Hindi (India)";s:5:"hr_HR";s:8:"Croatian";s:5:"ht_HT";s:14:"Haitian Creole";s:5:"hu_HU";s:9:"Hungarian";s:5:"hy_AM";s:8:"Armenian";s:5:"id_ID";s:10:"Indonesian";s:5:"is_IS";s:9:"Icelandic";s:5:"it_CH";s:21:"Italian (Switzerland)";s:5:"it_IT";s:7:"Italian";s:5:"ja_JP";s:8:"Japanese";s:5:"jv_ID";s:20:"Javanese (Indonesia)";s:5:"ka_GE";s:8:"Georgian";s:5:"kk_KZ";s:6:"Kazakh";s:5:"kn_IN";s:15:"Kannada (India)";s:5:"ko_KR";s:6:"Korean";s:5:"lb_LU";s:13:"Luxembourgish";s:5:"li_NL";s:24:"Limburgish (Netherlands)";s:5:"lo_LA";s:10:"Lao (Laos)";s:5:"lt_LT";s:10:"Lithuanian";s:5:"lv_LV";s:7:"Latvian";s:5:"mg_MG";s:21:"Malagasy (Madagascar)";s:5:"ms_MY";s:16:"Malay (Malaysia)";s:5:"mt_MT";s:7:"Maltese";s:5:"my_MM";s:17:"Burmese (Myanmar)";s:5:"nb_NO";s:7:"Bokmål";s:5:"ne_NP";s:6:"Nepali";s:5:"nl_BE";s:15:"Dutch (Belgium)";s:5:"nl_NL";s:5:"Dutch";s:5:"nn_NO";s:7:"Nynorsk";s:5:"no_NO";s:9:"Norwegian";s:5:"os_GE";s:18:"Ossetian (Georgia)";s:5:"os_RU";s:17:"Ossetian (Russia)";s:5:"os_TR";s:17:"Ossetian (Turkey)";s:5:"pa_IN";s:15:"Punjabi (India)";s:5:"pl_PL";s:6:"Polish";s:5:"pt_BR";s:19:"Portuguese (Brazil)";s:5:"pt_PT";s:10:"Portuguese";s:5:"ro_RO";s:8:"Romanian";s:5:"ru_RU";s:7:"Russian";s:5:"ru_UA";s:17:"Russian (Ukraine)";s:5:"sa_IN";s:16:"Sanskrit (India)";s:5:"sc_IT";s:17:"Sardinian (Italy)";s:5:"sd_PK";s:17:"Sindhi (Pakistan)";s:5:"si_LK";s:19:"Sinhala (Sri Lanka)";s:5:"sk_SK";s:6:"Slovak";s:5:"sl_SI";s:9:"Slovenian";s:5:"so_SO";s:6:"Somali";s:5:"sq_AL";s:18:"Albanian (Albania)";s:5:"sr_RS";s:7:"Serbian";s:5:"su_ID";s:21:"Sundanese (Indonesia)";s:5:"sv_SE";s:7:"Swedish";s:5:"sw_KE";s:15:"Swahili (Kenya)";s:5:"sw_KM";s:17:"Swahili (Comoros)";s:5:"sw_TZ";s:18:"Swahili (Tanzania)";s:5:"sw_UG";s:16:"Swahili (Uganda)";s:5:"ta_IN";s:13:"Tamil (India)";s:5:"ta_LK";s:17:"Tamil (Sri Lanka)";s:5:"te_IN";s:14:"Telugu (India)";s:5:"tg_TJ";s:18:"Tajik (Tajikistan)";s:5:"th_TW";s:13:"Thai (Taiwan)";s:5:"tr_TR";s:7:"Turkish";s:5:"ug_CN";s:14:"Uyghur (China)";s:5:"uk_UA";s:19:"Ukrainian (Ukraine)";s:5:"ur_IN";s:12:"Urdu (India)";s:5:"ur_PK";s:15:"Urdu (Pakistan)";s:5:"uz_UZ";s:18:"Uzbek (Uzbekistan)";s:5:"vi_VN";s:10:"Vietnamese";s:5:"zh_CN";s:7:"Chinese";s:5:"zh_HK";s:19:"Chinese (Hong Kong)";s:5:"zh_TW";s:16:"Chinese (Taiwan)";}');
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
+ * @date Tue, 14 Jan 2014 22:51:56 +0000
6
  */
7
  return unserialize('a:130:{s:5:"af_ZA";s:24:"Afrikaans (South Africa)";s:5:"ar_AE";s:29:"Arabic (United Arab Emirates)";s:5:"ar_IL";s:15:"Arabic (Israel)";s:5:"az_TR";s:20:"Azerbaijani (Turkey)";s:5:"bg_BG";s:9:"Bulgarian";s:5:"bn_BD";s:20:"Bengali (Bangladesh)";s:5:"bs_BA";s:30:"Bosnian (Bosnia & Herzegovina)";s:5:"cs_CZ";s:5:"Czech";s:5:"cy_GB";s:5:"Welsh";s:5:"da_DK";s:6:"Danish";s:5:"de_AT";s:16:"German (Austria)";s:5:"de_CH";s:20:"German (Switzerland)";s:5:"de_DE";s:6:"German";s:5:"el_CY";s:14:"Greek (Cyprus)";s:5:"el_GR";s:5:"Greek";s:5:"en_AE";s:30:"English (United Arab Emirates)";s:5:"en_AU";s:19:"English (Australia)";s:5:"en_CA";s:16:"English (Canada)";s:5:"en_GB";s:12:"English (UK)";s:5:"en_HK";s:19:"English (Hong Kong)";s:5:"en_IE";s:17:"English (Ireland)";s:5:"en_IN";s:15:"English (India)";s:5:"en_NZ";s:21:"English (New Zealand)";s:5:"en_SG";s:19:"English (Singapore)";s:5:"en_US";s:13:"English (USA)";s:5:"en_ZA";s:22:"English (South Africa)";s:5:"es_AR";s:19:"Spanish (Argentina)";s:5:"es_BO";s:17:"Spanish (Bolivia)";s:5:"es_CL";s:15:"Spanish (Chile)";s:5:"es_CO";s:18:"Spanish (Colombia)";s:5:"es_CR";s:20:"Spanish (Costa Rica)";s:5:"es_CU";s:14:"Spanish (Cuba)";s:5:"es_DO";s:28:"Spanish (Dominican Republic)";s:5:"es_EC";s:17:"Spanish (Ecuador)";s:5:"es_ES";s:7:"Spanish";s:5:"es_GT";s:19:"Spanish (Guatemala)";s:5:"es_HN";s:18:"Spanish (Honduras)";s:5:"es_MX";s:16:"Spanish (Mexico)";s:5:"es_NI";s:19:"Spanish (Nicaragua)";s:5:"es_PA";s:16:"Spanish (Panama)";s:5:"es_PE";s:14:"Spanish (Peru)";s:5:"es_PY";s:18:"Spanish (Paraguay)";s:5:"es_SV";s:21:"Spanish (El Salvador)";s:5:"es_UY";s:17:"Spanish (Uruguay)";s:5:"es_VE";s:19:"Spanish (Venezuela)";s:5:"et_EE";s:8:"Estonian";s:5:"fa_AF";s:21:"Persian (Afghanistan)";s:5:"fa_IR";s:14:"Persian (Iran)";s:5:"fi_FI";s:7:"Finnish";s:5:"fo_DK";s:17:"Faroese (Denmark)";s:5:"fo_FO";s:23:"Faroese (Faroe Islands)";s:5:"fr_BE";s:16:"French (Belgium)";s:5:"fr_CA";s:15:"French (Canada)";s:5:"fr_CH";s:20:"French (Switzerland)";s:5:"fr_FR";s:6:"French";s:5:"fr_HT";s:14:"French (Haiti)";s:5:"ga_IE";s:15:"Irish (Ireland)";s:5:"gl_ES";s:16:"Galician (Spain)";s:5:"gn_PY";s:18:"Guarani (Paraguay)";s:5:"he_IL";s:15:"Hebrew (Israel)";s:5:"hi_IN";s:13:"Hindi (India)";s:5:"hr_HR";s:8:"Croatian";s:5:"ht_HT";s:14:"Haitian Creole";s:5:"hu_HU";s:9:"Hungarian";s:5:"hy_AM";s:8:"Armenian";s:5:"id_ID";s:10:"Indonesian";s:5:"is_IS";s:9:"Icelandic";s:5:"it_CH";s:21:"Italian (Switzerland)";s:5:"it_IT";s:7:"Italian";s:5:"ja_JP";s:8:"Japanese";s:5:"jv_ID";s:20:"Javanese (Indonesia)";s:5:"ka_GE";s:8:"Georgian";s:5:"kk_KZ";s:6:"Kazakh";s:5:"kn_IN";s:15:"Kannada (India)";s:5:"ko_KR";s:6:"Korean";s:5:"lb_LU";s:13:"Luxembourgish";s:5:"li_NL";s:24:"Limburgish (Netherlands)";s:5:"lo_LA";s:10:"Lao (Laos)";s:5:"lt_LT";s:10:"Lithuanian";s:5:"lv_LV";s:7:"Latvian";s:5:"mg_MG";s:21:"Malagasy (Madagascar)";s:5:"ms_MY";s:16:"Malay (Malaysia)";s:5:"mt_MT";s:7:"Maltese";s:5:"my_MM";s:17:"Burmese (Myanmar)";s:5:"nb_NO";s:7:"Bokmål";s:5:"ne_NP";s:6:"Nepali";s:5:"nl_BE";s:15:"Dutch (Belgium)";s:5:"nl_NL";s:5:"Dutch";s:5:"nn_NO";s:7:"Nynorsk";s:5:"no_NO";s:9:"Norwegian";s:5:"os_GE";s:18:"Ossetian (Georgia)";s:5:"os_RU";s:17:"Ossetian (Russia)";s:5:"os_TR";s:17:"Ossetian (Turkey)";s:5:"pa_IN";s:15:"Punjabi (India)";s:5:"pl_PL";s:6:"Polish";s:5:"pt_BR";s:19:"Portuguese (Brazil)";s:5:"pt_PT";s:10:"Portuguese";s:5:"ro_RO";s:8:"Romanian";s:5:"ru_RU";s:7:"Russian";s:5:"ru_UA";s:17:"Russian (Ukraine)";s:5:"sa_IN";s:16:"Sanskrit (India)";s:5:"sc_IT";s:17:"Sardinian (Italy)";s:5:"sd_PK";s:17:"Sindhi (Pakistan)";s:5:"si_LK";s:19:"Sinhala (Sri Lanka)";s:5:"sk_SK";s:6:"Slovak";s:5:"sl_SI";s:9:"Slovenian";s:5:"so_SO";s:6:"Somali";s:5:"sq_AL";s:18:"Albanian (Albania)";s:5:"sr_RS";s:7:"Serbian";s:5:"su_ID";s:21:"Sundanese (Indonesia)";s:5:"sv_SE";s:7:"Swedish";s:5:"sw_KE";s:15:"Swahili (Kenya)";s:5:"sw_KM";s:17:"Swahili (Comoros)";s:5:"sw_TZ";s:18:"Swahili (Tanzania)";s:5:"sw_UG";s:16:"Swahili (Uganda)";s:5:"ta_IN";s:13:"Tamil (India)";s:5:"ta_LK";s:17:"Tamil (Sri Lanka)";s:5:"te_IN";s:14:"Telugu (India)";s:5:"tg_TJ";s:18:"Tajik (Tajikistan)";s:5:"th_TW";s:13:"Thai (Taiwan)";s:5:"tr_TR";s:7:"Turkish";s:5:"ug_CN";s:14:"Uyghur (China)";s:5:"uk_UA";s:19:"Ukrainian (Ukraine)";s:5:"ur_IN";s:12:"Urdu (India)";s:5:"ur_PK";s:15:"Urdu (Pakistan)";s:5:"uz_UZ";s:18:"Uzbek (Uzbekistan)";s:5:"vi_VN";s:10:"Vietnamese";s:5:"zh_CN";s:7:"Chinese";s:5:"zh_HK";s:19:"Chinese (Hong Kong)";s:5:"zh_TW";s:16:"Chinese (Taiwan)";}');
lib/build/shell-compiled.php CHANGED
@@ -2,6 +2,6 @@
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
- * @date Sat, 04 Jan 2014 20:28:03 +0000
6
  */
7
  function loco_compile_mo( $po ){ $descriptorspec = array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'a'), ); $cmd = WHICH_MSGFMT.' -o - -'; $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } fwrite($pipes[0], $po); fclose($pipes[0]); $err = stream_get_contents($pipes[2]); fclose($pipes[2]); $mo = stream_get_contents($pipes[1]); fclose($pipes[1]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception( WHICH_MSGFMT.' exited with code '.sprintf('%d',$e).'; Got '.strlen($mo).' bytes from '.strlen($po).' bytes'); } if( ! $mo ){ throw new Exception('Empty file from '.WHICH_MSGFMT); } return $mo; } function loco_compile_mo_file( $pofile, $mofile = '' ){ $descriptorspec = array ( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'a'), ); if( ! $mofile ){ $mofile = $pofile.'.mo'; } $cmd = WHICH_MSGFMT.' -o '.escapeshellarg($mofile).' '.escapeshellarg($pofile); $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } $err = stream_get_contents($pipes[0]); fclose($pipes[0]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception('Gettext msgfmt exited with code '.sprintf('%d',$e).';'); } if( ! file_exists($mofile) ){ throw new Exception('Gettext msgfmt failed to create '.$mofile); } return $mofile; } function loco_find_executable( $name ){ $paths = array ( '/usr/local/', '/usr/', '/', '~/' ); $descriptorspec = array ( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'), ); foreach( array('bin/','sbin/') as $dir ){ foreach( $paths as $path ){ $bin = $path.$dir.$name; $cmd = '[ -x '.escapeshellarg($bin).' ]'; $process = proc_open( $cmd, $descriptorspec, $pipes ); if( ! $process ){ return ''; } $e = proc_close($process); if( 0 === $e ){ return $bin; } } } return ''; }
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
+ * @date Tue, 14 Jan 2014 22:51:56 +0000
6
  */
7
  function loco_compile_mo( $po ){ $descriptorspec = array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'a'), ); $cmd = WHICH_MSGFMT.' -o - -'; $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } fwrite($pipes[0], $po); fclose($pipes[0]); $err = stream_get_contents($pipes[2]); fclose($pipes[2]); $mo = stream_get_contents($pipes[1]); fclose($pipes[1]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception( WHICH_MSGFMT.' exited with code '.sprintf('%d',$e).'; Got '.strlen($mo).' bytes from '.strlen($po).' bytes'); } if( ! $mo ){ throw new Exception('Empty file from '.WHICH_MSGFMT); } return $mo; } function loco_compile_mo_file( $pofile, $mofile = '' ){ $descriptorspec = array ( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'a'), ); if( ! $mofile ){ $mofile = $pofile.'.mo'; } $cmd = WHICH_MSGFMT.' -o '.escapeshellarg($mofile).' '.escapeshellarg($pofile); $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } $err = stream_get_contents($pipes[0]); fclose($pipes[0]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception('Gettext msgfmt exited with code '.sprintf('%d',$e).';'); } if( ! file_exists($mofile) ){ throw new Exception('Gettext msgfmt failed to create '.$mofile); } return $mofile; } function loco_find_executable( $name ){ $paths = array ( '/usr/local/', '/usr/', '/', '~/' ); $descriptorspec = array ( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'), ); foreach( array('bin/','sbin/') as $dir ){ foreach( $paths as $path ){ $bin = $path.$dir.$name; $cmd = '[ -x '.escapeshellarg($bin).' ]'; $process = proc_open( $cmd, $descriptorspec, $pipes ); if( ! $process ){ return ''; } $e = proc_close($process); if( 0 === $e ){ return $bin; } } } return ''; }
lib/loco-boot.php CHANGED
@@ -8,7 +8,7 @@ abstract class Loco {
8
  /** plugin namespace */
9
  const NS = 'loco-translate';
10
 
11
- const VERSION = '1.4';
12
  const CAPABILITY = 'manage_options';
13
 
14
  /* whether to enable APC cache */
8
  /** plugin namespace */
9
  const NS = 'loco-translate';
10
 
11
+ const VERSION = '1.4.1';
12
  const CAPABILITY = 'manage_options';
13
 
14
  /* whether to enable APC cache */
lib/loco-packages.php CHANGED
@@ -45,7 +45,13 @@ class LocoPackage {
45
  * Paths under which there may be source code in any of our domains
46
  * @var array
47
  */
48
- private $src = array();
 
 
 
 
 
 
49
 
50
  /**
51
  * @var int
@@ -122,9 +128,36 @@ class LocoPackage {
122
  if( filesize($path) ){
123
  $this->mtime = max( $this->mtime, filemtime($path) );
124
  $this->nfiles++;
 
125
  return true;
126
  }
127
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
 
130
  /**
@@ -389,6 +422,18 @@ class LocoPackage {
389
  }
390
 
391
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
  /**
394
  * construct package object from theme
@@ -405,10 +450,8 @@ class LocoPackage {
405
  if( $files = LocoAdmin::find_po($root) ){
406
  $package->add_po( $files, $domain );
407
  }
408
- // find additional theme PO under WP_LANG_DIR
409
- $pattern = WP_LANG_DIR.'/themes/'.$domain.'{-*.po,.pot}';
410
- $files = LocoAdmin::find_grouped( $pattern, GLOB_NOSORT|GLOB_BRACE ) and
411
- $package->add_po( $files );
412
  return $package;
413
  }
414
  }
@@ -430,10 +473,8 @@ class LocoPackage {
430
  if( $files = LocoAdmin::find_po($root) ){
431
  $package->add_po( $files, $domain );
432
  }
433
- // find additional plugin PO under WP_LANG_DIR
434
- $pattern = WP_LANG_DIR.'/plugins/'.$domain.'{-*.po,.pot}';
435
- $files = LocoAdmin::find_grouped( $pattern, GLOB_NOSORT|GLOB_BRACE ) and
436
- $package->add_po( $files );
437
  return $package;
438
  }
439
  }
@@ -466,11 +507,16 @@ class LocoPackage {
466
  public static function get( $handle, $type ){
467
  $key = $type.'_'.$handle;
468
  $package = Loco::cached($key);
 
 
 
 
 
469
  if( ! $package instanceof LocoPackage ){
470
  $getter = array( __CLASS__, 'get_'.$type );
471
  $package = call_user_func( $getter, $handle );
472
  if( $package ){
473
- // @todo init meta
474
  Loco::cache( $key, $package );
475
  }
476
  }
45
  * Paths under which there may be source code in any of our domains
46
  * @var array
47
  */
48
+ private $src = array();
49
+
50
+ /**
51
+ * Directories last modification times, used for cache invalidation
52
+ * @var array
53
+ */
54
+ private $dirs = array();
55
 
56
  /**
57
  * @var int
128
  if( filesize($path) ){
129
  $this->mtime = max( $this->mtime, filemtime($path) );
130
  $this->nfiles++;
131
+ $this->add_dir( dirname($path) );
132
  return true;
133
  }
134
+ }
135
+
136
+
137
+ /**
138
+ * Add directory and remember last modification time
139
+ */
140
+ private function add_dir( $path ){
141
+ if( ! isset($this->dirs[$path]) ){
142
+ $this->dirs[$path] = filemtime($path);
143
+ }
144
+ }
145
+
146
+
147
+ /**
148
+ * find additional plugin PO under WP_LANG_DIR
149
+ */
150
+ private function add_lang_dir( $langdir, $domain ){
151
+ $pattern = $langdir.'/'.$domain.'{-*.po,.pot}';
152
+ $nfiles = $this->nfiles;
153
+ $files = LocoAdmin::find_grouped( $pattern, GLOB_NOSORT|GLOB_BRACE ) and
154
+ $this->add_po( $files );
155
+ // add $langdir if files added
156
+ if( $nfiles !== $this->nfiles ){
157
+ $this->add_dir( $langdir );
158
+ }
159
+ }
160
+
161
 
162
 
163
  /**
422
  }
423
 
424
 
425
+ /**
426
+ * Invalidate cache based on last modification of directories
427
+ * @return bool whether cache should be invalidated
428
+ */
429
+ private function invalidate(){
430
+ foreach( $this->dirs as $path => $mtime ){
431
+ if( ! is_dir($path) || filemtime($path) !== $mtime ){
432
+ return true;
433
+ }
434
+ }
435
+ }
436
+
437
 
438
  /**
439
  * construct package object from theme
450
  if( $files = LocoAdmin::find_po($root) ){
451
  $package->add_po( $files, $domain );
452
  }
453
+ // find additional theme PO under WP_LANG_DIR/themes
454
+ $package->add_lang_dir( WP_LANG_DIR.'/themes', $domain );
 
 
455
  return $package;
456
  }
457
  }
473
  if( $files = LocoAdmin::find_po($root) ){
474
  $package->add_po( $files, $domain );
475
  }
476
+ // find additional plugin PO under WP_LANG_DIR/plugin
477
+ $package->add_lang_dir( WP_LANG_DIR.'/plugins', $domain );
 
 
478
  return $package;
479
  }
480
  }
507
  public static function get( $handle, $type ){
508
  $key = $type.'_'.$handle;
509
  $package = Loco::cached($key);
510
+ if( $package instanceof LocoPackage ){
511
+ if( $package->invalidate() ){
512
+ $package = null;
513
+ }
514
+ }
515
  if( ! $package instanceof LocoPackage ){
516
  $getter = array( __CLASS__, 'get_'.$type );
517
  $package = call_user_func( $getter, $handle );
518
  if( $package ){
519
+ $package->meta();
520
  Loco::cache( $key, $package );
521
  }
522
  }
loco.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
4
  Plugin URI: http://wordpress.org/extend/plugins/loco-translate
5
  Description: Translate Wordpress plugins and themes directly in your browser
6
  Author: Tim Whitlock
7
- Version: 1.4
8
  Author URI: http://localise.biz/help/wordpress/translate-plugin
9
  */
10
 
4
  Plugin URI: http://wordpress.org/extend/plugins/loco-translate
5
  Description: Translate Wordpress plugins and themes directly in your browser
6
  Author: Tim Whitlock
7
+ Version: 1.4.1
8
  Author URI: http://localise.biz/help/wordpress/translate-plugin
9
  */
10
 
php/loco-download.php CHANGED
@@ -34,6 +34,13 @@ try {
34
  $ext = strtolower( pathinfo( $name, PATHINFO_EXTENSION ) );
35
  }
36
 
 
 
 
 
 
 
 
37
  // Simple post-through for PO and POT
38
  if( 'mo' !== $ext ){
39
  header('Content-Type: application/x-gettext; charset=UTF-8', true );
34
  $ext = strtolower( pathinfo( $name, PATHINFO_EXTENSION ) );
35
  }
36
 
37
+
38
+ // Undo magic quotes if enabled
39
+ if( get_magic_quotes_gpc() ){
40
+ $po = stripslashes( $po );
41
+ }
42
+
43
+
44
  // Simple post-through for PO and POT
45
  if( 'mo' !== $ext ){
46
  header('Content-Type: application/x-gettext; charset=UTF-8', true );
php/loco-posave.php CHANGED
@@ -41,6 +41,10 @@
41
  }
42
  }
43
 
 
 
 
 
44
 
45
  // attempt to write PO file
46
  $bytes = file_put_contents( $path, $po );
41
  }
42
  }
43
 
44
+ // Undo magic quotes if enabled
45
+ if( get_magic_quotes_gpc() ){
46
+ $po = stripslashes( $po );
47
+ }
48
 
49
  // attempt to write PO file
50
  $bytes = file_put_contents( $path, $po );
pub/js/build/admin-poedit.js CHANGED
@@ -136,7 +136,7 @@ P.unbind().clear();S.unbind();C&&(t("poDeselected",[C]),C=null)}function B(a){fu
136
  e);0===e&&p(a,1);a.fuzzy()?h(!1,a):r(a)}).bind("wgChanged",function(c){w&&b();t(G,[a])})}function d(){P.title("Context:");P.textarea(a.context(),!0);P.bind("wgChange",function(b,c){var d=f(c);a.context(d);a.source();p(a,0);r(a)}).bind("wgChanged",function(){q.reIndex(a);w&&b();t(G,[a])})}z();C=a;S.textarea(a.comment(),!0).bind("wgChange",function(b,c){var d=f(c);a.comment(d);t("poComment",[a,d]);r(a)});var e=0,g=A,k=!A,l=a.source()||"",m=a.plural()||"";(function(){m?(O=R.splity(R.id+"-singular",R.id+
137
  "-plural"),O[0].header("Singular:").textarea(l,k),O[1].header("Plural:").textarea(m,k),R.lock()):R.textarea(l,k);R.title("Source text:");k&&R.bind("wgChange",function(b,c){var d=f(c);R.id+"-plural"===b.target.parentNode.id?a.plural(d):(a.source(d),p(a,0));r(a)}).bind("wgChanged",function(c){R.id+"-plural"===c.target.parentNode.id||q.reIndex(a);w&&b();t(G,[a])})})();g?c():d();t("poSelected",[a]);data=null}var q,w,y,D,A,F,C,H=0,G="poUpdate",I,M={row:function(a){return l(q.row(a))},eachCol:function(a){a(0,
138
  "Source text");a(1,"Translation")},eachRow:function(a){var b=0;q.each(function(c,d){a(b++,l(d),v(d))})}},N=s.require("$15","LocoWinGrid.js").init(c),O=N.splity("po-list","po-edit"),K=O[0],Q=O[1],O=Q.splitx("po-trans","po-comment"),T=O[0],S=O[1].header("Comment:"),O=T.splity("po-source","po-target"),R=O[0].header("Source text:"),P=O[1].header("Translation:");N.distribute(0.34);Q.distribute(0.8);e(a).resize(function(){N.redraw(!0);return!0});K.bind("wgRowSelect",function(a,b,c){a=q.row(b);B(a);return!0}).bind("wgRowDeselect",
139
- function(){z();S.textarea("",!1);R.textarea("",!1).title("Source text not loaded:");P.textarea("",!1).title("Translation not loaded:");t("poSelected",[null]);return!0});return{bind:function(a,b){return e(c).bind(a,b)},load:function(a){q=a;w&&b();u()&&K.selectRow(0)},save:function(a){if(H||a)e(I).find("div.po-unsaved").removeClass("po-unsaved"),t("poSave");H=0;return q},fuzzy:function(a){return h(a)},del:function(a,c){var d=arguments.length?q.get(a,c):C;if(d){var e=y,f=q.del(d);null!=f&&(t("poDel",
140
  [d]),t(G,[d]),u(),w&&b(),C&&C.equals(d)&&z(),q.length&&(e&&k(e),C||(f=Math.min(f,q.length-1),K.selectRow(f))))}},add:function(a,b){var c,d=q.get(a,b);d?c=q.indexOf(d):(c=q.length,d=q.add(a,b),K.addRow(M.row(c),v(d)),r(d),w&&w.add(q.indexOf(d),d.toText()),t("poAdd",[d]),t(G,[d]));y&&k("");K.selectRow(c);return d},lock:function(){n(!0)},unlock:function(){n(!1)},locked:function(){return Boolean(A)},filter:function(a){return w&&q&&q.length&&k(a,!0)},searchable:function(a){a&&(w=a,q&&b());return w&&!0},
141
  stats:function(){return g()}}};return c}({},u,A));s.require("$1","array.js");s.require("$2","html.js");V=u.loco||{};var aa=u.ajaxurl||"/wp-admin/admin-ajax.php",U=V.conf||{},S=U.locale,M=s.require("$3","po.js").create(S),I={},T=A.getElementById("loco-poedit-inner"),G=V.t||function(c){return c};e(u).resize(function(){function c(){var c;c=T;for(var d=c.offsetTop||0;(c=c.offsetParent)&&void 0!==c;)d+=c.offsetTop||0;c=d;d=e(u).innerHeight();c=Math.max(k,d-c-a);T.style.height=String(c)+"px";return!0}var a=
142
  20,k=parseInt(e(T).css("min-height")||0);c();return c}());I.save=function(c){function a(){c.disabled=!1}a();H.bind("poUnsaved",function(){e(c).addClass("button-primary loco-flagged")}).bind("poSave",function(){e(c).removeClass("button-primary loco-flagged")});e(c.form).submit(function(k){var f=k.target;k.target.po.value=M.toString();c.disabled=!0;$(f,function(c){a();e("#loco-po-modified").text(c.modified);H.save(!0);var f=G("PO file saved"),b=c.filename;c=c.compiled;null!=c&&(/\D/.test(c)?W(c,G("Error"),
136
  e);0===e&&p(a,1);a.fuzzy()?h(!1,a):r(a)}).bind("wgChanged",function(c){w&&b();t(G,[a])})}function d(){P.title("Context:");P.textarea(a.context(),!0);P.bind("wgChange",function(b,c){var d=f(c);a.context(d);a.source();p(a,0);r(a)}).bind("wgChanged",function(){q.reIndex(a);w&&b();t(G,[a])})}z();C=a;S.textarea(a.comment(),!0).bind("wgChange",function(b,c){var d=f(c);a.comment(d);t("poComment",[a,d]);r(a)});var e=0,g=A,k=!A,l=a.source()||"",m=a.plural()||"";(function(){m?(O=R.splity(R.id+"-singular",R.id+
137
  "-plural"),O[0].header("Singular:").textarea(l,k),O[1].header("Plural:").textarea(m,k),R.lock()):R.textarea(l,k);R.title("Source text:");k&&R.bind("wgChange",function(b,c){var d=f(c);R.id+"-plural"===b.target.parentNode.id?a.plural(d):(a.source(d),p(a,0));r(a)}).bind("wgChanged",function(c){R.id+"-plural"===c.target.parentNode.id||q.reIndex(a);w&&b();t(G,[a])})})();g?c():d();t("poSelected",[a]);data=null}var q,w,y,D,A,F,C,H=0,G="poUpdate",I,M={row:function(a){return l(q.row(a))},eachCol:function(a){a(0,
138
  "Source text");a(1,"Translation")},eachRow:function(a){var b=0;q.each(function(c,d){a(b++,l(d),v(d))})}},N=s.require("$15","LocoWinGrid.js").init(c),O=N.splity("po-list","po-edit"),K=O[0],Q=O[1],O=Q.splitx("po-trans","po-comment"),T=O[0],S=O[1].header("Comment:"),O=T.splity("po-source","po-target"),R=O[0].header("Source text:"),P=O[1].header("Translation:");N.distribute(0.34);Q.distribute(0.8);e(a).resize(function(){N.redraw(!0);return!0});K.bind("wgRowSelect",function(a,b,c){a=q.row(b);B(a);return!0}).bind("wgRowDeselect",
139
+ function(){z();S.textarea("",!1);R.textarea("",!1).title("Source text not loaded:");P.textarea("",!1).title("Translation not loaded:");t("poSelected",[null]);return!0});return{bind:function(a,b){return e(c).bind(a,b)},load:function(a){q=a;w&&b();u()&&K.selectRow(0)},save:function(a){if(H||a)e(I).find("div.po-unsaved").removeClass("po-unsaved"),t("poSave");H=0;return q},fuzzy:function(a){return h(a)},del:function(a,c){var d=arguments.length?q.get(a,c):C;if(d){var e=y,f=q.del(d);null!=f&&(r(d),t("poDel",
140
  [d]),t(G,[d]),u(),w&&b(),C&&C.equals(d)&&z(),q.length&&(e&&k(e),C||(f=Math.min(f,q.length-1),K.selectRow(f))))}},add:function(a,b){var c,d=q.get(a,b);d?c=q.indexOf(d):(c=q.length,d=q.add(a,b),K.addRow(M.row(c),v(d)),r(d),w&&w.add(q.indexOf(d),d.toText()),t("poAdd",[d]),t(G,[d]));y&&k("");K.selectRow(c);return d},lock:function(){n(!0)},unlock:function(){n(!1)},locked:function(){return Boolean(A)},filter:function(a){return w&&q&&q.length&&k(a,!0)},searchable:function(a){a&&(w=a,q&&b());return w&&!0},
141
  stats:function(){return g()}}};return c}({},u,A));s.require("$1","array.js");s.require("$2","html.js");V=u.loco||{};var aa=u.ajaxurl||"/wp-admin/admin-ajax.php",U=V.conf||{},S=U.locale,M=s.require("$3","po.js").create(S),I={},T=A.getElementById("loco-poedit-inner"),G=V.t||function(c){return c};e(u).resize(function(){function c(){var c;c=T;for(var d=c.offsetTop||0;(c=c.offsetParent)&&void 0!==c;)d+=c.offsetTop||0;c=d;d=e(u).innerHeight();c=Math.max(k,d-c-a);T.style.height=String(c)+"px";return!0}var a=
142
  20,k=parseInt(e(T).css("min-height")||0);c();return c}());I.save=function(c){function a(){c.disabled=!1}a();H.bind("poUnsaved",function(){e(c).addClass("button-primary loco-flagged")}).bind("poSave",function(){e(c).removeClass("button-primary loco-flagged")});e(c.form).submit(function(k){var f=k.target;k.target.po.value=M.toString();c.disabled=!0;$(f,function(c){a();e("#loco-po-modified").text(c.modified);H.save(!0);var f=G("PO file saved"),b=c.filename;c=c.compiled;null!=c&&(/\D/.test(c)?W(c,G("Error"),
pub/js/lang/loco-translate-de_DE.js CHANGED
@@ -3,7 +3,7 @@
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: de_DE, German
6
- * Exported at: Sat, 04 Jan 2014 20:46:53 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
@@ -29,5 +29,5 @@ loco = window.loco||{}, loco.t = function( pairs ){
29
  return value || ( 1 === n ? msgid1 : msgid2 ) || msgid1 || '';
30
  };
31
  }(
32
- {"Error":"Fehler","Warning":"Warnung","OK":"OK","Settings saved":"Einstellungen gespeichert","New PO file":"Neue PO-Datei","You must specify a valid locale for a new PO file":"Du musst einen g\u00fcltigen Pfad f\u00fcr die PO-Datei angeben","No translatable strings found":"Keine \u00fcbersetzbaren Zeichenketten gefunden","Cannot create a PO file.":"Erstellen der PO-Datei fehlgeschlagen.","PO file already exists with locale %s":"PO-Datei existiert schon unter %s","File cannot be created automatically. Fix the file permissions or use Download instead of Save":"Datei kann nicht automatisch erstellt werden. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern","%s file is empty":"Datei (%s) ist leer","Run Sync to update from source code":"Benutze Sync, um von der Quelle zu aktualisieren","No strings could be extracted from source code":"Es konnten keine Zeichenketten vom Quellcode extrahiert werden","Run Sync to update from %s":"Benutze Sync, um aus %s zu aktualisieren","Source code has been modified, run Sync to update POT":"Quellcode wurde ge\u00e4ndert, benutze Sync um POT zu aktualisieren","POT has been modified since PO file was saved, run Sync to update":"POT wurde aktualisiert bevor die PO-Datei gespeichert wurde. Benutze Sync zum Aktualisieren.","Bad file path":"Falscher Dateipfad","New template":"Neues Template","New language":"Neue Sprache","%s%% translated":"%s%% \u00fcbersetzt","1 string":{"one":"1 Zeichenkette","other":"%s Zeichenketten"},"%s fuzzy":"%s undeutlich","%s untranslated":"%s nicht \u00fcbersetzt","Failed to compile MO file with built-in compiler":"Kompilieren der MO-Datei mit dem internen Kompilierer fehlgeschlagen.","Loco, Translation Management":"Loco, Translation Management","Translation":"\u00dcbersetzung","Manage translations":"\u00dcbersetzungen verwalten","Settings":"Einstellungen","File download failed":"Dateidownload ist fehlgeschlagen","Unknown language":"Unbekannte Sprache","Some files not writable":"Einige Dateien nicht schreibbar","Some files missing":"Einige Dateien fehlen","\"%s\" folder not writable":"Ordner \"%s\" nicht schreibbar","Folder not writable":"Ordner nicht schreibbar","POT file not writable":"POT-Datei nicht schreibbar","PO file not writable":"PO-Datei nicht schreibbar","MO file not writable":"MO-Datei nicht schreibbar","MO file not found":"MO-Datei nicht gefunden","User does not have permission to manage translations":"Benutzer hat keine Rechte die \u00dcbersetzungen zu verwalten","Failed to compile MO file with %s, check your settings":"Kompilieren der MO-Datei fehlgeschlagen. Bitte pr\u00fcfe Deine Einstellungen","Invalid data posted to server":"Ung\u00fcltige Daten zum Server gesendet","Package not found called %s":"Paket %s nicht gefunden","Web server cannot create \"%s\" directory in \"%s\". Fix file permissions or create it manually.":"Webserver kann Ordner \"%s\" nicht in \"%s\" erstellen. Setze die Zugriffsrechte oder erstelle den Ordner selbst.","Web server cannot create files in the \"%s\" directory. Fix file permissions or use the download function.":"Webserver kann keine Dateien im Ordner \"%s\" erstellen. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern.","%s file is not writable by the web server. Fix file permissions or download and copy to \"%s\/%s\".":"Datei %s ist vom Webserver nicht schreibbar. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern und speichere die Datei auf dem Server unter \"%s\/%s\" ab.","Cannot create MO file":"Erstellen der MO-Datei fehlgeschlagen.","Cannot overwrite MO file":"\u00dcberschreiben der MO-Datei fehlgeschlagen","Failed to write MO file":"","No strings could be extracted from source files":"Es konnten keine Zeichenketten aus der Quelle extrahiert werden","Unknown error":"Unbekannter Fehler","PO file saved":"PO-Datei gespeichert","and MO file compiled":"und MO-Datei kompiliert","Merged from %s":"Aus %s zusammengef\u00fchrt","Merged from source code":"Aus Quelle zusammengef\u00fchrt","Already up to date with %s":"Bereit auf dem aktuellen Stand mit %s","Already up to date with source code":"Bereit mit der Quelle auf dem aktuellen Stand","1 new string added":{"one":"1 neue Zeichenkette hinzugef\u00fcgt","other":"%s neue Zeichenketten hinzugef\u00fcgt"},"1 obsolete string removed":{"one":"1 veraltete Zeichenkette entfernt","other":"%s veraltete Zeichenketten entfernt"},"Your changes will be lost if you continue without saving":"Deine \u00c4nderungen gehen verloren, wenn du fortsetzt ohne zu Speichern","Packages":"Pakete","File check":"Dateipr\u00fcfung","File system permissions for %s":"Dateisystem-Rechte f\u00fcr %s","Back":"Zur\u00fcck","Get help":"Hilfe erhalten","Package details":"Paketdetails","Translations (PO)":"\u00dcbersetzungen (PO)","Template (POT)":"Template (POT)","File permissions":"Dateizugriffsrechte","1 language":{"one":"1 Sprache","other":"%u Sprachen"},"Updated":"Aktualisiert","Powered by":"Pr\u00e4sentiert von","Configure Loco Translate":"Konfiguriere Loco Translate","Compiling MO files":"MO-Dateien kompilieren","Use built-in MO compiler.":"Benutze internen MO-Kompilierer","Use external command:":"Benutze externes Befehlsprogramm:","Enter path to msgfmt on server":"Pfad zum msgfmt-Programm","Generate hash tables":"","Save settings":"Einstellungen speichern","Template file":"Templatedatei","Switch to...":"Wechsle zu...","never":"niemals","Save":"Speichern","Download":"Download","Sync":"Sync","Revert":"zur\u00fccksetzen","Add":"Hinzuf\u00fcgen","Del":"L\u00f6schen","Fuzzy":"Undeutlich","Filter translations":"\u00dcbersetzungen filtern","Help":"Hilfe","Initialize new translations in %s":"Initialisiere neue \u00dcbersetzung in %s","Select from common languages":"W\u00e4hle aus den Standardsprachen","or enter any language code":"oder trage den Sprach-Code ein","Start translating":"Starte \u00dcbersetzung","New version available":"Neue Version verf\u00fcgbar","Upgrade to version %s of Loco Translate":"Bitte upgrade Loco Translate auf Version %s","Select a plugin or theme to translate":"W\u00e4hle ein Plugin oder Theme zum \u00dcbersetzen","Themes":"Themes","Plugins":"Plugins","Core":"Core"}
33
  );
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: de_DE, German
6
+ * Exported at: Tue, 14 Jan 2014 22:52:03 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
29
  return value || ( 1 === n ? msgid1 : msgid2 ) || msgid1 || '';
30
  };
31
  }(
32
+ {"Failed to write MO file":"Fehler beim Schreiben der MO-Datei","Generate hash tables":"Erzeuge Hashtabellen","Error":"Fehler","Warning":"Warnung","OK":"OK","Settings saved":"Einstellungen gespeichert","New PO file":"Neue PO-Datei","You must specify a valid locale for a new PO file":"Du musst einen g\u00fcltigen Pfad f\u00fcr die PO-Datei angeben","No translatable strings found":"Keine \u00fcbersetzbaren Zeichenketten gefunden","Cannot create a PO file.":"Erstellen der PO-Datei fehlgeschlagen.","PO file already exists with locale %s":"PO-Datei existiert schon unter %s","File cannot be created automatically. Fix the file permissions or use Download instead of Save":"Datei kann nicht automatisch erstellt werden. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern","%s file is empty":"Datei (%s) ist leer","Run Sync to update from source code":"Benutze Sync, um von der Quelle zu aktualisieren","No strings could be extracted from source code":"Es konnten keine Zeichenketten vom Quellcode extrahiert werden","Run Sync to update from %s":"Benutze Sync, um aus %s zu aktualisieren","Source code has been modified, run Sync to update POT":"Quellcode wurde ge\u00e4ndert, benutze Sync um POT zu aktualisieren","POT has been modified since PO file was saved, run Sync to update":"POT wurde aktualisiert bevor die PO-Datei gespeichert wurde. Benutze Sync zum Aktualisieren.","Bad file path":"Falscher Dateipfad","New template":"Neues Template","New language":"Neue Sprache","%s%% translated":"%s%% \u00fcbersetzt","1 string":{"one":"1 Zeichenkette","other":"%s Zeichenketten"},"%s fuzzy":"%s undeutlich","%s untranslated":"%s nicht \u00fcbersetzt","Failed to compile MO file with built-in compiler":"Kompilieren der MO-Datei mit dem internen Kompilierer fehlgeschlagen.","Loco, Translation Management":"Loco, Translation Management","Translation":"\u00dcbersetzung","Manage translations":"\u00dcbersetzungen verwalten","Settings":"Einstellungen","File download failed":"Dateidownload ist fehlgeschlagen","Unknown language":"Unbekannte Sprache","Some files not writable":"Einige Dateien nicht schreibbar","Some files missing":"Einige Dateien fehlen","\"%s\" folder not writable":"Ordner \"%s\" nicht schreibbar","Folder not writable":"Ordner nicht schreibbar","POT file not writable":"POT-Datei nicht schreibbar","PO file not writable":"PO-Datei nicht schreibbar","MO file not writable":"MO-Datei nicht schreibbar","MO file not found":"MO-Datei nicht gefunden","User does not have permission to manage translations":"Benutzer hat keine Rechte die \u00dcbersetzungen zu verwalten","Failed to compile MO file with %s, check your settings":"Kompilieren der MO-Datei fehlgeschlagen. Bitte pr\u00fcfe Deine Einstellungen","Invalid data posted to server":"Ung\u00fcltige Daten zum Server gesendet","Package not found called %s":"Paket %s nicht gefunden","Web server cannot create \"%s\" directory in \"%s\". Fix file permissions or create it manually.":"Webserver kann Ordner \"%s\" nicht in \"%s\" erstellen. Setze die Zugriffsrechte oder erstelle den Ordner selbst.","Web server cannot create files in the \"%s\" directory. Fix file permissions or use the download function.":"Webserver kann keine Dateien im Ordner \"%s\" erstellen. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern.","%s file is not writable by the web server. Fix file permissions or download and copy to \"%s\/%s\".":"Datei %s ist vom Webserver nicht schreibbar. Setze die Datei-Zugriffsrechte oder benutze Download anstatt Speichern und speichere die Datei auf dem Server unter \"%s\/%s\" ab.","Cannot create MO file":"Erstellen der MO-Datei fehlgeschlagen.","Cannot overwrite MO file":"\u00dcberschreiben der MO-Datei fehlgeschlagen","No strings could be extracted from source files":"Es konnten keine Zeichenketten aus der Quelle extrahiert werden","Unknown error":"Unbekannter Fehler","PO file saved":"PO-Datei gespeichert","and MO file compiled":"und MO-Datei kompiliert","Merged from %s":"Aus %s zusammengef\u00fchrt","Merged from source code":"Aus Quelle zusammengef\u00fchrt","Already up to date with %s":"Bereits auf dem aktuellen Stand mit %s","Already up to date with source code":"Bereits mit der Quelle auf dem aktuellen Stand","1 new string added":{"one":"1 neue Zeichenkette hinzugef\u00fcgt","other":"%s neue Zeichenketten hinzugef\u00fcgt"},"1 obsolete string removed":{"one":"1 veraltete Zeichenkette entfernt","other":"%s veraltete Zeichenketten entfernt"},"Your changes will be lost if you continue without saving":"Deine \u00c4nderungen gehen verloren, wenn du fortsetzt ohne zu Speichern","Packages":"Pakete","File check":"Dateipr\u00fcfung","File system permissions for %s":"Dateisystem-Rechte f\u00fcr %s","Back":"Zur\u00fcck","Get help":"Hilfe erhalten","Package details":"Paketdetails","Translations (PO)":"\u00dcbersetzungen (PO)","Template (POT)":"Template (POT)","File permissions":"Dateizugriffsrechte","1 language":{"one":"1 Sprache","other":"%u Sprachen"},"Updated":"Aktualisiert","Powered by":"Pr\u00e4sentiert von","Configure Loco Translate":"Konfiguriere Loco Translate","Compiling MO files":"MO-Dateien kompilieren","Use built-in MO compiler.":"Benutze internen MO-Kompilierer","Use external command:":"Benutze externes Befehlsprogramm:","Enter path to msgfmt on server":"Pfad zum msgfmt-Programm","Save settings":"Einstellungen speichern","Template file":"Templatedatei","Switch to...":"Wechsle zu...","never":"niemals","Save":"Speichern","Download":"Download","Sync":"Sync","Revert":"zur\u00fccksetzen","Add":"Hinzuf\u00fcgen","Del":"L\u00f6schen","Fuzzy":"Undeutlich","Filter translations":"\u00dcbersetzungen filtern","Help":"Hilfe","Initialize new translations in %s":"Initialisiere neue \u00dcbersetzung in %s","Select from common languages":"W\u00e4hle aus den Standardsprachen","or enter any language code":"oder trage den Sprach-Code ein","Start translating":"Starte \u00dcbersetzung","New version available":"Neue Version verf\u00fcgbar","Upgrade to version %s of Loco Translate":"Bitte upgrade Loco Translate auf Version %s","Select a plugin or theme to translate":"W\u00e4hle ein Plugin oder Theme zum \u00dcbersetzen","Themes":"Themes","Plugins":"Plugins","Core":"Core"}
33
  );
pub/js/lang/loco-translate-nl_BE.js CHANGED
@@ -3,7 +3,7 @@
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: nl_BE, Dutch (Belgium)
6
- * Exported at: Sat, 04 Jan 2014 20:46:53 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: nl_BE, Dutch (Belgium)
6
+ * Exported at: Tue, 14 Jan 2014 22:52:03 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
pub/js/lang/loco-translate-nl_NL.js CHANGED
@@ -3,7 +3,7 @@
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: nl_NL, Dutch
6
- * Exported at: Sat, 04 Jan 2014 20:46:53 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
3
  * Project: loco.js conversion
4
  * Release: Working copy
5
  * Locale: nl_NL, Dutch
6
+ * Exported at: Tue, 14 Jan 2014 22:52:04 +0000
7
  */
8
  loco = window.loco||{}, loco.t = function( pairs ){
9
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: timwhitlock
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, POEdit, productivity
4
  Requires at least: 3.5
5
  Tested up to: 3.8
6
- Stable tag: 1.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -97,6 +97,11 @@ At the user end, yes you can access the interface on Windows using Internet Expl
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
100
  = 1.4 =
101
  * Added native MO compiler
102
  * Added hash generation config option
@@ -152,7 +157,7 @@ At the user end, yes you can access the interface on Windows using Internet Expl
152
 
153
  == Upgrade Notice ==
154
 
155
- = 1.4 =
156
  * Bug fixes and improvements.
157
 
158
 
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, POEdit, productivity
4
  Requires at least: 3.5
5
  Tested up to: 3.8
6
+ Stable tag: 1.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
97
 
98
  == Changelog ==
99
 
100
+
101
+ = 1.4.1 =
102
+ * Cache invalidation
103
+ * Magic quotes stripping from po save
104
+
105
  = 1.4 =
106
  * Added native MO compiler
107
  * Added hash generation config option
157
 
158
  == Upgrade Notice ==
159
 
160
+ = 1.4.1 =
161
  * Bug fixes and improvements.
162
 
163