diff --git a/lam/HISTORY b/lam/HISTORY index 68d252e3..87f595c4 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -6,6 +6,7 @@ December 2013 4.4 - Unix: switch also additional membership if primary group is changed (RFE 108) - Windows: fixed user name handling, sAMAccountName now optional - Apache 2.4 support (requires Apache "version" module) + - Turkish translation - LAM Pro: -> Bind DLZ support -> Samba/Shadow: display password change date in self service diff --git a/lam/config/language b/lam/config/language index 7f7477a8..454f422d 100644 --- a/lam/config/language +++ b/lam/config/language @@ -44,6 +44,9 @@ ru_RU.utf8:UTF-8:Русский (Россия) # Slovakian sk_SK.utf8:UTF-8:Slovenčina (Slovensko) +# Turkish +tr_TR.utf8:UTF-8:Türkçe (Türkiye) + # Japanese ja_JP.utf8:UTF-8:日本語 (日本) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 392f2a54..8d2c5e97 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -446,11 +446,14 @@ class samba3domain { * @return boolean true if matches, otherwise false */ 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']); $language2 = explode ('.', $language[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 $pregexpr = ''; switch ($regexp) { @@ -577,9 +580,12 @@ function get_preg($argument, $regexp) { } if ($pregexpr!='') 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]); + // 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; } // Now we check "negative" cases, characters which are not allowed @@ -597,14 +603,20 @@ function get_preg($argument, $regexp) { } if ($pregexpr!='') 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]); + // 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; } - /* 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]); + // 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; } diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 805b3c29..b3fa513a 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -58,9 +58,13 @@ function setlanguage() { if (!isset($_SESSION['language'])) { $_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 - 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 bindtextdomain("messages", $locdir); bind_textdomain_codeset("messages", $language[1]); diff --git a/lam/po/make_all b/lam/po/make_all index 60751148..1c54b155 100755 --- a/lam/po/make_all +++ b/lam/po/make_all @@ -81,4 +81,8 @@ echo "Generating Slovakian translation template" ./make_po_sk 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 diff --git a/lam/po/make_po_fr b/lam/po/make_po_fr index 9dc56328..096b9a8b 100755 --- a/lam/po/make_po_fr +++ b/lam/po/make_po_fr @@ -4,7 +4,7 @@ # Copyright (C) 2003 - 2006 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 German translations to messages.po +# This script is run after make_po to merge the existing French translations to messages.po ./make_po msgmerge -v ../locale/fr_FR/LC_MESSAGES/messages.po messages.po -o messages.po diff --git a/lam/po/make_po_it b/lam/po/make_po_it index 8c5d54f3..06585b4a 100755 --- a/lam/po/make_po_it +++ b/lam/po/make_po_it @@ -4,7 +4,7 @@ # Copyright (C) 2003 - 2006 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 German translations to messages.po +# This script is run after make_po to merge the existing Italian translations to messages.po ./make_po msgmerge -v ../locale/it_IT/LC_MESSAGES/messages.po messages.po -o messages.po \ No newline at end of file diff --git a/lam/po/make_po_tr b/lam/po/make_po_tr new file mode 100755 index 00000000..33c47903 --- /dev/null +++ b/lam/po/make_po_tr @@ -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 \ No newline at end of file