Mollywhite has submitted this change and it was merged.

Change subject: Bug 50988: Add i18n for the JSON error messages
......................................................................


Bug 50988: Add i18n for the JSON error messages

Now the JSON errors will actually display useful messages
about what is wrong with the JSON block.

Bug: 50988
Change-Id: Ib4aa9dacf5c1c15e200a30bbfa083bfb0ff39646
---
A BookManagerv2.i18n.php
M BookManagerv2.php
R includes/JsonSchema.i18n.php
3 files changed, 33 insertions(+), 0 deletions(-)

Approvals:
  Mollywhite: Verified; Looks good to me, approved



diff --git a/BookManagerv2.i18n.php b/BookManagerv2.i18n.php
new file mode 100644
index 0000000..156079e
--- /dev/null
+++ b/BookManagerv2.i18n.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * i18n message definitions for the BookManagerv2 extension.
+ *
+ * @file
+ * @ingroup Extensions
+ * @author Molly White
+ */
+
+$messages = array();
+
+/** English
+ * @author mollywhite
+ */
+$messages['en'] = array(
+       'bookmanagerv2-desc' => 'Adds functionality to enter and store book 
metadata and structure',
+       'bookmanagerv2-invalid-json' => 'Invalid JSON',
+);
+
+/** Message documentation (Message documentation)
+ * @author mollywhite
+ */
+$messages['qqq'] = array(
+       'bookmanagerv2-desc' => 
'{{desc|name=BookManagerv2|url=http://www.mediawiki.org/wiki/Extension:BookManagerv2}}',
+       'bookmanagerv2-invalid-json' => 'Error message shown when an editor 
tries to save an invalid JSON block',
+);
diff --git a/BookManagerv2.php b/BookManagerv2.php
index f52f518..e8566bd 100644
--- a/BookManagerv2.php
+++ b/BookManagerv2.php
@@ -105,6 +105,13 @@
        'ApiJsonSchema' => __DIR__ . '/includes/ApiJsonSchema.php',
 );
 
+//Messages
+$wgExtensionMessagesFiles += array(
+       'BookManagerv2' => __DIR__ . '/BookManagerv2.i18n.php',
+       'BookManagerv2Namespaces' => __DIR__ . '/BookManagerv2.namespaces.php',
+       'JsonSchema' => __DIR__ . '/includes/JsonSchema.i18n.php'
+);
+
 // Register hooks
 $wgHooks['BeforePageDisplay'][] = 'BookManagerv2Hooks::onBeforePageDisplay';
 
diff --git a/Json.i18n.php b/includes/JsonSchema.i18n.php
similarity index 100%
rename from Json.i18n.php
rename to includes/JsonSchema.i18n.php

-- 
To view, visit https://gerrit.wikimedia.org/r/72774
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4aa9dacf5c1c15e200a30bbfa083bfb0ff39646
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>
Gerrit-Reviewer: Mollywhite <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to