summaryrefslogtreecommitdiffstats
path: root/lib/l10n
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-09-25 18:34:01 +0200
committerBart Visscher <bartv@thisnet.nl>2013-10-04 18:11:02 +0200
commit9f777fba988422366732a3f128e2fb73ffddfbb4 (patch)
tree69b43762523448f3b59ccf27667b296fb99500e3 /lib/l10n
parentbae121b16dbabed3ec307ea58e3b8a73ab27161c (diff)
downloadnextcloud-server-9f777fba988422366732a3f128e2fb73ffddfbb4.tar.gz
nextcloud-server-9f777fba988422366732a3f128e2fb73ffddfbb4.zip
Add L10N interface to server container
Diffstat (limited to 'lib/l10n')
-rw-r--r--lib/l10n/factory.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/l10n/factory.php b/lib/l10n/factory.php
new file mode 100644
index 00000000000..ba168872acd
--- /dev/null
+++ b/lib/l10n/factory.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ *
+ */
+
+namespace OC\L10N;
+
+/**
+ * TODO: Description
+ */
+class Factory {
+ /**
+ * cached instances
+ */
+ protected $instances = array();
+
+ /**
+ * get an L10N instance
+ * @param $app string
+ * @param $lang string|null
+ * @return OC_L10N
+ */
+ public function get($app) {
+ if (!isset($this->instances[$app])) {
+ $this->instances[$app] = new \OC_L10N($app);
+ }
+ return $this->instances[$app];
+ }
+
+}