Skip to content

cmake: add CUTTER_ENABLE_TRANSLATIONS option to skip translation build#3640

Merged
PremadeS merged 1 commit into
rizinorg:devfrom
blshkv:feat/translations-cmake-option
Jul 2, 2026
Merged

cmake: add CUTTER_ENABLE_TRANSLATIONS option to skip translation build#3640
PremadeS merged 1 commit into
rizinorg:devfrom
blshkv:feat/translations-cmake-option

Conversation

@blshkv

@blshkv blshkv commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a CMake option CUTTER_ENABLE_TRANSLATIONS (default ON) to cmake/Translations.cmake that allows skipping the translation file build and install step.

Motivation

When building from a GitHub commit/tag archive rather than a full git clone, the .ts source files are not present (they live in the repository but are not included in the archive tarballs). Without this option, CMake fails at install time with:

file INSTALL cannot find ".../translations/cutter_ar_SA.qm": No such file or directory

Passing -DCUTTER_ENABLE_TRANSLATIONS=OFF avoids the issue cleanly without requiring any other changes.

Test plan

  • Build with -DCUTTER_ENABLE_TRANSLATIONS=ON (default) — translations build as before
  • Build with -DCUTTER_ENABLE_TRANSLATIONS=OFF — translation step is skipped, install succeeds

blshkv added a commit to blshkv/pentoo-overlay that referenced this pull request Jul 1, 2026
wargio

This comment was marked as outdated.

@blshkv

blshkv commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

To add some context: this is admittedly a workaround, but I don't see a cleaner alternative for distributors building from archive tarballs.

The issue is that GitHub's archive downloads (both commit snapshots and release tarballs) do not include the src/translations/*.ts files — those only exist in a full git clone. For other bundled dependencies like rizin there is a proper escape hatch (CUTTER_USE_BUNDLED_RIZIN=OFF) that lets the build use a system-installed package instead. Translations have no equivalent: there is no "system translations package" to fall back to, and the .ts files must be physically present under src/translations/ for lrelease to compile them into .qm files.

The alternative would be to fetch the translation files separately (e.g. as an additional download), but that adds complexity for little gain if the goal is simply to build the application without translations. This option keeps that path straightforward.

@PremadeS

PremadeS commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Shouldn't this option be in the main CMakeLists.txt where all of the other options are?
And then Translations.cmake in src/CMakeLists.txt can be included only if that option is checked?

@blshkv
blshkv force-pushed the feat/translations-cmake-option branch from d638c8d to 25729ea Compare July 1, 2026 23:48
@blshkv

blshkv commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Shouldn't this option be in the main CMakeLists.txt where all of the other options are? And then Translations.cmake in src/CMakeLists.txt can be included only if that option is checked?

good point. I trusted AI too much. It is fixed in the last commit

@PremadeS

PremadeS commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

good point. I trusted AI too much. It is fixed in the last commit

Could you please merge/rebase?

Allows building and installing Cutter without translation files by
passing -DCUTTER_ENABLE_TRANSLATIONS=OFF to CMake.

This is useful when building from a source snapshot (e.g. a GitHub
commit archive) that does not include the .ts files, or when the Qt
linguist tools are not available.
@blshkv
blshkv force-pushed the feat/translations-cmake-option branch from 25729ea to d0c3092 Compare July 2, 2026 10:03
@blshkv

blshkv commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Could you please merge/rebase?

done

@PremadeS
PremadeS merged commit e01d86b into rizinorg:dev Jul 2, 2026
15 checks passed
@thestr4ng3r

Copy link
Copy Markdown
Member

@blshkv As a sidenote, if you build a release of cutter, you should use the tarballs provided by us, e.g. https://github.com/rizinorg/cutter/releases/download/v2.5.0/Cutter-v2.5.0-src.tar.gz
These will include all translation files and also rizin source, in case that is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants