tools/inc/lib/jsgettext/: bundle jsgettext library from https://code.google.com/p/jsgettext

This commit is contained in:
czaks 2013-07-02 22:48:43 -04:00 committed by Michael Foster
parent de53ca0f8f
commit 12d1636b40
6 changed files with 334 additions and 0 deletions

View file

@ -0,0 +1,29 @@
<?php
class PoeditString {
public $key;
public $value;
public $fuzzy;
public $comments;
function __construct($key, $value = '', $fuzzy = false, $comments = array()) {
$this->key = $key;
$this->value = $value;
$this->fuzzy = $fuzzy;
$this->comments = (array)$comments;
}
public function __toString() {
$str ='';
foreach ($this->comments as $c) {
$str .= "#: $c\n";
}
if ($this->fuzzy) $str .= "#, fuzzy\n";
$str .= 'msgid "'.str_replace('"', '\\"', $this->key).'"' . "\n";
$str .= 'msgstr "'.str_replace('"', '\\"', $this->value).'"' . "\n";
$str .= "\n";
return $str;
}
}
?>