2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Added translate_array function to translate strings from external sources

Added the queXS translation template
This commit is contained in:
azammitdcarf
2009-03-17 23:13:12 +00:00
parent 4c5768bc2f
commit 6c81d0f070
2 changed files with 1999 additions and 0 deletions

View File

@@ -34,6 +34,22 @@
*/
require_once(dirname(__FILE__).'/include/php-gettext-1.0.7/gettext.inc');
/**
* Translate the given elements of the array
*
* @param array The array to translate
* @param array The elements in the array to translate
* @return The array with the elements translated
*/
function translate_array(&$a,$b)
{
foreach ($a as &$row)
foreach($b as $el)
$row[$el] = T_($row[$el]);
}
$locale = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if (empty($locale)) $locale = DEFAULT_LOCALE;
T_setlocale(LC_MESSAGES, $locale);