Is there a reason that you did not simply create a string translation table and leverage the existing i18n code? For instance:
create table config.strings (
purpose text primary key, -- store a use case label here
string text not null -- store the en-US version here
);
insert into config.strings (type,string) values ('bool-op-and',' and ');
insert into config.i18n_core (fq_field,identity_value,translation,string) values ('es.string',' and ','fr-CA',' et ');
insert into config.strings (type,string) values ('bool-op-or',' or ');
insert into config.i18n_core (fq_field,identity_value,translation,string) values ('es.string',' or ','fr-CA',' ou ');
insert into config.strings (type,string) values ('bool-op-not',' not ');
insert into config.i18n_core (fq_field,identity_value,translation,string) values ('es.string',' not ','fr-CA',' pas ');
With an appropriately shaped set of seed data. Then, in the IDL:
And in EGCatLoader just go back to setting the _boolean arg to "true".
Then you're not introducing more stored procedures, and a trivally simple UI can be built on top of config.strings -- see basically any admin interface for an example. This would also leverage existing code that is well tested, and we'd get a place to store more general translations.
Sorry if that wasn't clear the other day when you asked privately in IRC for guidance ...
Regardless of the implementation maintenance cost of your current branch, though, the patch is lacking seed data and IDL entries for the new tables, as well as a way to control the translations.
Fredrick,
Is there a reason that you did not simply create a string translation table and leverage the existing i18n code? For instance:
create table config.strings (
purpose text primary key, -- store a use case label here
string text not null -- store the en-US version here
);
insert into config.strings (type,string) values ('bool-op-and',' and '); identity_ value,translati on,string) values ('es.string',' and ','fr-CA',' et ');
insert into config.i18n_core (fq_field,
insert into config.strings (type,string) values ('bool-op-or',' or '); identity_ value,translati on,string) values ('es.string',' or ','fr-CA',' ou ');
insert into config.i18n_core (fq_field,
insert into config.strings (type,string) values ('bool-op-not',' not '); identity_ value,translati on,string) values ('es.string',' not ','fr-CA',' pas ');
insert into config.i18n_core (fq_field,
With an appropriately shaped set of seed data. Then, in the IDL:
<class id="es" controller= "open-ils. cstore" oils_obj: fieldmapper= "config: :strings" reporter: label=" General translations"> primary= "purpose" > label=" Purpose" name="purpose" reporter: datatype= "text"/ > datatype= "text" oils_persist: i18n="true" /> open-ils. org/spec/ opensrf/ IDL/permacrud/ v1">
<actions>
<create permission= "ADMIN_ STRINGS" global_ required= "true"/ >
<retrieve/ >
<update permission= "ADMIN_ STRINGS" global_ required= "true"/ >
<delete permission= "ADMIN_ STRINGS" global_ required= "true"/ >
</ actions>
</permacrud>
<fields oils_persist:
<field reporter:
<field reporter:label="Key String" name="string" reporter:
</fields>
<links/>
<permacrud xmlns="http://
</class>
And then, in metabib.pm, something like:
if ($args{_boolean} eq 'true') { >search_ config_ strings( {purpose => {like => 'bool-op-%'}} ) } ) { >operator( $key => $op->string );
for my $op ( @{ new_editor-
(my $key = $op->purpose) =~ s/^bool-op-//;
$parser-
}
}
And in EGCatLoader just go back to setting the _boolean arg to "true".
Then you're not introducing more stored procedures, and a trivally simple UI can be built on top of config.strings -- see basically any admin interface for an example. This would also leverage existing code that is well tested, and we'd get a place to store more general translations.
Sorry if that wasn't clear the other day when you asked privately in IRC for guidance ...
Regardless of the implementation maintenance cost of your current branch, though, the patch is lacking seed data and IDL entries for the new tables, as well as a way to control the translations.