[Pkg-owncloud-commits] [owncloud] 298/394: Improve autodetection of language.

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:34 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 3f7e75c255d5c8dc38630d7ba7357e8696e7793a
Author: Sergi Almacellas Abellana <sergi at koolpi.com>
Date:   Fri Dec 7 20:34:17 2012 +0100

    Improve autodetection of language.
    
    Fixes #730.
---
 lib/l10n.php |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/l10n.php b/lib/l10n.php
index 4eb4c32..a7c1bf2 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -279,8 +279,14 @@ class OC_L10N{
 			}
 			foreach($accepted_languages as $i) {
 				$temp = explode(';', $i);
-				if(array_search($temp[0], $available) !== false) {
-					return $temp[0];
+				$temp[0] = str_replace('-','_',$temp[0]);
+				if( ($key = array_search($temp[0], $available)) !== false) {
+					return $available[$key];
+				}
+			}
+			foreach($available as $l) {
+				if ( $temp[0] == substr($l,0,2) ) {
+					return $l;
 				}
 			}
 		}

-- 
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