/openshift/adei

To get this branch, use:
bzr branch http://darksoft.org/webbzr/openshift/adei

« back to all changes in this revision

Viewing changes to locale.php

  • Committer: Suren A. Chilingaryan
  • Date: 2012-02-07 22:44:15 UTC
  • Revision ID: csa@dside.dyndns.org-20120207224415-sy360wa1ammhd1ph
Use localization subsystem, updated Katrin configs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
$locales = array(
 
3
    "en" => "en_US.UTF-8",
 
4
    "de" => "de_DE.UTF-8"
 
5
);
 
6
 
 
7
if (is_dir("./setups/$ADEI_SETUP/po")) $locale_dir = "./setups/$ADEI_SETUP/po";
 
8
else $locale_dir = "./po";
 
9
 
 
10
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
 
11
if (!$lang) $lang = "en";
 
12
 
 
13
if (isset($locales[$lang])) {
 
14
    if (!is_dir("$locale_dir/$lang")) $lang = "en";
 
15
} else $lang = "en";
 
16
 
 
17
$locale = $locales[$lang];
 
18
 
 
19
 
 
20
if (setlocale(LC_MESSAGES, $locale)) {
 
21
    bindtextdomain("adei", $locale_dir);
 
22
    textdomain("adei");
 
23
}
 
24
?>
 
 
b'\\ No newline at end of file'