The problem
We are currently having a big problem in the translation system. In English you can easily go1 | minute |
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().
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.