[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] No way to get the total number of translated+untranslated
[bug-gettext] No way to get the total number of translated+untranslated strings
Tue, 25 Feb 2014 17:50:23 +0000
I'm one of the original authors of AppStream specification and a
long-time GNOME developer. One feature requested often is to be able
to show the percentage translation of an application in the current
users language, e.g when running gnome-software in "de" locale, I'd
get "Translation amount: 98% complete" and when running in "en_GB" I'd
get "Translation amount: 75% complete". Applications would also get an
extra "star" in the details page if the software is available in their
I tried to get this information from msgunfmt (or even from looking at
the gmo binary form itself) but it seems the gmo only contains the
translated strings, and no total number of strings. I wondered if this
was an oversight, or a deliberate design choice, and if the former if
the gmo binary format could be extended with one extra uint32 at the
end of the header with the total number of messages in. This could be
done I *think* without bumping the revision as the hash and table data
seem to be offset into the file and any extra header data should be
ignored. I don't know if bumping the revision is something that would
remove backwards compatibility and something you'd consider.
If this is something that seems acceptable, I'm willing to work on a
patch, but I thought I should ask here in case I've missed something
or if the feature isn't something you want to support in gmo files.
Of course the alternative is I get all the applications that want to
show in the software center run a specific command at build time to
parse the .po files and generate a percentage for each locale, but
that might be hard to get all upstreams to do, and it certainly seems
a shame to re-parse the .po files when gettext has already done it and
put it in a nice binary form.
Ideas welcome, thanks.
- [bug-gettext] No way to get the total number of translated+untranslated strings,
Richard Hughes <=