aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/language/language.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
index 382d4db89e..42429c2c07 100644
--- a/phpBB/phpbb/language/language.php
+++ b/phpBB/phpbb/language/language.php
@@ -246,14 +246,14 @@ class language
}
/**
- * Act like lang() but takes a key and an array of parameters instead of using variadic
+ * Returns the raw value associated to a language key or the language key no translation is available.
+ * No parameter substitution is performed, can be a string or an array.
*
* @param string|array $key Language key
- * @param array $args Parameters
*
* @return array|string
*/
- public function lang_array($key, $args = array())
+ public function lang_raw($key)
{
// Load common language files if they not loaded yet
if (!$this->common_language_files_loaded)
@@ -281,6 +281,26 @@ class language
return $key;
}
+ return $lang;
+ }
+
+ /**
+ * Act like lang() but takes a key and an array of parameters instead of using variadic
+ *
+ * @param string|array $key Language key
+ * @param array $args Parameters
+ *
+ * @return string
+ */
+ public function lang_array($key, $args = array())
+ {
+ $lang = $this->lang_raw($key);
+
+ if ($lang === $key)
+ {
+ return $key;
+ }
+
// If the language entry is a string, we simply mimic sprintf() behaviour
if (is_string($lang))
{