From 9bea26010cfcf241ec0383a2e3217b2f1cd3c8ad Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 4 Nov 2006 12:23:37 +1300 Subject: [PATCH] Initial database framework for identifying supported locales. --- dba/base-data.sql | 10 ++++++++++ dba/patches/1.1.4.sql | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 dba/patches/1.1.4.sql diff --git a/dba/base-data.sql b/dba/base-data.sql index 046a3737..1259b3a8 100644 --- a/dba/base-data.sql +++ b/dba/base-data.sql @@ -31,3 +31,13 @@ INSERT INTO relationship_type ( rt_id, rt_name, rt_isgroup, confers, prefix_matc -- Set the insert sequence to the next number, with a minimum of 1000 SELECT setval('relationship_type_rt_id_seq', (SELECT 10 UNION SELECT rt_id FROM relationship_type ORDER BY 1 DESC LIMIT 1) ); + +-- I should be able to find people to translate into these base locales +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'en', 'English', 'English' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'de', 'German', 'Deutsch' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'es', 'Spanish', 'Español' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'fr', 'French', 'Français' ); diff --git a/dba/patches/1.1.4.sql b/dba/patches/1.1.4.sql new file mode 100644 index 00000000..daae1f90 --- /dev/null +++ b/dba/patches/1.1.4.sql @@ -0,0 +1,33 @@ + +-- Starting to add internationalisation support + +BEGIN; +SELECT check_db_revision(1,1,3); + +CREATE TABLE supported_locales ( + locale TEXT PRIMARY KEY, + locale_name_en TEXT, + locale_name_locale TEXT +); +GRANT SELECT ON + supported_locales + TO general; + + +ALTER TABLE usr ADD COLUMN locale TEXT; + +-- I should be able to find people to translate into these base locales +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'en', 'English', 'English' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'de', 'German', 'Deutsch' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'es', 'Spanish', 'Español' ); +INSERT INTO supported_locales ( locale, locale_name_en, locale_name_locale ) + VALUES( 'fr', 'French', 'Français' ); + +SELECT new_db_revision(1,1,4, 'April' ); + +COMMIT; +ROLLBACK; +