Index: openacs-4/packages/acs-lang/sql/postgresql/acs-lang-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/acs-lang-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/acs-lang-create.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,21 @@ +-- Data model to support i18n of the ArsDigita Community +-- System + +-- Copyright (C) 1999-2000 ArsDigita Corporation +-- Author: Henry Minsky (hqm@arsdigita.com) + +-- $Id: acs-lang-create.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License. Full text of the license is available from the GNU Project: +-- http://www.fsf.org/copyleft/gpl.html + +-- prompt ** Creating locales table ... +\i ad-locales.sql + +-- prompt ** Creating translation catalog tables ... +\i message-catalog.sql + +-- prompt ** Creatng currency codes +\i currency.sql + Index: openacs-4/packages/acs-lang/sql/postgresql/ad-locales-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/ad-locales-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/ad-locales-drop.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,17 @@ +-- +-- packages/language/sql/language-create.sql +-- +-- @author Jeff Davis (davis@arsdigita.com) +-- @creation-date 2000-09-10 +-- @cvs-id $Id: ad-locales-drop.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ +-- + +-- **************************************************************************** +-- * The lang_messages table holds the message catalog. +-- * It is populated by ad_lang_message_register. +-- * The registered_p flag denotes that a message exists in a file +-- * that gets loaded on server startup, and hence should not get updated. +-- **************************************************************************** + +drop table ad_locales; + Index: openacs-4/packages/acs-lang/sql/postgresql/ad-locales.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/ad-locales.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/ad-locales.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,98 @@ +-- +-- packages/language/sql/language-create.sql +-- +-- @author Jeff Davis (davis@arsdigita.com) +-- @creation-date 2000-09-10 +-- @cvs-id $Id: ad-locales.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ +-- + +-- **************************************************************************** +-- * The lang_messages table holds the message catalog. +-- * It is populated by ad_lang_message_register. +-- * The registered_p flag denotes that a message exists in a file +-- * that gets loaded on server startup, and hence should not get updated. +-- **************************************************************************** + +begin; + +create table ad_locales ( + locale varchar(30) + constraint ad_locale_abbrev_pk + primary key, + language char(2) constraint ad_language_name_nil + not null, + country char(2) constraint ad_country_name_nil + not null, + variant varchar(30), + label varchar(200) + constraint ad_locale_name_nil + not null + constraint ad_locale_name_unq + unique, + nls_language varchar(30) + constraint ad_locale_nls_lang_nil + not null, + nls_territory varchar(30), + nls_charset varchar(30), + mime_charset varchar(30), + -- is this the default locale for its language + default_p boolean default 'f' +); + +comment on table ad_locales is ' + An OpenACS locale is identified by a language and country. + Locale definitions in Oracle consist of a language, and optionally + territory and character set. (Languages are associated with default + territories and character sets when not defined). The formats + for numbers, currency, dates, etc. are determined by the territory. + language is two letter abbrev is ISO 639 language code + country is two letter abbrev is ISO 3166 country code + mime_charset is IANA charset name + nls_charset is Oracle charset name +'; + +insert into ad_locales ( + locale, label, language, country, + nls_language, nls_territory, nls_charset, mime_charset, default_p +) values ( + 'en_US', 'American', 'en', 'US', + 'AMERICAN', 'AMERICA', 'WE8ISO8859P1', 'ISO-8859-1', 't' +); + + +insert into ad_locales ( + locale, label, language, country, + nls_language, nls_territory, nls_charset, mime_charset, default_p +) values ( + 'de_DE', 'German', 'de', 'DE', + 'GERMAN', 'GERMANY', 'WE8ISO8859P1', 'ISO-8859-1', 't' +); + + +insert into ad_locales ( + locale, label, language, country, + nls_language, nls_territory, nls_charset, mime_charset, default_p +) values ( + 'es_ES', 'Spain', 'es', 'ES', + 'SPANISH', 'SPAIN', 'WE8ISO8859P1', 'ISO-8859-1', 't' +); + + +insert into ad_locales ( + locale, label, language, country, + nls_language, nls_territory, nls_charset, mime_charset, default_p +) values ( + 'fr_FR', 'French', 'fr', 'FR', + 'FRENCH', 'France', 'WE8ISO8859P1', 'ISO-8859-1', 't' +); + + +insert into ad_locales ( + locale, label, language, country, + nls_language, nls_territory, nls_charset, mime_charset, default_p +) values ( + 'ja_JP', 'Japanese', 'ja', 'JP', + 'JAPANESE', 'JAPAN', 'JA16SJIS', 'Shift_JIS', 't' +); + +end; Index: openacs-4/packages/acs-lang/sql/postgresql/currency.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/Attic/currency.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/currency.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,147 @@ +-- +-- packages/language/sql/language-create.sql +-- +-- @author Jeff Davis (davis@arsdigita.com) +-- @creation-date 2000-09-10 +-- @cvs-id $Id: currency.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ +-- + +-- **************************************************************************** +-- * Currency codes table is created as part of the core. +-- * But not yet defined in ACS 4.0 +-- **************************************************************************** + +begin; + +create table currency_codes ( + iso char(3) constraint currency_iso_pk primary key, + currency_name varchar(200), + html_entity varchar(200), + fractional_digits integer, + supported_p boolean default 'f' +); + +insert into currency_codes (iso, currency_name) values ('ZAR', 'South African Rand'); +insert into currency_codes (iso, currency_name) values ('VEB', 'Venezualan Bolivar'); +insert into currency_codes (iso, currency_name) values ('ISK', 'Iceland Krona'); +insert into currency_codes (iso, currency_name) values ('CSK', 'Czech Koruna'); +insert into currency_codes (iso, currency_name) values ('CLP', 'Chilean Peso'); +insert into currency_codes (iso, currency_name) values ('ARP', 'Argentinian Peso'); +insert into currency_codes (iso, currency_name) values ('USD', 'United States Dollar'); +insert into currency_codes (iso, currency_name) values ('PHP', 'Philippine Peso'); +insert into currency_codes (iso, currency_name) values ('NZD', 'New Zealand Dollar'); +insert into currency_codes (iso, currency_name) values ('MXP', 'Mexican Peso'); +insert into currency_codes (iso, currency_name) values ('LUF', 'Luxembourg Franc'); +insert into currency_codes (iso, currency_name) values ('INR', 'Indian Rupee'); +insert into currency_codes (iso, currency_name) values ('IEP', 'Irish Punt'); +insert into currency_codes (iso, currency_name) values ('GBP', 'British Pound'); +insert into currency_codes (iso, currency_name) values ('FRF', 'French Franc'); +insert into currency_codes (iso, currency_name) values ('EUR', 'Euro'); +insert into currency_codes (iso, currency_name) values ('ESP', 'Spanish Peseta'); +insert into currency_codes (iso, currency_name) values ('DKK', 'Danish Krone'); +insert into currency_codes (iso, currency_name) values ('DEM', 'Deutsche Mark'); +insert into currency_codes (iso, currency_name) values ('CHF', 'Swiss Franc'); +insert into currency_codes (iso, currency_name) values ('CAD', 'Canadian Dollar'); +insert into currency_codes (iso, currency_name) values ('BRR', 'Brazilian Real'); +insert into currency_codes (iso, currency_name) values ('BEF', 'Belgian Franc'); +insert into currency_codes (iso, currency_name) values ('AUD', 'Australian Dollar'); +insert into currency_codes (iso, currency_name) values ('ATS', 'Austrian Schilling'); + +-- +-- Set up the list of "valid currencies" as a smaller more sane list. +-- +update currency_codes set supported_p = 'f'; + +update currency_codes set supported_p = 't' where iso in ('ATS','AUD', + 'BEF','BRR','CAD','CHF','DEM','DKK','ESP','EUR','FRF','GBP', + 'IEP','INR','LUF','MXP','NZD','PHP','USD','ARP','CLP','CSK', + 'ISK','VEB','ZAR'); + + +-- +-- Currency entities. +-- +-- set define off; + +-- taken from http://www.askphil.org/auct03.htm +update currency_codes set html_entity = 'ÖSch', + fractional_digits = '2' + where iso = 'ATS'; +update currency_codes set html_entity = '$A', + fractional_digits = '2' + where iso = 'AUD'; +update currency_codes set html_entity = 'BFr', + fractional_digits = '2' + where iso = 'BEF'; +update currency_codes set html_entity = 'R', + fractional_digits = '2' + where iso = 'BRR'; +update currency_codes set html_entity = '$C', + fractional_digits = '2' + where iso = 'CAD'; +update currency_codes set html_entity = 'SFr', + fractional_digits = '2' + where iso = 'CHF'; +update currency_codes set html_entity = 'DM', + fractional_digits = '2' + where iso = 'DEM'; +update currency_codes set html_entity = 'DKr', + fractional_digits = '2' + where iso = 'DKK'; +update currency_codes set html_entity = 'Pta', + fractional_digits = '0' + where iso = 'ESP'; +update currency_codes set html_entity = '€', + fractional_digits = '2' + where iso = 'EUR'; +update currency_codes set html_entity = 'FFr', + fractional_digits = '2' + where iso = 'FRF'; +update currency_codes set html_entity = '£', + fractional_digits = '2' + where iso = 'GBP'; +update currency_codes set html_entity = 'P', + fractional_digits = '2' + where iso = 'IEP'; +update currency_codes set html_entity = 'R', + fractional_digits = '2' + where iso = 'INR'; +update currency_codes set html_entity = 'LFr', + fractional_digits = '2' + where iso = 'LUF'; +update currency_codes set html_entity = 'P', + fractional_digits = '0' + where iso = 'MXP'; +update currency_codes set html_entity = '$NZ', + fractional_digits = '2' + where iso = 'NZD'; +update currency_codes set html_entity = 'P', + fractional_digits = '2' + where iso = 'PHP'; +update currency_codes set html_entity = '$', + fractional_digits = '2' + where iso = 'USD'; +update currency_codes set html_entity = '€', + fractional_digits = '2' + where iso = 'EUR'; +update currency_codes set html_entity = 'P', + fractional_digits = '2' + where iso = 'ARP'; +update currency_codes set html_entity = 'P', + fractional_digits = '2' + where iso = 'CLP'; +update currency_codes set html_entity = 'K', + fractional_digits = '2' + where iso = 'CSK'; +update currency_codes set html_entity = 'IKr', + fractional_digits = '2' + where iso = 'ISK'; +update currency_codes set html_entity = 'Bs', + fractional_digits = '2' + where iso = 'VEB'; +update currency_codes set html_entity = 'R', + fractional_digits = '2' + where iso = 'ZAR'; + +end; + Index: openacs-4/packages/acs-lang/sql/postgresql/message-catalog-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/message-catalog-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/message-catalog-drop.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- packages/language/sql/language-drop.sql +-- +-- @author davis@arsdigita.com +-- @creation-date 2000-09-10 +-- @cvs-id $Id: message-catalog-drop.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ +-- + +-- drop the timezone stuff +drop index tz_data_idx2; +drop index tz_data_idx1; +drop table tz_data; +drop function lc_time_utc_to_local; +drop function lc_time_local_to_utc; + +-- drop the lang stuff +drop table lang_translation_registry; +drop table lang_translate_columns; +drop table lang_messages; + +-- This might fail if the data model includes other multilingual tables +-- that reference ad_locales. Really need to cascade here to ensure +-- it goes away, but that is dangerous. +drop table ad_locales; Index: openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-lang/sql/postgresql/message-catalog.sql 21 Oct 2001 18:51:01 -0000 1.1 @@ -0,0 +1,67 @@ +-- +-- packages/acs-i18n/sql/language-create.sql +-- +-- @author Jeff Davis (davis@arsdigita.com) +-- @creation-date 2000-09-10 +-- @cvs-id $Id: message-catalog.sql,v 1.1 2001/10/21 18:51:01 donb Exp $ +-- + +begin; + +create table lang_messages ( + key varchar(200), + lang char(2) not null, + message text, + registered_p boolean, + constraint lang_messages_pk primary key (key, lang) +); + + +-- **************************************************************************** +-- * The lang_translate_columns table holds the columns that require translation. +-- * It is needed to generate the user interface for translating the web site. +-- * Note that we register on_what_column itself for translation. +-- **************************************************************************** + +create table lang_translate_columns ( + column_id integer primary key, + -- cant do references on user_tables cause oracle sucks + on_which_table varchar(50), + on_what_column varchar(50), + -- + -- whether all entries in a column must be translated for the + -- site to function. + -- + -- probably ultimately need something more sophisticated than + -- simply required_p + -- + required_p boolean, + -- + -- flag for whether to use the lang_translations table for content + -- or add a row in the on_which_table table with the translated content. + -- + short_p boolean, + constraint ltc_u unique (on_which_table, on_what_column) +); + + +-- **************************************************************************** +-- * The lang_translation_registry table identifies a row as requiring translation +-- * to a given language. This should identify the parent table not the broken-apart +-- * child table. +-- **************************************************************************** + +create table lang_translation_registry ( + on_which_table varchar(50), + on_what_id integer not null, + locale varchar(30) constraint ltr_locale_ref + references ad_locales(locale), + -- + -- should have dependency info here + -- + constraint lang_translation_registry_pk primary key(on_what_id, on_which_table, locale) +); + +end; + +