summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/src/MessageBundleTranslation/MessageBundleContentHandler.php')
-rw-r--r--MLEB/Translate/src/MessageBundleTranslation/MessageBundleContentHandler.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/MLEB/Translate/src/MessageBundleTranslation/MessageBundleContentHandler.php b/MLEB/Translate/src/MessageBundleTranslation/MessageBundleContentHandler.php
new file mode 100644
index 00000000..166e15ec
--- /dev/null
+++ b/MLEB/Translate/src/MessageBundleTranslation/MessageBundleContentHandler.php
@@ -0,0 +1,27 @@
+<?php
+declare( strict_types = 1 );
+
+namespace MediaWiki\Extension\Translate\MessageBundleTranslation;
+
+use TextContentHandler;
+use const CONTENT_FORMAT_JSON;
+
+/**
+ * @author Niklas Laxström
+ * @license GPL-2.0-or-later
+ * @since 2021.05
+ */
+class MessageBundleContentHandler extends TextContentHandler {
+ public function __construct( $modelId = MessageBundleContent::CONTENT_MODEL_ID ) {
+ parent::__construct( $modelId, [ CONTENT_FORMAT_JSON ] );
+ }
+
+ protected function getContentClass() {
+ return MessageBundleContent::class;
+ }
+
+ public function makeEmptyContent() {
+ $class = $this->getContentClass();
+ return new $class( '{}' );
+ }
+}