summaryrefslogtreecommitdiff
path: root/modules/locale
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-06-08 12:51:59 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-06-08 12:51:59 +0000
commit57c9a13e1f0ed4e8492467bda817b3385be33225 (patch)
treecad6dffe20ee380f923a1a78b38248420393f332 /modules/locale
parent9e0da3dc7c39786bf6d972e07819fe2880cdeaa3 (diff)
downloadbrdo-57c9a13e1f0ed4e8492467bda817b3385be33225.tar.gz
brdo-57c9a13e1f0ed4e8492467bda817b3385be33225.tar.bz2
#118026 by kkaefer with fixes from myself: JavaScript translation support and script.js as a default theme JS file to use, if found
Diffstat (limited to 'modules/locale')
-rw-r--r--modules/locale/locale.install19
-rw-r--r--modules/locale/locale.schema21
2 files changed, 29 insertions, 11 deletions
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 1d87d6ccc..309e9d57f 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -12,7 +12,7 @@ function locale_install() {
// Create tables.
drupal_install_schema('locale');
- db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight) VALUES ('en', 'English', 'English', '0', '1', '0')");
+ db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight, javascript) VALUES ('en', 'English', 'English', '0', '1', '0', '')");
}
/**
@@ -92,6 +92,15 @@ function locale_update_6002() {
}
/**
+ * Adds a column to store the filename of the JavaScript translation file.
+ */
+function locale_update_6003() {
+ $ret = array();
+ db_add_field($rest, 'languages', 'javascript', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-5.x-to-6.x"
*/
@@ -99,6 +108,14 @@ function locale_update_6002() {
* Implementation of hook_uninstall().
*/
function locale_uninstall() {
+ // Delete all JavaScript translation files
+ $files = db_query('SELECT javascript FROM {languages}');
+ while ($file = db_fetch_object($files)) {
+ if (!empty($file)) {
+ file_delete(file_create_path($file->javascript));
+ }
+ }
+
// Remove tables.
drupal_uninstall_schema('locale');
}
diff --git a/modules/locale/locale.schema b/modules/locale/locale.schema
index f949c7878..6973aeead 100644
--- a/modules/locale/locale.schema
+++ b/modules/locale/locale.schema
@@ -4,16 +4,17 @@
function locale_schema() {
$schema['languages'] = array(
'fields' => array(
- 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
- 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
- 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
- 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
+ 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
+ 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
+ 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
+ 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'javascript' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
),
'primary key' => array('language'),
);