From 7edeae2cab1c83198f06155a79c88c30e3842272 Mon Sep 17 00:00:00 2001
From: Damyon Wiese <damyon@moodle.com>
Date: Wed, 23 Aug 2017 11:30:39 +0800
Subject: [PATCH] HACK

---
 classes/analytics/indicator/set_setting.php   |  4 ++--
 classes/analytics/target/binary_example.php   |  4 ++--
 classes/analytics/target/discrete_example.php |  4 ++--
 classes/analytics/target/linear_example.php   |  4 ++--
 lang/en/local_testanalytics.php               | 34 +++++++++++++++++++++++++++
 5 files changed, 42 insertions(+), 8 deletions(-)
 create mode 100644 lang/en/local_testanalytics.php

diff --git a/classes/analytics/indicator/set_setting.php b/classes/analytics/indicator/set_setting.php
index 25c5b8c..6d469ed 100644
--- a/classes/analytics/indicator/set_setting.php
+++ b/classes/analytics/indicator/set_setting.php
@@ -38,8 +38,8 @@ class set_setting extends \core_analytics\local\indicator\binary {
      *
      * @return string
      */
-    public static function get_name() {
-        return 'Setting is set';
+    public static function get_name(): \lang_string {
+        return new \lang_string('setting', 'local_testanalytics');
     }
 
     /**
diff --git a/classes/analytics/target/binary_example.php b/classes/analytics/target/binary_example.php
index ec6efe8..9bb112e 100644
--- a/classes/analytics/target/binary_example.php
+++ b/classes/analytics/target/binary_example.php
@@ -40,8 +40,8 @@ class binary_example extends \core_analytics\local\target\binary {
      *
      * @return string
      */
-    public static function get_name() {
-        return 'binary example (random calculation)';
+    public static function get_name() : \lang_string {
+        return new \lang_string('binary', 'local_testanalytics');
     }
 
     /**
diff --git a/classes/analytics/target/discrete_example.php b/classes/analytics/target/discrete_example.php
index b285e2f..ddf1a86 100644
--- a/classes/analytics/target/discrete_example.php
+++ b/classes/analytics/target/discrete_example.php
@@ -40,8 +40,8 @@ class discrete_example extends \core_analytics\local\target\discrete {
      *
      * @return string
      */
-    public static function get_name() {
-        return 'discrete example (random calculation)';
+    public static function get_name() : \lang_string {
+        return new \lang_string('discrete', 'local_testanalytics');
     }
 
     /**
diff --git a/classes/analytics/target/linear_example.php b/classes/analytics/target/linear_example.php
index f8c2f66..4f4a747 100644
--- a/classes/analytics/target/linear_example.php
+++ b/classes/analytics/target/linear_example.php
@@ -40,8 +40,8 @@ class linear_example extends \core_analytics\local\target\linear {
      *
      * @return string
      */
-    public static function get_name() {
-        return 'linear example (random calculation)';
+    public static function get_name() : \lang_string {
+        return new \lang_string('linear', 'local_testanalytics');
     }
 
     /**
diff --git a/lang/en/local_testanalytics.php b/lang/en/local_testanalytics.php
new file mode 100644
index 0000000..025f258
--- /dev/null
+++ b/lang/en/local_testanalytics.php
@@ -0,0 +1,34 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Strings for component 'local_testanalytics', language 'en'
+ *
+ * @package    local_testanalytics
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$string['pluginname'] = 'Test analytics';
+$string['setting'] = 'Test setting is set';
+$string['setting_help'] = 'Test setting is set HELP';
+$string['binary'] = 'Binary';
+$string['binary_help'] = 'Binary HELP';
+$string['discrete'] = 'Discrete';
+$string['discrete_help'] = 'Discrete HELP';
+$string['linear'] = 'Linear';
+$string['linear_help'] = 'Linear HELP';
-- 
1.9.1

