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.install14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 7febbba9a..3eac012f3 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -17,7 +17,17 @@ function locale_install() {
// Create tables.
drupal_install_schema('locale');
- db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight, javascript) VALUES ('en', 'English', 'English', '0', '1', '0', '')");
+ db_insert('languages')
+ ->fields(array(
+ 'language' => 'en',
+ 'name' => 'English',
+ 'native' => 'English',
+ 'direction' => 0,
+ 'enabled' => 1,
+ 'weight' => 0,
+ 'javascript' => '',
+ ))
+ ->execute();
}
/**
@@ -217,7 +227,7 @@ function locale_uninstall() {
// Delete all JavaScript translation files.
$locale_js_directory = file_create_path(variable_get('locale_js_directory', 'languages'));
$files = db_query('SELECT language, javascript FROM {languages}');
- while ($file = db_fetch_object($files)) {
+ foreach ($files as $file) {
if (!empty($file->javascript)) {
file_unmanaged_delete(file_create_path($locale_js_directory . '/' . $file->language . '_' . $file->javascript . '.js'));
}