From 5dada309b6a9d984fd5003ccd024e4012cfc61f3 Mon Sep 17 00:00:00 2001
From: fantu <fantu@ispconfig3>
Date: Thu, 11 Dec 2008 08:29:09 -0500
Subject: [PATCH] other improve in multilanguage: if file for current language not exist use master language
---
interface/lib/classes/tform.inc.php | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index dbb17fa..50dbd15 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -1,7 +1,7 @@
<?php
/*
-Copyright (c) 2005, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -56,9 +56,6 @@
*
* Hint: The auto increment (ID) filed of the table has not be be definied eoarately.
*
-* @package form
-* @author Till Brehm
-* @version 1.1
*/
class tform {
@@ -133,14 +130,17 @@
$this->module = $module;
$wb = array();
+ $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$_SESSION['s']['language'].'_tform.lng';
+ if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en'.'_tform.lng';
+ include($lng_file);
if($module == '') {
- if(is_file("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
- include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
- }
+ $lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng";
+ if(!file_exists($lng_file)) $lng_file = "lib/lang/en_".$this->formDef["name"].".lng";
+ include($lng_file);
} else {
- if(is_file("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng")) {
- include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
- }
+ $lng_file = "../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng";
+ if(!file_exists($lng_file)) $lng_file = "../$module/lib/lang/en_".$this->formDef["name"].".lng";
+ include($lng_file);
}
$this->wordbook = $wb;
--
Gitblit v1.9.1