Skip to content

gettext: switch to binary catalogs#13967

Merged
Frenzie merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/gettext_binary_catalogs
Jun 21, 2025
Merged

gettext: switch to binary catalogs#13967
Frenzie merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/gettext_binary_catalogs

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Jun 19, 2025

Copy link
Copy Markdown
Member

Binary catalogs are more space efficient (total translations disk usage: 14MB instead of 35MB), and easier and faster (roughly 10 times) to load: no parsing, and less processing (no need to unescape strings).

Not much difference on the Android APK size (a ~600KB reduction), but other TAR.GZ / ZIP distributions see a reduction of ~3.5MB.


This change is Reviewable

@Frenzie

Frenzie commented Jun 20, 2025

Copy link
Copy Markdown
Member

I suppose that's okay, but of course it does remove the user's ability to (easily) edit translations to see what happens.

@benoit-pierre

Copy link
Copy Markdown
Member Author

It depends on the workflow, e.g. when using poedit the binary catalog is automatically generated/updated on save. I don't think anybody was really editing po files directly on targets like a Kindle or Kobo.

@benoit-pierre benoit-pierre force-pushed the pr/gettext_binary_catalogs branch from 0c2b89e to a2c5d39 Compare June 21, 2025 13:50
@benoit-pierre benoit-pierre marked this pull request as ready for review June 21, 2025 14:03
@benoit-pierre benoit-pierre requested a review from Frenzie as a code owner June 21, 2025 14:03
Comment thread make/gettext.mk Outdated
Comment thread spec/unit/gettext_spec.lua
Binary catalogs are more space efficient (total translations disk usage:
14MB instead of 35MB), and easier and faster (roughly 10 times) to load:
no parsing, and less processing (no need to unescape strings).

Not much difference on the Android APK size (a ~600KB reduction), but
other TAR.GZ / ZIP distributions see a reduction of ~3.5MB.
Make sure we don't include some gettext tests leftovers.
@benoit-pierre benoit-pierre force-pushed the pr/gettext_binary_catalogs branch from a2c5d39 to 3ef7c3d Compare June 21, 2025 15:09
@Frenzie Frenzie added this to the 2025.06 milestone Jun 21, 2025
@Frenzie Frenzie merged commit c456d18 into koreader:master Jun 21, 2025
4 checks passed
@benoit-pierre benoit-pierre deleted the pr/gettext_binary_catalogs branch June 24, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants