Commit fff45d1f authored by Dries's avatar Dries
Browse files

- Patch #139970 by Gabor: locale cleanup.

parent 2a65f86b
This diff is collapsed.
; $Id$ ; $Id$
name = Locale name = Locale
description = Enables the translation of the user interface to languages other than English. description = Add language handling functionality and enables the translation of the user interface to languages other than English.
package = Core - optional package = Core - optional
version = VERSION version = VERSION
...@@ -28,6 +28,7 @@ function locale_install() { ...@@ -28,6 +28,7 @@ function locale_install() {
db_query("CREATE TABLE {locales_source} ( db_query("CREATE TABLE {locales_source} (
lid int NOT NULL auto_increment, lid int NOT NULL auto_increment,
location varchar(255) NOT NULL default '', location varchar(255) NOT NULL default '',
textgroup varchar(255) NOT NULL default '',
source blob NOT NULL, source blob NOT NULL,
PRIMARY KEY (lid), PRIMARY KEY (lid),
KEY source (source(30)) KEY source (source(30))
...@@ -64,6 +65,7 @@ function locale_install() { ...@@ -64,6 +65,7 @@ function locale_install() {
db_query("CREATE TABLE {locales_source} ( db_query("CREATE TABLE {locales_source} (
lid serial, lid serial,
location varchar(255) NOT NULL default '', location varchar(255) NOT NULL default '',
textgroup varchar(255) NOT NULL default '',
source text NOT NULL, source text NOT NULL,
PRIMARY KEY (lid) PRIMARY KEY (lid)
)"); )");
...@@ -86,11 +88,14 @@ function locale_install() { ...@@ -86,11 +88,14 @@ function locale_install() {
} }
/** /**
* @defgroup updates-5.0-to-x.x Locale updates from 5.0 to x.x * @defgroup updates-5.x-to-6.x Locale updates from 5.x to 6.x
* @{ * @{
*/ */
function locale_update_2001() { /**
* {locales_meta} table became {languages}.
*/
function locale_update_6001() {
$ret = array(); $ret = array();
switch ($GLOBALS['db_type']) { switch ($GLOBALS['db_type']) {
case 'mysql': case 'mysql':
...@@ -142,8 +147,24 @@ function locale_update_2001() { ...@@ -142,8 +147,24 @@ function locale_update_2001() {
} }
/** /**
* @} End of "defgroup updates-5.0-to-x.x" * Add multiple text group support to allow for user defined string translation.
* The next series of updates should start at 3000. */
function locale_update_6002() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_add_column($ret, 'locales_source', 'textgroup', 'varchar(255)', array('default' => "''", 'not null' => TRUE));
break;
case 'pgsql':
$ret[] = update_sql("ALTER TABLE {locales_source} ADD textgroup varchar(255) NOT NULL default ''");
break;
}
return $ret;
}
/**
* @} End of "defgroup updates-5.x-to-6.x"
*/ */
/** /**
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment