Perhaps we could select the presentation without affecting the DB
schema at all, and with minimal refactoring of queries, by using HTML
and CSS language selection mechanisms?
E.g.
1. use xml:lang in the xml config for alternate texts
<subject id ="3">
<description xml:lang="en" "voting age population">
<description xml:lang="x-piglatin" "oting-vay age-ay opulation-pay">
</subject>
2. use the existing DB schema; capture the alternate languages within
the cell value, e.g using xhtml spans:
INSERT INTO notreallysubjects VALUES (3,'<span xml:lang="en">voting
age population</span><span xml:lang="x-piglatin">oting-vay age-ay
opulation-pay")
3. generate a CSS file based on the user's language selection, use
CSS to filter presentation based on preferred language. E.g., if
user's locale selected "x-piglatin", CSS would include:
span:lang(en)
{
display:none;
}
if the admin default were english, and the user had not selected an
alternative, the css would include:
span:lang(x-piglatin)
{
display:none;
}
Alternately, if one was willing to make minor adjustments to the
queries/table structure one could use XML or ARRAY types to store the
alternate language texts, without introducing additional tables, joins
or columns.
e.g.
2'
INSERT INTO notreallysubjects VALUES (3, ARRAY[['en', 'voting age
population'], ['x-piglatin', 'oting-vay age-ay opulation-pay']])
These just occurred to me, so there are probably problems to these
approaches that you may already know.
But just thinking about various points other than the DB schema at
which this could be handled, since JS, CSS, Postgres data structures.