Add column renderer for phrases
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 Sep 2024 15:28:25 +0000 (17:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 12 Nov 2024 11:51:53 +0000 (12:51 +0100)
wcfsetup/install/files/lib/system/view/grid/renderer/PhraseColumnRenderer.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/view/grid/renderer/PhraseColumnRenderer.class.php b/wcfsetup/install/files/lib/system/view/grid/renderer/PhraseColumnRenderer.class.php
new file mode 100644 (file)
index 0000000..604eddb
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+namespace wcf\system\view\grid\renderer;
+
+use wcf\system\WCF;
+use wcf\util\StringUtil;
+
+class PhraseColumnRenderer extends DefaultColumnRenderer
+{
+    public function render(mixed $value, mixed $context = null): string
+    {
+        return StringUtil::encodeHTML(WCF::getLanguage()->get($value));
+    }
+}