Hello all,

I am currently working on redesigning a database structure for online
translation utility called Entrans [1].
Entrans is quite nice piece of software, but unfortunately it has one
major design flaw: it only supports languages which have only two plural
forms and to fix this issue, a database structure has to be redesigned.

The way Entrans works is simple: it parses the PO-catalogs [2] and inserts
the entries found in the file into the database. The main issue is how do
I store these entries, because there are two different types:
  a) a singular entry
  b) a plural entry
With singular entries it's easy, we following items of data:
  flags
  comments
  msgid
  msgstr

Now, the problem is storing the plural entries, which have four "static"
items, followed by the n > 1 of dynamic entries:
  flags
  comments
  msgid
  msgid_plural
  msgstr[0]
  ...
  msgstr[N]


At first, I tried to do it like this:
  msgid_table:
    id
    msgid

  msgcontext_table:
    id
    msgid_id (FK for msgid_table.id)
    is_fuzzy (flag)
    comments
    file_id  (FK for file_table.id, not presented here...)
    msgid_plural (present if msgid_plural exists)
    plural_count (number of plural forms)

  msgstr_table:
    id
    msgcontext_id (FK for msgcontext_table.id)
    user_suggestion
    index (to which of these msgstr[n] fields it will be put, 0 if string
doesn't have any plural forms)
    is_valid (is it valid translation suggestion)

Now, as you can see, this approach doesn't work at all... because it's
quite a hell designing a query based on msgid_table.id ->
msgcontext_table.mgsid_id -> msgcontext_table.id ->
msgstr_table.msgcontext_id.

 What I'm thinking is that the msgcontext_table.id should be made a
superkey, but this does not help when I need to figure out which of the
suggestions are valid for current msgid.

Your ideas are very welcome ;)

[1] http://entrans.sourceforge.net/
[2] http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html

Best regards,
Priit


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to