support for Turkish
This commit is contained in:
		
							parent
							
								
									bd9f619c6e
								
							
						
					
					
						commit
						4fcb0c270e
					
				|  | @ -6,6 +6,7 @@ December 2013 4.4 | ||||||
|   - Unix: switch also additional membership if primary group is changed (RFE 108) |   - Unix: switch also additional membership if primary group is changed (RFE 108) | ||||||
|   - Windows: fixed user name handling, sAMAccountName now optional |   - Windows: fixed user name handling, sAMAccountName now optional | ||||||
|   - Apache 2.4 support (requires Apache "version" module) |   - Apache 2.4 support (requires Apache "version" module) | ||||||
|  |   - Turkish translation | ||||||
|   - LAM Pro: |   - LAM Pro: | ||||||
|    -> Bind DLZ support |    -> Bind DLZ support | ||||||
|    -> Samba/Shadow: display password change date in self service |    -> Samba/Shadow: display password change date in self service | ||||||
|  |  | ||||||
|  | @ -44,6 +44,9 @@ ru_RU.utf8:UTF-8:Русский (Россия) | ||||||
| # Slovakian | # Slovakian | ||||||
| sk_SK.utf8:UTF-8:Slovenčina (Slovensko) | sk_SK.utf8:UTF-8:Slovenčina (Slovensko) | ||||||
| 
 | 
 | ||||||
|  | # Turkish | ||||||
|  | tr_TR.utf8:UTF-8:Türkçe (Türkiye) | ||||||
|  | 
 | ||||||
| # Japanese | # Japanese | ||||||
| ja_JP.utf8:UTF-8:日本語 (日本) | ja_JP.utf8:UTF-8:日本語 (日本) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -446,11 +446,14 @@ class samba3domain { | ||||||
| * @return boolean true if matches, otherwise false | * @return boolean true if matches, otherwise false | ||||||
| */ | */ | ||||||
| function get_preg($argument, $regexp) { | function get_preg($argument, $regexp) { | ||||||
| 	/* Bug in php preg_match doesn't work correct with utf8 | 	/* Bug in php preg_match doesn't work correct with utf8 */ | ||||||
| 	*/ |  | ||||||
| 	$language = explode(":", $_SESSION['language']); | 	$language = explode(":", $_SESSION['language']); | ||||||
| 	$language2 = explode ('.', $language[0]); | 	$language2 = explode ('.', $language[0]); | ||||||
| 	setlocale(LC_ALL, $language2[0]); | 	setlocale(LC_ALL, $language2[0]); | ||||||
|  | 	// workaround for buggy PHP with Turkish
 | ||||||
|  | 	if (($language[0] == 'tr_TR.utf8') && (version_compare(phpversion(), '5.5') < 0)) { | ||||||
|  | 		setlocale(LC_CTYPE, 'en_GB'); | ||||||
|  | 	} | ||||||
| 	// First we check "positive" cases
 | 	// First we check "positive" cases
 | ||||||
| 	$pregexpr = ''; | 	$pregexpr = ''; | ||||||
| 	switch ($regexp) { | 	switch ($regexp) { | ||||||
|  | @ -577,9 +580,12 @@ function get_preg($argument, $regexp) { | ||||||
| 	} | 	} | ||||||
| 	if ($pregexpr!='') | 	if ($pregexpr!='') | ||||||
| 		if (preg_match($pregexpr, $argument)) { | 		if (preg_match($pregexpr, $argument)) { | ||||||
| 			/* Bug in php preg_match doesn't work correct with utf8 | 			/* Bug in php preg_match doesn't work correct with utf8 */ | ||||||
| 			*/ |  | ||||||
| 			setlocale(LC_ALL, $language[0]); | 			setlocale(LC_ALL, $language[0]); | ||||||
|  | 			// workaround for buggy PHP with Turkish
 | ||||||
|  | 			if (($language[0] == 'tr_TR.utf8') && (version_compare(phpversion(), '5.5') < 0)) { | ||||||
|  | 				setlocale(LC_CTYPE, 'en_GB'); | ||||||
|  | 			} | ||||||
| 			return true; | 			return true; | ||||||
| 		} | 		} | ||||||
| 	// Now we check "negative" cases, characters which are not allowed
 | 	// Now we check "negative" cases, characters which are not allowed
 | ||||||
|  | @ -597,14 +603,20 @@ function get_preg($argument, $regexp) { | ||||||
| 	} | 	} | ||||||
| 	if ($pregexpr!='') | 	if ($pregexpr!='') | ||||||
| 		if (!preg_match($pregexpr, $argument)) { | 		if (!preg_match($pregexpr, $argument)) { | ||||||
| 			/* Bug in php preg_match doesn't work correct with utf8 | 			/* Bug in php preg_match doesn't work correct with utf8 */ | ||||||
| 			*/ |  | ||||||
| 			setlocale(LC_ALL, $language[0]); | 			setlocale(LC_ALL, $language[0]); | ||||||
|  | 			// workaround for buggy PHP with Turkish
 | ||||||
|  | 			if (($language[0] == 'tr_TR.utf8') && (version_compare(phpversion(), '5.5') < 0)) { | ||||||
|  | 				setlocale(LC_CTYPE, 'en_GB'); | ||||||
|  | 			} | ||||||
| 			return true; | 			return true; | ||||||
| 		} | 		} | ||||||
| 	/* Bug in php preg_match doesn't work correct with utf8 | 	/* Bug in php preg_match doesn't work correct with utf8 */ | ||||||
| 	*/ |  | ||||||
| 	setlocale(LC_ALL, $language[0]); | 	setlocale(LC_ALL, $language[0]); | ||||||
|  | 	// workaround for buggy PHP with Turkish
 | ||||||
|  | 	if (($language[0] == 'tr_TR.utf8') && (version_compare(phpversion(), '5.5') < 0)) { | ||||||
|  | 		setlocale(LC_CTYPE, 'en_GB'); | ||||||
|  | 	} | ||||||
| 	return false; | 	return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -58,9 +58,13 @@ function setlanguage() { | ||||||
| 	if (!isset($_SESSION['language'])) { | 	if (!isset($_SESSION['language'])) { | ||||||
| 		$_SESSION['language'] = "en_GB.utf8:UTF-8:English (Great Britain)"; | 		$_SESSION['language'] = "en_GB.utf8:UTF-8:English (Great Britain)"; | ||||||
| 	} | 	} | ||||||
| 	$language = explode(":", $_SESSION['language']); | 	$language = explode(":", trim($_SESSION['language'])); | ||||||
| 	putenv("LANG=" . $language[0]);  // e.g. LANG=de_DE
 | 	putenv("LANG=" . $language[0]);  // e.g. LANG=de_DE
 | ||||||
| 	setlocale(LC_ALL, $language[0]);  // set LC_ALL to de_DE
 | 	setlocale(LC_ALL, $language[0]);  // set LC_ALL
 | ||||||
|  | 	// workaround for buggy PHP with Turkish
 | ||||||
|  | 	if (($language[0] == 'tr_TR.utf8') && (version_compare(phpversion(), '5.5') < 0)) { | ||||||
|  | 		setlocale(LC_CTYPE, 'en_GB'); | ||||||
|  | 	} | ||||||
| 	$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/locale";  // set path to translations
 | 	$locdir = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/locale";  // set path to translations
 | ||||||
| 	bindtextdomain("messages", $locdir); | 	bindtextdomain("messages", $locdir); | ||||||
| 	bind_textdomain_codeset("messages", $language[1]); | 	bind_textdomain_codeset("messages", $language[1]); | ||||||
|  |  | ||||||
|  | @ -81,4 +81,8 @@ echo "Generating Slovakian translation template" | ||||||
| ./make_po_sk | ./make_po_sk | ||||||
| tar -czf messages.po_sk.tar.gz messages.po | tar -czf messages.po_sk.tar.gz messages.po | ||||||
| 
 | 
 | ||||||
|  | echo "Generating Turkish translation template" | ||||||
|  | ./make_po_tr | ||||||
|  | tar -czf messages.po_tr.tar.gz messages.po | ||||||
|  | 
 | ||||||
| rm messages.po | rm messages.po | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
| # Copyright (C) 2003 - 2006  Roland Gruber | # Copyright (C) 2003 - 2006  Roland Gruber | ||||||
| # This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | # This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | ||||||
| 
 | 
 | ||||||
| # This script is run after make_po to merge the existing German translations to messages.po | # This script is run after make_po to merge the existing French translations to messages.po | ||||||
| 
 | 
 | ||||||
| ./make_po | ./make_po | ||||||
| msgmerge -v ../locale/fr_FR/LC_MESSAGES/messages.po messages.po -o messages.po | msgmerge -v ../locale/fr_FR/LC_MESSAGES/messages.po messages.po -o messages.po | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
| # Copyright (C) 2003 - 2006  Roland Gruber | # Copyright (C) 2003 - 2006  Roland Gruber | ||||||
| # This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | # This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | ||||||
| 
 | 
 | ||||||
| # This script is run after make_po to merge the existing German translations to messages.po | # This script is run after make_po to merge the existing Italian translations to messages.po | ||||||
| 
 | 
 | ||||||
| ./make_po | ./make_po | ||||||
| msgmerge -v ../locale/it_IT/LC_MESSAGES/messages.po messages.po -o messages.po | msgmerge -v ../locale/it_IT/LC_MESSAGES/messages.po messages.po -o messages.po | ||||||
|  | @ -0,0 +1,10 @@ | ||||||
|  | #!/bin/bash | ||||||
|  | # $Id: make_po_it 3354 2009-11-09 18:49:17Z gruberroland $ | ||||||
|  | # | ||||||
|  | # Copyright (C) 2013  Roland Gruber | ||||||
|  | # This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) | ||||||
|  | 
 | ||||||
|  | # This script is run after make_po to merge the existing Turkish translations to messages.po | ||||||
|  | 
 | ||||||
|  | ./make_po | ||||||
|  | msgmerge -v ../locale/tr_TR/LC_MESSAGES/messages.po messages.po -o messages.po | ||||||
		Loading…
	
		Reference in New Issue