Timwi (timwi) wrote in lj_dev,
Timwi
timwi
lj_dev

Translation system problem

The problem

We are currently having a big problem in the translation system. In English you can easily go

1minute
2-∞minutes

The Russians have it a little more complex:

1минута
2-4минуты
5-20минут
21минута
22-24минуты
25-30минут
etc.

Similarly, they have an entirely different system again in Tagalog and possibly other languages.

My idea

My idea is to create a system that allows the translators to enter as many translations as they need for a string that contains a number. We would need:
  • A flag for each translation string to determine if it contains a number or not.
  • A property of each language which states what number system this language uses (see below).
  • Determine how many translations per string containing a number are needed for each such system. Perhaps a hash in langlib?
  • For each such system, create a subroutine that decides which translation string to use for a particular number. Perhaps add subrefs to aforementioned global hash?
  • Enhance the translation editor to display several input boxes to translators wherever appropriate. The database could store these strings in one, separated by some special character, perhaps a pipe (|), so we would have something like:
    [[number]] hour ago|[[number]] hours ago
  • Add the required functionality to BML::ml().
With this, when a new language is added to the mix, all that needs to be done is either assign it an existing number system, or create a new one. That shouldn’t be much work at all.

Please comment whether or not you like this and/or whether you think this is feasible. If this is accepted, I will post it to Zilla and start right working on it.


The number systems I’ve encountered so far are:
  • Chinese, Hungarian: 1 string
  • English, German, French, Spanish, Finnish, etc.etc.etc.: 2 strings (singular and plural)
  • Russian, Belarusian: 3 strings:
    • One for numbers ending in 1 except those ending in 11
    • One for numbers ending in 2-4 except those ending in 12-14
    • One for everything else
  • Polish: 3 strings:
    • One for the 1 only
    • One for numbers ending in 2-4 except those ending in 12-14
    • One for everything else
  • Tagalog: 2 strings: One for numbers ending in 4, 6 or 9, and one for everything else.
  • Irish: 4 strings:
    • One for numbers ending in 1 or 2
    • One for numbers ending in 3, 4, 5, 6
    • One for numbers ending in 7, 8, 9, 10
    • One for everything else
  • I have not received feedback from the translators for Hebrew, Latvian, Malay, and Turkish. Might have to contact them individually.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 16 comments