[Pkg-owncloud-commits] [owncloud] 124/172: provide a way to detect the language that is being used (e.g. for clientside javascript language selection

David Prévot taffit at moszumanska.debian.org
Sun May 18 20:09:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 512373fadf64c4ea982e12d921684b298f112314
Author: Bernhard Posselt <dev at bernhard-posselt.com>
Date:   Wed May 14 01:06:14 2014 +0200

    provide a way to detect the language that is being used (e.g. for clientside javascript language selection
---
 lib/private/l10n.php | 17 +++++++++++++++++
 lib/public/il10n.php | 14 ++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index c9d9e81..40eeb98 100644
--- a/lib/private/l10n.php
+++ b/lib/private/l10n.php
@@ -401,6 +401,23 @@ class OC_L10N implements \OCP\IL10N {
 		self::$language = $lang;
 	}
 
+
+	/**
+	 * @brief find the best language
+	 * @param array|string $app details below
+	 * @returns string language
+	 *
+	 * If $app is an array, ownCloud assumes that these are the available
+	 * languages. Otherwise ownCloud tries to find the files in the l10n
+	 * folder.
+	 *
+	 * If nothing works it returns 'en'
+	 */
+	public function getLanguageCode($app=null) {
+		return self::findLanguage($app);
+	}
+	
+
 	/**
 	 * @brief find the best language
 	 * @param array|string $app details below
diff --git a/lib/public/il10n.php b/lib/public/il10n.php
index c228be6..7649a1e 100644
--- a/lib/public/il10n.php
+++ b/lib/public/il10n.php
@@ -72,4 +72,18 @@ interface IL10N {
 	 *    - params: timestamp (int/string)
 	 */
 	public function l($type, $data);
+
+
+	/**
+	 * @brief find the best language
+	 * @param array|string $app details below
+	 * @returns string language
+	 *
+	 * If $app is an array, ownCloud assumes that these are the available
+	 * languages. Otherwise ownCloud tries to find the files in the l10n
+	 * folder.
+	 *
+	 * If nothing works it returns 'en'
+	 */
+	public function getLanguageCode($app=null);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list