locale.php 378 B

123456789101112131415
  1. <?php
  2. $locales = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
  3. for($i=count($locales)-1;$i>=0;$i--){
  4. $locale = str_replace('-','_',$locales[$i]);
  5. if(is_dir(DIR.'/lang/'.$locale)){
  6. break;
  7. }else{
  8. $locale = 'en';
  9. }
  10. }
  11. define('LOCALE',$locale);
  12. bindtextdomain('omninet',DIR.'/lang/'.LOCALE);
  13. bind_textdomain_codeset('omninet','UTF-8');
  14. textdomain('omninet');
  15. ?>