From 31c9e8965b585818a07d9b6abbe563272af26272 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 4 Aug 2011 07:27:23 +0000 Subject: [PATCH] fixed creating of new translations / give [Write] button file not yet existing (permissions given) --- etemplate/inc/class.solangfile.inc.php | 4 ---- phpgwapi/inc/class.translation.inc.php | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/etemplate/inc/class.solangfile.inc.php b/etemplate/inc/class.solangfile.inc.php index 8c39c4b01f..9bcafd6328 100644 --- a/etemplate/inc/class.solangfile.inc.php +++ b/etemplate/inc/class.solangfile.inc.php @@ -339,10 +339,6 @@ class solangfile fclose($fp); } } - else - { - $fn = lang('no file'); - } if ($target) { $this->tgt_file = $fn; diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index f7a3f73931..d277dad6df 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -433,12 +433,12 @@ class translation /** * provides centralization and compatibility to locate the lang files - * - * @param string $app application name - * @param string $lang language code - * @return the full path of the filename for the requested app and language - */ - static function get_lang_file($app,$lang) + * + * @param string $app application name + * @param string $lang language code + * @return the full path of the filename for the requested app and language + */ + static function get_lang_file($app,$lang) { // Visit each lang file dir, look for a corresponding ${prefix}_lang file $langprefix=EGW_SERVER_ROOT . SEP ; @@ -447,15 +447,16 @@ class translation $cur_appfile = $langprefix . $app . SEP . 'setup' . SEP . self::LANGFILE_PREFIX . $langsuffix; $old_appfile = $langprefix . $app . SEP . 'setup' . SEP . self::OLD_LANGFILE_PREFIX . $langsuffix; // Note there's no chance for 'lang/phpgw_' files + $appfile = $new_appfile; // set as default if (file_exists($new_appfile)) { - $appfile=$new_appfile; + // nothing to do, already default } elseif (file_exists($cur_appfile)) { $appfile=$cur_appfile; } - else + elseif (file_exists($old_appfile)) { $appfile=$old_appfile; } @@ -1250,7 +1251,7 @@ class translation } // strip out whitespace inbetween CR/LF $elem = preg_replace('~\r\n\s+\r\n~si', "\r\n\r\n", $elem); - // strip out / reduce exess CR/LF + // strip out / reduce exess CR/LF $elem = preg_replace('~\r\n{3,}~si',"\r\n\r\n",$elem); } } @@ -1264,7 +1265,7 @@ class translation } // strip out whitespace inbetween CR/LF $_html = preg_replace('~\r\n\s+\r\n~si', "\r\n\r\n", $_html); - // strip out / reduce exess CR/LF + // strip out / reduce exess CR/LF $_html = preg_replace('~(\r\n){3,}~si',"\r\n\r\n",$_html); } }