[TEP-COMMIT] [CVS catalog] move the setlocale logic to the language service module

anonymous-OfajU3CKLf1/[email protected] 14 Apr 2004 23:23:03 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in catalog/catalog on MAIN

includes/languages/english.php +3 -3 1.118 -> 1.119

/espanol.php +3 -3 1.111 -> 1.112

/german.php +3 -3 1.128 -> 1.129

includes/modules/services/debug.php +10 -1 1.1 -> 1.2

/language.php +3 -1 1.1 -> 1.2

install/oscommerce.sql +1 1.93 -> 1.94

install/templates/pages/upgrade_3.php +1 1.67 -> 1.68

+24 -11

7 modified files

move the setlocale logic to the language service module

add a new setlocale debugging parameter

----------

catalog /catalog /includes /languages

english.php 1.118 -> 1.119

diff -u -r1.118 -r1.119
--- english.php 2004/02/16 07:13:19 1.118
+++ english.php 2004/04/14 23:22:52 1.119
@@ -11,12 +11,12 @@

*/

// look in your $PATH_LOCALE/locale directory for available locales

-// or type locale -a on the server.

+// or execute 'locale -a' on the server.

// Examples:

-// on RedHat try 'en_US'

+// on Linux try 'en_US'

// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'

[email protected](LC_TIME, 'en_US.ISO_8859-1');

+define('LANGUAGE_LOCALE', 'en_US');

define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

----------

catalog /catalog /includes /languages

espanol.php 1.111 -> 1.112

diff -u -r1.111 -r1.112
--- espanol.php 2004/02/16 07:13:19 1.111
+++ espanol.php 2004/04/14 23:22:52 1.112
@@ -11,12 +11,12 @@

*/

// look in your $PATH_LOCALE/locale directory for available locales

-// or type locale -a on the server.

+// or execute 'locale -a' on the server.

// Examples:

-// on RedHat try 'es_ES'

+// on Linux try 'es_ES'

// on FreeBSD try 'es_ES.ISO_8859-1'
// on Windows try 'sp', or 'Spanish'

[email protected](LC_TIME, 'es_ES.ISO_8859-1');

+define('LANGUAGE_LOCALE', 'es_ES');

define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

----------

catalog /catalog /includes /languages

german.php 1.128 -> 1.129

diff -u -r1.128 -r1.129
--- german.php 2004/02/16 07:13:19 1.128
+++ german.php 2004/04/14 23:22:53 1.129
@@ -11,12 +11,12 @@

*/

// look in your $PATH_LOCALE/locale directory for available locales

-// or type locale -a on the server.

+// or execute 'locale -a' on the server.

// Examples:

-// on RedHat try 'de_DE'

+// on Linux try 'de_DE'

// on FreeBSD try 'de_DE.ISO_8859-1'
// on Windows try 'de' or 'German'

[email protected](LC_TIME, 'de_DE.ISO_8859-1');

+define('LANGUAGE_LOCALE', 'de_DE');

define('DATE_FORMAT_SHORT', '%d.%m.%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A, %d. %B %Y'); // this is used for strftime()

----------

catalog /catalog /includes /modules /services

debug.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- debug.php 2004/04/13 08:02:18 1.1
+++ debug.php 2004/04/14 23:22:56 1.2
@@ -28,6 +28,14 @@

$messageStack->add('debug', 'This is a development version of osCommerce - please use it for testing purposes only! [' . PROJECT_VERSION . ']');
}

+ if (SERVICE_DEBUG_CHECK_LOCALE == 'True') {
+ $setlocale = setlocale(LC_TIME, LANGUAGE_LOCALE);
+
+ if (($setlocale === false) || ($setlocale === null)) {
+ $messageStack->add('debug', 'Error: Locale does not exist: ' . LANGUAGE_LOCALE . ' [' . __CLASS__ . ']', 'error');
+ }
+ }
+

if ((SERVICE_DEBUG_CHECK_INSTALLATION_MODULE == 'True') && file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/install')) {
$messageStack->add('debug', WARNING_INSTALL_DIRECTORY_EXISTS . ' [' . __CLASS__ . ']', 'warning');
}

@@ -92,6 +100,7 @@

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show The Page Execution Time', 'SERVICE_DEBUG_EXECUTION_DISPLAY', 'True', 'Show the page execution time.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Log Database Queries', 'SERVICE_DEBUG_LOG_DB_QUERIES', 'False', 'Log all database queries in the page execution time log file.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show Development Version Warning', 'SERVICE_DEBUG_SHOW_DEVELOPMENT_WARNING', 'True', 'Show an osCommerce development version warning message.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

+ tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Language Locale', 'SERVICE_DEBUG_CHECK_LOCALE', 'True', 'Show a warning message if the set language locale does not exist on the server.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Installation Module', 'SERVICE_DEBUG_CHECK_INSTALLATION_MODULE', 'True', 'Show a warning message if the installation module exists.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Configuration File', 'SERVICE_DEBUG_CHECK_CONFIGURATION', 'True', 'Show a warning if the configuration file is writeable.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Sessions Directory', 'SERVICE_DEBUG_CHECK_SESSION_DIRECTORY', 'True', 'Show a warning if the file-based session directory does not exist.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

@@ -104,7 +113,7 @@

}

function keys() {

- return array('SERVICE_DEBUG_EXECUTION_TIME_LOG', 'SERVICE_DEBUG_EXECUTION_DISPLAY', 'SERVICE_DEBUG_LOG_DB_QUERIES', 'SERVICE_DEBUG_SHOW_DEVELOPMENT_WARNING', 'SERVICE_DEBUG_CHECK_INSTALLATION_MODULE', 'SERVICE_DEBUG_CHECK_CONFIGURATION', 'SERVICE_DEBUG_CHECK_SESSION_DIRECTORY', 'SERVICE_DEBUG_CHECK_SESSION_AUTOSTART', 'SERVICE_DEBUG_CHECK_DOWNLOAD_DIRECTORY');

+ return array('SERVICE_DEBUG_EXECUTION_TIME_LOG', 'SERVICE_DEBUG_EXECUTION_DISPLAY', 'SERVICE_DEBUG_LOG_DB_QUERIES', 'SERVICE_DEBUG_SHOW_DEVELOPMENT_WARNING', 'SERVICE_DEBUG_CHECK_LOCALE', 'SERVICE_DEBUG_CHECK_INSTALLATION_MODULE', 'SERVICE_DEBUG_CHECK_CONFIGURATION', 'SERVICE_DEBUG_CHECK_SESSION_DIRECTORY', 'SERVICE_DEBUG_CHECK_SESSION_AUTOSTART', 'SERVICE_DEBUG_CHECK_DOWNLOAD_DIRECTORY');

}
}
?>

----------

catalog /catalog /includes /modules /services

language.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- language.php 2004/04/13 08:02:18 1.1
+++ language.php 2004/04/14 23:22:56 1.2
@@ -40,7 +40,9 @@

require('includes/languages/' . $osC_Session->value('language') . '.php');

- header("Content-Type: text/html; charset=" . CHARSET);

+ header('Content-Type: text/html; charset=' . CHARSET);
+
+ setlocale(LC_TIME, LANGUAGE_LOCALE);

return true;
}

----------

catalog /catalog /install

oscommerce.sql 1.93 -> 1.94

diff -u -r1.93 -r1.94
--- oscommerce.sql 2004/04/13 08:13:17 1.93
+++ oscommerce.sql 2004/04/14 23:22:58 1.94
@@ -720,6 +720,7 @@

INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show The Page Execution Time', 'SERVICE_DEBUG_EXECUTION_DISPLAY', 'True', 'Show the page execution time.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Log Database Queries', 'SERVICE_DEBUG_LOG_DB_QUERIES', 'False', 'Log all database queries in the page execution time log file.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Development Version Warning', 'SERVICE_DEBUG_SHOW_DEVELOPMENT_WARNING', 'True', 'Show an osCommerce development version warning message.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

+INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Language Locale', 'SERVICE_DEBUG_CHECK_LOCALE', 'True', 'Show a warning message if the set language locale does not exist on the server.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check Installation Module', 'SERVICE_DEBUG_CHECK_INSTALLATION_MODULE', 'True', 'Show a warning message if the installation module exists.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check Configuration File', 'SERVICE_DEBUG_CHECK_CONFIGURATION', 'True', 'Show a warning if the configuration file is writeable.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
INSERT INTO osc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check Sessions Directory', 'SERVICE_DEBUG_CHECK_SESSION_DIRECTORY', 'True', 'Show a warning if the file-based session directory does not exist.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

----------

catalog /catalog /install /templates /pages

upgrade_3.php 1.67 -> 1.68

diff -u -r1.67 -r1.68
--- upgrade_3.php 2004/04/13 08:13:18 1.67
+++ upgrade_3.php 2004/04/14 23:22:59 1.68
@@ -293,6 +293,7 @@

$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show The Page Execution Time', 'SERVICE_DEBUG_EXECUTION_DISPLAY', 'True', 'Show the page execution time.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Log Database Queries', 'SERVICE_DEBUG_LOG_DB_QUERIES', 'False', 'Log all database queries in the page execution time log file.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show Development Version Warning', 'SERVICE_DEBUG_SHOW_DEVELOPMENT_WARNING', 'True', 'Show an osCommerce development version warning message.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

+ $osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Language Locale', 'SERVICE_DEBUG_CHECK_LOCALE', 'True', 'Show a warning message if the set language locale does not exist on the server.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Installation Module', 'SERVICE_DEBUG_CHECK_INSTALLATION_MODULE', 'True', 'Show a warning message if the installation module exists.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Configuration File', 'SERVICE_DEBUG_CHECK_CONFIGURATION', 'True', 'Show a warning if the configuration file is writeable.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
$osC_Database->simpleQuery("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Check Sessions Directory', 'SERVICE_DEBUG_CHECK_SESSION_DIRECTORY', 'True', 'Show a warning if the file-based session directory does not exist.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

CVSspam 0.2.8

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click