Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'modules/Translate.php')
-rw-r--r--modules/Translate.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/Translate.php b/modules/Translate.php
index d44119cbf8..d2156181ad 100644
--- a/modules/Translate.php
+++ b/modules/Translate.php
@@ -17,6 +17,11 @@ class Piwik_Translate
{
static private $instance = null;
+ /**
+ * Returns singleton
+ *
+ * @return Piwik_Translate
+ */
static public function getInstance()
{
if (self::$instance == null)
@@ -48,7 +53,8 @@ class Piwik_Translate
/**
* Enter description here...
*
- * @return unknown
+ * @return string the language filename prefix, eg "en" for english
+ * @throws exception if the language set in the config file is not a valid filename
*/
public function getLanguageToLoad()
{
@@ -74,3 +80,11 @@ function Piwik_Translate($index)
throw new Exception("Translation string '$index' not available.");
}
+if(!function_exists('_'))
+{
+ function _($translationIndex)
+ {
+ return Piwik_Translate($translationIndex);
+ }
+}
+