summaryrefslogtreecommitdiff
path: root/tools/inc/lib/jsgettext/PoeditString.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-07-02 22:48:43 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-31 15:57:53 -0400
commit12d1636b405e3dd9a700c504956c74b0ef1f6a46 (patch)
tree87f02e01f901603841ae8b090745d9df189cde5a /tools/inc/lib/jsgettext/PoeditString.php
parentde53ca0f8fad4074ab20d2bef463e5adf69ecebd (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.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