summaryrefslogtreecommitdiff
path: root/tools/inc/lib/jsgettext/PoeditString.php
diff options
context:
space:
mode:
authorCzterooki <czterooki1337@gmail.com>2013-07-20 00:19:08 -0400
committerCzterooki <czterooki1337@gmail.com>2013-07-20 00:19:08 -0400
commitaef44255920c18f443af28d100fb06d9699d4895 (patch)
treeb1d72ffc9a0e4f6a009ca16e9e3af2260806c193 /tools/inc/lib/jsgettext/PoeditString.php
parent81892ebcdcd2929128c2c320f7de975cab8ed368 (diff)
parentf04566f6d30553560d5a69e25e38de72a60f297c (diff)
merge with vichan-gold
Diffstat (limited to 'tools/inc/lib/jsgettext/PoeditString.php')
-rw-r--r--tools/inc/lib/jsgettext/PoeditString.php29
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