summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-09-06 12:40:12 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-09-06 12:40:12 +0000
commit55f5bd85ed6759daa9484df7106e70a43d594a89 (patch)
tree84ee7f99736a3a223a3edbd4d30e29f6b8472f2e
parent7c4f8bae8742d25a87d2c550fb163b7bfe5d568a (diff)
downloadbrdo-55f5bd85ed6759daa9484df7106e70a43d594a89.tar.gz
brdo-55f5bd85ed6759daa9484df7106e70a43d594a89.tar.bz2
Fixing problem with locale update for 'en' -> 'en-local' translations. (patch by killes)
-rw-r--r--database/updates.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/database/updates.inc b/database/updates.inc
index 5260d1604..67aca34e1 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1490,7 +1490,7 @@ function update_101() {
// get all strings
$result = db_query('SELECT * FROM {locales}');
- while($entry = db_fetch_object($result)) {
+ while ($entry = db_fetch_object($result)) {
// insert string if at least one translation exists
$test = 'return $entry->'. implode(' == "" && $entry->', array_keys($fields)) .' == "";';
if (!eval($test)) {
@@ -1498,7 +1498,13 @@ function update_101() {
$lid = db_fetch_object(db_query("SELECT lid FROM {locales_source} WHERE location = '%s' AND source = '%s'", $entry->location, $entry->string));
foreach ($fields as $key => $value) {
// insert translation if non-empty
- db_query("INSERT INTO {locales_target} (lid, translation, locale) VALUES (%d, '%s', '%s')", $lid->lid, $entry->$key, $key);
+ if ($key == 'en') {
+ $keynew = 'en-local';
+ }
+ else {
+ $keynew = $key;
+ }
+ db_query("INSERT INTO {locales_target} (lid, translation, locale) VALUES (%d, '%s', '%s')", $lid->lid, $entry->$key, $keynew);
}
}
}