[debian-edu-commits] debian-edu/slbackup-php.git (#20) - edu-wheezy (branch) updated: debian/0.3-2.2-19-ge983218

Mike Gabriel sunweaver at alioth.debian.org
Fri Aug 9 10:05:39 UTC 2013


The branch, edu-wheezy has been updated
       via  e9832183dcf01c7a995f8ec87c1eadffc28e5762 (commit)
      from  a5c51d349273836949e355fa4879612f127b643f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                                   |    2 +
 .../100_slbackup-php_fix-language-detection.patch  |   88 ++++++++++++++++++--
 debian/patches/series                              |    1 +
 3 files changed, 84 insertions(+), 7 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 7519cf3..b3a52d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,8 @@ slbackup-php (0.3-2.3) UNRELEASED; urgency=low
   * Update patch: 101_slbackup-php_i18n-de.patch.
   * Update patch: 002_slbackup-php_restore-paths-with-blanks.patch. Fix misplaced
     double quotes.
+  * Update patch: 100_slbackup-php_fix-language-detection.patch, add
+    proper locale name recognition.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sun, 15 Jan 2012 13:40:20 +0100
 
diff --git a/debian/patches/100_slbackup-php_fix-language-detection.patch b/debian/patches/100_slbackup-php_fix-language-detection.patch
index f321db2..83b9dcd 100644
--- a/debian/patches/100_slbackup-php_fix-language-detection.patch
+++ b/debian/patches/100_slbackup-php_fix-language-detection.patch
@@ -1,16 +1,90 @@
 --- a/src/functions.php
 +++ b/src/functions.php
-@@ -100,8 +100,11 @@
- 	
+@@ -60,13 +60,15 @@
+ }
+ 
+ function loadLocale () {
+-    $found_locale = $_COOKIE['locale'] ;
+-    
++    $found_locale = "";
++    if (array_key_exists('locale', $_COOKIE))
++	$found_locale = $_COOKIE['locale'];
++
+     if ($found_locale == "" && $handle = @opendir ('../locales')) {
+-	$all_locales = array () ; 
++	$translations = array () ; 
+ 	while (false !== ($file = readdir ($handle))) {
+ 	    if (is_dir ('../locales/' . $file . '/LC_MESSAGES')) {
+-		$all_locales = array_merge ($all_locales, array ($file)) ; 
++		$translations = array_merge ($translations, array ($file)) ; 
+ 	    }
+ 	}
+ 	closedir ($handle) ; 
+@@ -76,32 +78,50 @@
+ 	    $lang_accept[$i] = split(";", $lang_accept[$i]) ; 
+ 	    $lang_accept[$i] = $lang_accept[$i][0] ; 
+ 	}
+-	if (!empty($lang_accept[0]))
+-	foreach ($lang_accept as $lang) {
+-	    if (!isset ($locale_exact)) {
+-		foreach ($all_locales as $locales) {
+-		    if ($locales == $lang)
+-			$locale_exact = $lang ; 
+-		    elseif (!isset ($locale_match)) {
+-			if (strpos ($locales, $lang) === 0)
+-			    $locale_match = $locales ; 
++
++	if (!empty($lang_accept[0])) {
++	    foreach ($lang_accept as $lang) {
++		if (!isset ($locale_exact)) {
++		    foreach ($translations as $translation) {
++			if ($translation == $lang)
++			    $locale_exact = $lang ; 
++			elseif (!isset ($locale_match)) {
++			    if (strpos ($translation, $lang) === 0)
++				$locale_match = $translation ; 
++			}
+ 		    }
+ 		}
+ 	    }
++	    if (isset ($locale_exact)) 
++		$found_locale=$locale_exact ; 
++	    elseif (isset ($locale_match))
++		$found_locale=$locale_match ; 
++	}
++
++	$locales_utf8 = array();
++	if (isset($found_locale) && !empty($lang_accept[0])) {
++	    foreach ($lang_accept as $lang) {
++		$lang_tuple = split('-',$lang);
++		if (count($lang_tuple) > 1) {
++		    $language = strtolower($lang_tuple[0]);
++		    $country = strtoupper($lang_tuple[1]);
++		    $locales[] = $language . '_' . $country;
++		    $locales_utf8[] = $language . '_' . $country . '.UTF-8';
++		}
++	    }
++	    $locales_all = array_merge ($locales_utf8, $locales);
++	    $found_locale = setlocale (LC_ALL, $locales_all) ; 
+ 	}
+-	if (isset ($locale_exact)) 
+-	    $found_locale=$locale_exact ; 
+-	elseif (isset ($locale_match))
+-	    $found_locale=$locale_match ; 
++
+ 	if (isset ($found_locale))
+ 	    setcookie ( 'locale', $found_locale) ;
+ 	unset ($all_locales, $lang_accept, $locale_match, $locale_exact, $lang, $locales) ; 
+     }
+-	
++
      if (isset ($found_locale)) {
-         $locale = setlocale (LC_ALL, $found_locale) ; 
+-        $locale = setlocale (LC_ALL, $found_locale) ; 
 -	if (empty($locale)) 
 -	    setlocale (LC_ALL, $found_locale . ".UTF8"); 
-+	if (empty($locale)) {
++	$locale = setlocale (LC_ALL, $found_locale) ; 
++	if (empty($locale))
 +	    $locale = setlocale (LC_ALL, $found_locale . ".UTF8");
-+	    if (empty($locale))
-+		$locale = setlocale (LC_ALL, $found_locale . "_" . strtoupper($found_locale) . ".UTF8");
-+	}
  	bindtextdomain ("slbackup-php", "../locales/"); 
  	bind_textdomain_codeset ("slbackup-php", "UTF-8");
  	textdomain ("slbackup-php"); 
diff --git a/debian/patches/series b/debian/patches/series
index b7900a6..df31b28 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 001_slbackup-php_cookie+request-merge.patch
 002_slbackup-php_restore-paths-with-blanks.patch
+003_slbackup-php_fix-failed-in-status-template.patch
 100_slbackup-php_fix-language-detection.patch
 101_slbackup-php_i18n-de.patch


hooks/post-receive
-- 
slbackup-php.git (Debian package slbackup-php)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "slbackup-php.git" (Debian package slbackup-php).




More information about the debian-edu-commits mailing list