Index: openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql	10 Jul 2002 11:57:19 -0000	1.2
+++ openacs-4/packages/acs-lang/sql/oracle/message-catalog.sql	7 Oct 2002 14:32:42 -0000	1.3
@@ -1,20 +1,40 @@
 --
--- packages/acs-i18n/sql/language-create.sql
+-- packages/gp-lang/sql/language-create.sql
 --
--- @author Jeff Davis (davis@xarg.net)
+-- @author Jeff Davis (davis@arsdigita.com)
+-- @author Bruno Mattarollo (bruno.mattarollo@ams.greenpeace.org)
+--
 -- @creation-date 2000-09-10
 -- @cvs-id $Id$
 --
 
+create table lang_keys (
+    key                varchar2(200),
+    package_key        varchar2(100)
+                       constraint lang_keys_pk_fk
+                       references apm_package_types (package_key)
+);
+
 create table lang_messages (    
-        key     	varchar2(200),
-	lang		char(2) not null,
-        message         clob,
-        registered_p    char(1)
-                        constraint lm_tranlated_p_tf check(registered_p in ('t','f')),
-        constraint lang_messages_pk primary key (key, lang)
+    key                    varchar2(200)
+                           constraint lang_messages_key_fk
+                           references lang_keys(key),
+    locale                 varchar2(30) 
+                           constraint lang_messages_locale_fk
+                           references ad_locales(locale)
+                           constraint lang_messages_locale_nn
+                           not null,
+    message                clob,
+    registered_p           char(1)
+                           constraint lm_tranlated_p_ck check(registered_p in ('t','f')),
+    constraint lang_messages_pk primary key (key, locale)
 );
 
+comment on table lang_messages is '
+    Holds all the messages translated. The key is the way to get to a message.
+    This table should be read at boot time -from ACS- to load all the messages
+    into an nsv_array.
+';
 
 -- ****************************************************************************
 -- * The lang_translate_columns table holds the columns that require translation.
@@ -23,26 +43,27 @@
 -- ****************************************************************************
 
 create table lang_translate_columns (   
-        column_id               integer primary key,
+        column_id integer 
+	    constraint ltc_column_id_pk primary key,
         -- cant do references on user_tables cause oracle sucks
-        on_which_table          varchar2(50),
-        on_what_column          varchar2(50),
+        on_which_table varchar2(50),
+        on_what_column varchar2(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              char(1)
-                                constraint ltc_required_p_tf check(required_p in ('t','f')),
+        required_p char(1)
+            constraint ltc_required_p_ck check(required_p in ('t','f')),
         --
         -- 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                 char(1)
-                                constraint ltc_short_p_tf check(short_p in ('t','f')),
-        constraint  ltc_u unique (on_which_table, on_what_column)
+        short_p char(1)
+            constraint ltc_short_p_ck check(short_p in ('t','f')),
+        constraint ltc_un unique (on_which_table, on_what_column)
 );
 
 
@@ -53,16 +74,15 @@
 -- ****************************************************************************
 
 create table lang_translation_registry (
-	on_which_table		varchar(50),
-	on_what_id		integer not null,
-        locale                  constraint ltr_locale_ref
-                                references ad_locales(locale),
+	on_which_table varchar(50),
+	on_what_id integer 
+	    constraint ltr_on_what_id_nn not null,
+        locale varchar2(30)
+	    constraint ltr_locale_fk
+            references ad_locales(locale),
         --
         -- should have dependency info here
         --
         constraint lang_translation_registry_pk primary key(on_what_id, on_which_table, locale)
 );
 
-
-
-
