aboutsummaryrefslogtreecommitdiff
path: root/www/inc/l10nget.inc.php
diff options
context:
space:
mode:
authorjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2005-11-25 22:45:21 +0000
committerjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2005-11-25 22:45:21 +0000
commit20407702b92cb93970eaa4a71e659f383d2f92a5 (patch)
tree063e1fc818a47e1b74e285a7b5e80ac7cb90a306 /www/inc/l10nget.inc.php
parent6429a6080db982bcb37421d9735e25cfec25acec (diff)
downloadoriginal-20407702b92cb93970eaa4a71e659f383d2f92a5.tar.gz
original-20407702b92cb93970eaa4a71e659f383d2f92a5.tar.bz2
0.11
git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@8 4fa712ea-3c06-0410-9261-c11b4c06c003
Diffstat (limited to 'www/inc/l10nget.inc.php')
-rw-r--r--www/inc/l10nget.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/www/inc/l10nget.inc.php b/www/inc/l10nget.inc.php
new file mode 100644
index 0000000..f04b18c
--- /dev/null
+++ b/www/inc/l10nget.inc.php
@@ -0,0 +1,17 @@
+<?php
+
+function get_lang_from_agent($accept) {
+
+ $acceptarr = explode("," , $accept);
+ foreach ($acceptarr as $lang) {
+ //get rid of trailing garbage
+ $lang = ereg_replace("^(.*)\;.*","\\1", $lang);
+ if (is_dir("l10n/$lang")) {
+ return $lang;
+ exit;
+ }
+ //no translation for accept language
+ return "en";
+ }
+}
+?>