diff options
| author | czaks <marcin@6irc.net> | 2013-07-02 22:48:43 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-07-02 22:48:43 -0400 |
| commit | 7ab1ec4caa74fc017948829dbd57c91a659a4b4b (patch) | |
| tree | d52ec761cd5e10ba105ca03fee1bfe32f1e7fce8 /tools/inc/lib/jsgettext/PoeditString.php | |
| parent | 47640a0ce872038110ff011c22bf9e0b557aa67e (diff) | |
tools/inc/lib/jsgettext/: bundle jsgettext library from https://code.google.com/p/jsgettext
Diffstat (limited to 'tools/inc/lib/jsgettext/PoeditString.php')
| -rw-r--r-- | tools/inc/lib/jsgettext/PoeditString.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/inc/lib/jsgettext/PoeditString.php b/tools/inc/lib/jsgettext/PoeditString.php new file mode 100644 index 00000000..3d59d004 --- /dev/null +++ b/tools/inc/lib/jsgettext/PoeditString.php @@ -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; + } +} + +?>
\ No newline at end of file |
