Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
55f5bd85
Commit
55f5bd85
authored
Sep 06, 2004
by
Steven Wittens
Browse files
Fixing problem with locale update for 'en' -> 'en-local' translations. (patch by killes)
parent
7c4f8bae
Changes
1
Hide whitespace changes
Inline
Side-by-side
database/updates.inc
View file @
55f5bd85
...
...
@@ -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
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment