Language files clean-up

From Dokeos

Jump to: navigation, search

What is it?

As for now, there are around 40 translations of Dokeos in claroline/lang. The lang directory takes around 5MB, whereas the rest of the Dokeos system takes around 6MB (in CVS currently with all add-ons). This is a big overhead, which is not useless anyway. By cleaning up the language files, the gain would be substantial.

How to do it?

Let's have a quick look at, for example, lang/spanish/work.inc.php... The file is 68 lines long, it says. Now there is this big license file... If I only take the license terms (not the multiple authors and translators or the CVS tag) I have 25 lines.

4293 Bytes = Size of file with those 25 lines
2821 Bytes = Size of file without
1472 Bytes = Gain
OK, not a big deal. Note that the gain is stated as absolute, not relative to the initial file size...

Those 25 lines are repeated throughout the different files for the different translations... I see 38 files in the spanish translation...

1472 x 38 = 55936 Bytes

Now there is approximately 40 translations...

55936 x 40 = 2237440 Bytes = 2MB!!!

So, out of 5MB of translations, 2/5 are only license terms. This doesn't only affect the size, but also the parsing time.

The solution: Dokeos Language Translation Tool

Patrick Cool has created a Dokeos Language Translation tool that allows online language translation. This tool will also solve the problem mentioned above. more information: Translate Dokeos

Personal tools