summaryrefslogtreecommitdiffstats
path: root/lib/l10n.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/l10n.php')
-rw-r--r--lib/l10n.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/l10n.php b/lib/l10n.php
index 00bff08bf7f..c0ecdbd1b70 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -25,6 +25,11 @@
*/
class OC_L10N{
/**
+ * cached instances
+ */
+ protected static $instances=array();
+
+ /**
* cache
*/
protected static $cache = array();
@@ -46,6 +51,21 @@ class OC_L10N{
'date' => 'd.m.Y',
'datetime' => 'd.m.Y H:i:s',
'time' => 'H:i:s');
+
+ /**
+ * get an L10N instance
+ * @return OC_L10N
+ */
+ public static function get($app,$lang=null){
+ if(is_null($lang)){
+ if(!isset(self::$instances[$app])){
+ self::$instances[$app]=new OC_L10N($app);
+ }
+ return self::$instances[$app];
+ }else{
+ return new OC_L10N($app,$lang);
+ }
+ }
/**
* @brief The constructor