summaryrefslogtreecommitdiff
path: root/modules/locale/locale.install
diff options
context:
space:
mode:
Diffstat (limited to 'modules/locale/locale.install')
-rw-r--r--modules/locale/locale.install19
1 files changed, 18 insertions, 1 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');
}