[open-ils-commits] r10152 - in trunk/Open-ILS: src/sql/Pg
web/conify/global web/js/dojo/openils/widget
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jul 27 12:45:54 EDT 2008
Author: miker
Date: 2008-07-27 12:45:47 -0400 (Sun, 27 Jul 2008)
New Revision: 10152
Modified:
trunk/Open-ILS/src/sql/Pg/002.functions.config.sql
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/web/conify/global/admin.js
trunk/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js
Log:
removing overly agressive locale normalization
Modified: trunk/Open-ILS/src/sql/Pg/002.functions.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.functions.config.sql 2008-07-27 15:47:06 UTC (rev 10151)
+++ trunk/Open-ILS/src/sql/Pg/002.functions.config.sql 2008-07-27 16:45:47 UTC (rev 10152)
@@ -68,8 +68,8 @@
CREATE OR REPLACE FUNCTION oils_i18n_xlate ( keytable TEXT, keyclass TEXT, keycol TEXT, identcol TEXT, keyvalue TEXT, raw_locale TEXT ) RETURNS TEXT AS $func$
DECLARE
- locale TEXT := LOWER( REGEXP_REPLACE( REGEXP_REPLACE( raw_locale, E'[;, ].+$', '' ), E'-', '_', 'g' ) );
- language TEXT := REGEXP_REPLACE( locale, E'_.+$', '' );
+ locale TEXT := REGEXP_REPLACE( REGEXP_REPLACE( raw_locale, E'[;, ].+$', '' ), E'_', '-', 'g' );
+ language TEXT := REGEXP_REPLACE( locale, E'-.+$', '' );
result config.i18n_core%ROWTYPE;
fallback TEXT;
keyfield TEXT := keyclass || '.' || keycol;
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-07-27 15:47:06 UTC (rev 10151)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-07-27 16:45:47 UTC (rev 10152)
@@ -446,7 +446,7 @@
CREATE TABLE config.i18n_locale (
code TEXT PRIMARY KEY,
- marc_code TEXT NOT NULL REFERENCES config.language_map (code),
+ marc_code TEXT NOT NULL REFERENCES config.language_map (code) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
name TEXT UNIQUE NOT NULL,
description TEXT
);
@@ -455,7 +455,7 @@
id BIGSERIAL PRIMARY KEY,
fq_field TEXT NOT NULL,
identity_value TEXT NOT NULL,
- translation TEXT NOT NULL REFERENCES config.i18n_locale (code),
+ translation TEXT NOT NULL REFERENCES config.i18n_locale (code) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
string TEXT NOT NULL
);
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2008-07-27 15:47:06 UTC (rev 10151)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2008-07-27 16:45:47 UTC (rev 10152)
@@ -695,15 +695,15 @@
-- available locales
INSERT INTO config.i18n_locale (code,marc_code,name,description)
- VALUES ('en_us','eng',oils_i18n_gettext('American English'),oils_i18n_gettext('American English'));
+ VALUES ('en-US','eng',oils_i18n_gettext('American English'),oils_i18n_gettext('American English'));
INSERT INTO config.i18n_locale (code,marc_code,name,description)
- VALUES ('en_ca','eng',oils_i18n_gettext('Canadian English'),oils_i18n_gettext('Canadian English'));
+ VALUES ('en-CA','eng',oils_i18n_gettext('Canadian English'),oils_i18n_gettext('Canadian English'));
INSERT INTO config.i18n_locale (code,marc_code,name,description)
- VALUES ('fr_ca','fre',oils_i18n_gettext('Canadian Fench'),oils_i18n_gettext('Canadian French'));
+ VALUES ('fr-CA','fre',oils_i18n_gettext('Canadian Fench'),oils_i18n_gettext('Canadian French'));
INSERT INTO config.i18n_locale (code,marc_code,name,description)
- VALUES ('es_us','spa',oils_i18n_gettext('American Spanish'),oils_i18n_gettext('American Spanish'));
+ VALUES ('es-US','spa',oils_i18n_gettext('American Spanish'),oils_i18n_gettext('American Spanish'));
INSERT INTO config.i18n_locale (code,marc_code,name,description)
- VALUES ('es_mx','spa',oils_i18n_gettext('Mexican Spanish'),oils_i18n_gettext('Mexican Spanish'));
+ VALUES ('es-MX','spa',oils_i18n_gettext('Mexican Spanish'),oils_i18n_gettext('Mexican Spanish'));
--005.schema.actors.sql:
Modified: trunk/Open-ILS/web/conify/global/admin.js
===================================================================
--- trunk/Open-ILS/web/conify/global/admin.js 2008-07-27 15:47:06 UTC (rev 10151)
+++ trunk/Open-ILS/web/conify/global/admin.js 2008-07-27 16:45:47 UTC (rev 10152)
@@ -1,7 +1,7 @@
var djConfig = { parseOnLoad : true };
if (location.href.match(/^.*conify\/(.+)\/global.*$/, "$1")) {
- var _url_locale = location.href.replace(/^.*conify\/(.+)\/global.*$/, "$1").toLowerCase().replace(/_/,'-','g');
+ var _url_locale = location.href.replace(/^.*conify\/(.+)\/global.*$/, "$1").replace(/_/,'-','g');
if (_url_locale) djConfig.locale = _url_locale;
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js 2008-07-27 15:47:06 UTC (rev 10151)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/TranslatorPopup.js 2008-07-27 16:45:47 UTC (rev 10152)
@@ -102,11 +102,11 @@
{ store:openils.I18N.localeStore,
searchAttr:'locale',
labelAttr:'label',
- lowercase:true,
+ lowercase:false,
required:true,
id:'locale_' + trans_id,
value: trans_obj.translation(),
- invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
+ invalidMessage:'Specify locale as {languageCode}-{countryCode}, as in en-US',
regExp:'[a-z_]+'
}
);
@@ -147,9 +147,9 @@
searchAttr:'locale',
labelAttr:'label',
id:'i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique,
- lowercase:true,
+ lowercase:false,
required:true,
- invalidMessage:'Specify locale as {languageCode}_{countryCode}, like en_us',
+ invalidMessage:'Specify locale as {languageCode}_{countryCode}, as in en-US',
regExp:'[a-z_]+'
}
);
More information about the open-ils-commits
mailing list