summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2010-02-11 20:17:46 -0700
committerSteve Dibb <beandog@gentoo.org>2010-02-11 20:17:46 -0700
commit32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b (patch)
treef9b8efa8def14998bc8f7a4fed123cc34c98f8db /inc.i18n.php
parentZero (diff)
downloadznurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.tar.gz
znurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.tar.bz2
znurt-org-frontend-32a7a5f8d8b36ae6acb6e566ff3d371b7a145c4b.zip
initial commit
Diffstat (limited to 'inc.i18n.php')
-rw-r--r--inc.i18n.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/inc.i18n.php b/inc.i18n.php
new file mode 100644
index 0000000..8372616
--- /dev/null
+++ b/inc.i18n.php
@@ -0,0 +1,65 @@
+<?
+
+ $arr_locales = array(
+ 'cs_CZ' => 'Czech',
+ 'de_DE' => 'German',
+ 'el_GR' => 'Greek',
+ 'en_US' => 'English',
+ 'es_US' => 'Spanish',
+ 'fr_FR' => 'French',
+ 'tr_TR' => 'Turkish',
+ 'it_IT' => 'Italian',
+ );
+
+ if($_SERVER['HTTP_HOST'] == "cs.znurt.org") {
+ $lingua = "cs";
+ $locale = "cs_CZ";
+ } elseif($_SERVER['HTTP_HOST'] == "de.znurt.org" || $lingua == "de") {
+ $i18n = true;
+ $lingua = "de";
+ $locale = "de_DE";
+ } elseif($_SERVER['HTTP_HOST'] == "es.znurt.org" || $lingua == "es") {
+ $i18n = true;
+ $lingua = "es";
+ $locale = "es_US";
+ } elseif($_SERVER['HTTP_HOST'] == "fr.znurt.org" || $lingua == "fr") {
+ $lingua = "fr";
+ $locale = "fr_FR";
+ } elseif($_SERVER['HTTP_HOST'] == "it.znurt.org" || $lingua == "it") {
+ $lingua = "it";
+ $locale = "it_IT";
+ } elseif($_SERVER['HTTP_HOST'] == "tr.znurt.org") {
+ $lingua = "tr";
+ $locale = "tr_TR";
+ } else
+ $lingua = "en";
+
+ if($locale && in_array($locale, array_keys($arr_locales))) {
+
+ setlocale(LC_MESSAGES, $locale);
+ bindtextdomain("messages", "./locale");
+ bind_textdomain_codeset("messages", 'UTF-8');
+ textdomain("messages");
+
+ }
+
+ if($i18n) {
+ $url_new_packages = str_replace(" ", "_", gettext("new packages"));
+ $url_categories = gettext("categories");
+ $url_useflags = str_replace(" ", "_", gettext("use flags"));
+ $url_arch = gettext("architectures");
+ $url_linguas = gettext("linguas");
+ $url_about = gettext("about");
+ $url_feeds = strtolower(gettext("Subscription Feeds"));
+ } else {
+ $url_new_packages = "new_packages";
+ $url_categories = "categories";
+ $url_useflags = "useflags";
+ $url_arch = "arch";
+ $url_linguas = "linguas";
+ $url_about = "about";
+ $url_feeds = "feeds";
+ }
+
+ date_default_timezone_set('UTC');
+?> \ No newline at end of file