summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/i18n/src/NoopTranslator.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:38:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:38:04 +0000
commit1ff5c35de5dbd70a782875a91dd2232fd01b002b (patch)
tree77d9ce5e1bf78b3e6ef79f8f6e7861e2ced3c09b /vendor/ipl/i18n/src/NoopTranslator.php
parentInitial commit. (diff)
downloadicinga-php-library-upstream/0.10.1.tar.xz
icinga-php-library-upstream/0.10.1.zip
Adding upstream version 0.10.1.upstream/0.10.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ipl/i18n/src/NoopTranslator.php')
-rw-r--r--vendor/ipl/i18n/src/NoopTranslator.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/ipl/i18n/src/NoopTranslator.php b/vendor/ipl/i18n/src/NoopTranslator.php
new file mode 100644
index 0000000..1f9aab2
--- /dev/null
+++ b/vendor/ipl/i18n/src/NoopTranslator.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace ipl\I18n;
+
+use ipl\Stdlib\Contract\Translator;
+
+/**
+ * Translator that just returns the original messages
+ */
+class NoopTranslator implements Translator
+{
+ public function translate($message, $context = null)
+ {
+ return $message;
+ }
+
+ public function translateInDomain($domain, $message, $context = null)
+ {
+ return $message;
+ }
+
+ public function translatePlural($singular, $plural, $number, $context = null)
+ {
+ return $number === 1 ? $singular : $plural;
+ }
+
+ public function translatePluralInDomain($domain, $singular, $plural, $number, $context = null)
+ {
+ return $number === 1 ? $singular : $plural;
+ }
+}