← Back to team overview

ubuntu-phone team mailing list archive

Re: Internationalizing app metadata

 

On Wed, Apr 16, 2014 at 10:05 PM, Rodney Dawes
<rodney.dawes@xxxxxxxxxxxxx> wrote:
> On Wed, 2014-04-16 at 11:40 +0800, James Henstridge wrote:
>> On Wed, Apr 16, 2014 at 6:14 AM, Rodney Dawes
>> <rodney.dawes@xxxxxxxxxxxxx> wrote:
>> >> 2) Would inline translations have any effect on the image size
>> >> compared to having the translations in a .mo? (More specifically for
>> >> the description bits as the question re: Names was already answered in
>> >> the other thread)
>> >
>> > Virtually no. As plain text, the .desktop file will compress extremely
>> > well, unlike the .mo files. There may be a slight increase of a few
>> > bytes, for a few apps, but I don't see it causing any issue with image
>> > size.
>>
>> I'm curious about this.  While .mo message catalogues are a binary
>> fortmat, I would have thought the majority of their content would be
>> text (the english and translated versions of each string).  I would
>> have thought these would compress to a similar degree as plain text.
>
> While the string portions of the .mo files will compress fairly well,
> the rest of the file does not. It is still a binary file. There is a
> fair bit of extra metadata in the .mo itself, and in the strings
> section, which is not necessary to have in the .desktop files, as well.
>
> What I really meant is that the packages that contain the .desktop files
> will see only a small few bytes in change. The installed size will be a
> little larger than that, but still not big enough that it should have a
> real impact on the default image size, I don't think.

My understanding that the extra metadata is just a pair of tables
holding indexes for the strings, and a hash table.  Even if those
portions don't compress well, the rest of the file should, and I'd
expect that to be the larger portion.

But separate to that, if the application is already using gettext for
translation, the marginal cost of adding one or two extra strings to
the catalogue is going to be peanuts, since the catalogue will be on
disk anyway.  If the app doesn't use gettext itself, then I agree that
having a catalogue purely to translate the .desktop file is a bit over
the top.

James.


References