From 7bbfae68c6437fb6bc4df51ecbaf19bdc1ce1a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Manuel=20G=C3=B3mez=20Senovilla?= Date: Sun, 14 Oct 2007 16:13:50 +0000 Subject: [PATCH] Changes in setup to handle egw_ prefix in lang files --- setup/inc/class.setup_translation.inc.php | 9 ++++++--- setup/lang/{phpgw_bg.lang => egw_bg.lang} | 0 setup/lang/{phpgw_ca.lang => egw_ca.lang} | 0 setup/lang/{phpgw_cs.lang => egw_cs.lang} | 0 setup/lang/{phpgw_de.lang => egw_de.lang} | 0 setup/lang/{phpgw_en.lang => egw_en.lang} | 0 setup/lang/{phpgw_es-es.lang => egw_es-es.lang} | 0 setup/lang/{phpgw_fi.lang => egw_fi.lang} | 0 setup/lang/{phpgw_fr.lang => egw_fr.lang} | 0 setup/lang/{phpgw_hr.lang => egw_hr.lang} | 0 setup/lang/{phpgw_hu.lang => egw_hu.lang} | 0 setup/lang/{phpgw_it.lang => egw_it.lang} | 0 setup/lang/{phpgw_iw.lang => egw_iw.lang} | 0 setup/lang/{phpgw_ja.lang => egw_ja.lang} | 0 setup/lang/{phpgw_ko.lang => egw_ko.lang} | 0 setup/lang/{phpgw_lt.lang => egw_lt.lang} | 0 setup/lang/{phpgw_lv.lang => egw_lv.lang} | 0 setup/lang/{phpgw_nl.lang => egw_nl.lang} | 0 setup/lang/{phpgw_no.lang => egw_no.lang} | 0 setup/lang/{phpgw_pl.lang => egw_pl.lang} | 0 setup/lang/{phpgw_pt-br.lang => egw_pt-br.lang} | 0 setup/lang/{phpgw_pt.lang => egw_pt.lang} | 0 setup/lang/{phpgw_ru.lang => egw_ru.lang} | 0 setup/lang/{phpgw_sk.lang => egw_sk.lang} | 0 setup/lang/{phpgw_sl.lang => egw_sl.lang} | 0 setup/lang/{phpgw_sv.lang => egw_sv.lang} | 0 setup/lang/{phpgw_zh-tw.lang => egw_zh-tw.lang} | 0 setup/lang/{phpgw_zh.lang => egw_zh.lang} | 0 28 files changed, 6 insertions(+), 3 deletions(-) rename setup/lang/{phpgw_bg.lang => egw_bg.lang} (100%) rename setup/lang/{phpgw_ca.lang => egw_ca.lang} (100%) rename setup/lang/{phpgw_cs.lang => egw_cs.lang} (100%) rename setup/lang/{phpgw_de.lang => egw_de.lang} (100%) rename setup/lang/{phpgw_en.lang => egw_en.lang} (100%) rename setup/lang/{phpgw_es-es.lang => egw_es-es.lang} (100%) rename setup/lang/{phpgw_fi.lang => egw_fi.lang} (100%) rename setup/lang/{phpgw_fr.lang => egw_fr.lang} (100%) rename setup/lang/{phpgw_hr.lang => egw_hr.lang} (100%) rename setup/lang/{phpgw_hu.lang => egw_hu.lang} (100%) rename setup/lang/{phpgw_it.lang => egw_it.lang} (100%) rename setup/lang/{phpgw_iw.lang => egw_iw.lang} (100%) rename setup/lang/{phpgw_ja.lang => egw_ja.lang} (100%) rename setup/lang/{phpgw_ko.lang => egw_ko.lang} (100%) rename setup/lang/{phpgw_lt.lang => egw_lt.lang} (100%) rename setup/lang/{phpgw_lv.lang => egw_lv.lang} (100%) rename setup/lang/{phpgw_nl.lang => egw_nl.lang} (100%) rename setup/lang/{phpgw_no.lang => egw_no.lang} (100%) rename setup/lang/{phpgw_pl.lang => egw_pl.lang} (100%) rename setup/lang/{phpgw_pt-br.lang => egw_pt-br.lang} (100%) rename setup/lang/{phpgw_pt.lang => egw_pt.lang} (100%) rename setup/lang/{phpgw_ru.lang => egw_ru.lang} (100%) rename setup/lang/{phpgw_sk.lang => egw_sk.lang} (100%) rename setup/lang/{phpgw_sl.lang => egw_sl.lang} (100%) rename setup/lang/{phpgw_sv.lang => egw_sv.lang} (100%) rename setup/lang/{phpgw_zh-tw.lang => egw_zh-tw.lang} (100%) rename setup/lang/{phpgw_zh.lang => egw_zh.lang} (100%) diff --git a/setup/inc/class.setup_translation.inc.php b/setup/inc/class.setup_translation.inc.php index 14c1428ac2..0a193ee94e 100644 --- a/setup/inc/class.setup_translation.inc.php +++ b/setup/inc/class.setup_translation.inc.php @@ -16,6 +16,9 @@ define('MAX_MESSAGE_ID_LENGTH',128); } + // Define prefix for langfiles (historically 'phpgw_') + define('EGW_LANGFILE_PREFIX', 'egw_'); + class setup_translation { var $langarray = array(); @@ -40,10 +43,10 @@ $lang = $ConfigLang; } - $fn = '.' . SEP . 'lang' . SEP . 'phpgw_' . $lang . '.lang'; + $fn = '.' . SEP . 'lang' . SEP . EGW_LANGFILE_PREFIX . $lang . '.lang'; if (!file_exists($fn)) { - $fn = '.' . SEP . 'lang' . SEP . 'phpgw_en.lang'; + $fn = '.' . SEP . 'lang' . SEP . EGW_LANGFILE_PREFIX .'en.lang'; } if (file_exists($fn)) { @@ -151,7 +154,7 @@ while(($line = fgets($f)) !== false) { list($lang,$language) = explode("\t",trim($line)); - if ($lang && ($lf = @fopen("../phpgwapi/setup/phpgw_$lang.lang",'r'))) + if ($lang && ($lf = @fopen("../phpgwapi/setup/" . EGW_LANGFILE_PREFIX . "$lang.lang",'r'))) { while(($line = fgets($lf)) !== false) { diff --git a/setup/lang/phpgw_bg.lang b/setup/lang/egw_bg.lang similarity index 100% rename from setup/lang/phpgw_bg.lang rename to setup/lang/egw_bg.lang diff --git a/setup/lang/phpgw_ca.lang b/setup/lang/egw_ca.lang similarity index 100% rename from setup/lang/phpgw_ca.lang rename to setup/lang/egw_ca.lang diff --git a/setup/lang/phpgw_cs.lang b/setup/lang/egw_cs.lang similarity index 100% rename from setup/lang/phpgw_cs.lang rename to setup/lang/egw_cs.lang diff --git a/setup/lang/phpgw_de.lang b/setup/lang/egw_de.lang similarity index 100% rename from setup/lang/phpgw_de.lang rename to setup/lang/egw_de.lang diff --git a/setup/lang/phpgw_en.lang b/setup/lang/egw_en.lang similarity index 100% rename from setup/lang/phpgw_en.lang rename to setup/lang/egw_en.lang diff --git a/setup/lang/phpgw_es-es.lang b/setup/lang/egw_es-es.lang similarity index 100% rename from setup/lang/phpgw_es-es.lang rename to setup/lang/egw_es-es.lang diff --git a/setup/lang/phpgw_fi.lang b/setup/lang/egw_fi.lang similarity index 100% rename from setup/lang/phpgw_fi.lang rename to setup/lang/egw_fi.lang diff --git a/setup/lang/phpgw_fr.lang b/setup/lang/egw_fr.lang similarity index 100% rename from setup/lang/phpgw_fr.lang rename to setup/lang/egw_fr.lang diff --git a/setup/lang/phpgw_hr.lang b/setup/lang/egw_hr.lang similarity index 100% rename from setup/lang/phpgw_hr.lang rename to setup/lang/egw_hr.lang diff --git a/setup/lang/phpgw_hu.lang b/setup/lang/egw_hu.lang similarity index 100% rename from setup/lang/phpgw_hu.lang rename to setup/lang/egw_hu.lang diff --git a/setup/lang/phpgw_it.lang b/setup/lang/egw_it.lang similarity index 100% rename from setup/lang/phpgw_it.lang rename to setup/lang/egw_it.lang diff --git a/setup/lang/phpgw_iw.lang b/setup/lang/egw_iw.lang similarity index 100% rename from setup/lang/phpgw_iw.lang rename to setup/lang/egw_iw.lang diff --git a/setup/lang/phpgw_ja.lang b/setup/lang/egw_ja.lang similarity index 100% rename from setup/lang/phpgw_ja.lang rename to setup/lang/egw_ja.lang diff --git a/setup/lang/phpgw_ko.lang b/setup/lang/egw_ko.lang similarity index 100% rename from setup/lang/phpgw_ko.lang rename to setup/lang/egw_ko.lang diff --git a/setup/lang/phpgw_lt.lang b/setup/lang/egw_lt.lang similarity index 100% rename from setup/lang/phpgw_lt.lang rename to setup/lang/egw_lt.lang diff --git a/setup/lang/phpgw_lv.lang b/setup/lang/egw_lv.lang similarity index 100% rename from setup/lang/phpgw_lv.lang rename to setup/lang/egw_lv.lang diff --git a/setup/lang/phpgw_nl.lang b/setup/lang/egw_nl.lang similarity index 100% rename from setup/lang/phpgw_nl.lang rename to setup/lang/egw_nl.lang diff --git a/setup/lang/phpgw_no.lang b/setup/lang/egw_no.lang similarity index 100% rename from setup/lang/phpgw_no.lang rename to setup/lang/egw_no.lang diff --git a/setup/lang/phpgw_pl.lang b/setup/lang/egw_pl.lang similarity index 100% rename from setup/lang/phpgw_pl.lang rename to setup/lang/egw_pl.lang diff --git a/setup/lang/phpgw_pt-br.lang b/setup/lang/egw_pt-br.lang similarity index 100% rename from setup/lang/phpgw_pt-br.lang rename to setup/lang/egw_pt-br.lang diff --git a/setup/lang/phpgw_pt.lang b/setup/lang/egw_pt.lang similarity index 100% rename from setup/lang/phpgw_pt.lang rename to setup/lang/egw_pt.lang diff --git a/setup/lang/phpgw_ru.lang b/setup/lang/egw_ru.lang similarity index 100% rename from setup/lang/phpgw_ru.lang rename to setup/lang/egw_ru.lang diff --git a/setup/lang/phpgw_sk.lang b/setup/lang/egw_sk.lang similarity index 100% rename from setup/lang/phpgw_sk.lang rename to setup/lang/egw_sk.lang diff --git a/setup/lang/phpgw_sl.lang b/setup/lang/egw_sl.lang similarity index 100% rename from setup/lang/phpgw_sl.lang rename to setup/lang/egw_sl.lang diff --git a/setup/lang/phpgw_sv.lang b/setup/lang/egw_sv.lang similarity index 100% rename from setup/lang/phpgw_sv.lang rename to setup/lang/egw_sv.lang diff --git a/setup/lang/phpgw_zh-tw.lang b/setup/lang/egw_zh-tw.lang similarity index 100% rename from setup/lang/phpgw_zh-tw.lang rename to setup/lang/egw_zh-tw.lang diff --git a/setup/lang/phpgw_zh.lang b/setup/lang/egw_zh.lang similarity index 100% rename from setup/lang/phpgw_zh.lang rename to setup/lang/egw_zh.lang