A possible technical approach to internationalization

2 views
Skip to first unread message

Dr. Micah Altman

unread,
Dec 7, 2011, 11:35:22 AM12/7/11
to districtb...@googlegroups.com
From our conversation today I take it that the main technical barrier
to true internationalization is the refactoring of the DB schema that
would be necessary for all of the label values stored.

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.

David Zwarg

unread,
Dec 9, 2011, 10:24:52 AM12/9/11
to districtb...@googlegroups.com
Hi Micah,

Thanks for the suggestion, we'll investigate some of these techniques.

David
--
David Zwarg, Software Developer

Azavea  |  One Cambridge Center, 6th Floor, Cambridge, MA 02142-1601
dzw...@azavea.com  | T 617.649.2227  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs
Reply all
Reply to author
Forward
0 new messages