Skip to content

chore: ignore and remove compiled .mo translation files - #243

Closed
scardracs wants to merge 3 commits into
OpenGamingCollective:mainfrom
scardracs:chore/ignore-mo-files
Closed

chore: ignore and remove compiled .mo translation files#243
scardracs wants to merge 3 commits into
OpenGamingCollective:mainfrom
scardracs:chore/ignore-mo-files

Conversation

@scardracs

Copy link
Copy Markdown
Contributor

Description

This PR adds *.mo to .gitignore to ignore all compiled gettext translation binary files across the entire repository, and untracks 9 pre-compiled .mo files in rog-control-center/translations/.
Fixes # N/A

Rationale

  • Binary Bloat & Noise: .mo files are binary Machine Object files compiled from human-readable .po source files during localization or build steps. Storing binary outputs in Git creates unnecessary repository bloat and produces noisy diffs on every localization update.
  • Merge Conflicts: Pre-compiled binary files are prone to binary merge conflicts when multiple contributors work on translations simultaneously.
  • Clean Build Lifecycle: Excluding .mo files ensures build targets generate localization binaries transiently without polluting git status.

Tested Hardware & Environment

  • ASUS Laptop Model: N/A (Repository configuration change)
  • Linux Distribution: Arch Linux (CachyOS)
  • Kernel Version: 7.1.5-1-cachyos-eevdf

Verification and testing:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My code follows the style guidelines of this project (cargo fmt --all -- --check)
  • My changes generate no new warnings (cargo clippy --all -- -D warnings/cargo check --all-targets)
  • New and existing unit tests pass locally with my changes (cargo test --all)
  • Cranky with 0 warning (cargo cranky)

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for compiling and installing translation files, making localized application messages available at runtime.
    • Translation updates are automatically detected and incorporated during builds.
    • Added cleanup of outdated translation files during builds and uninstallation.
  • Chores

    • Updated project exclusions so generated translation files are not tracked as source changes.
    • Improved installation support for localized application resources across supported locales.

Walkthrough

The build script compiles .po files into .mo files, tracks translation inputs, and preserves Slint compilation. The Makefile installs and removes compiled translations. Git ignores generated .mo files.

Changes

Translation Packaging

Layer / File(s) Summary
Compile translation files
rog-control-center/build.rs, .gitignore
build.rs discovers PO files, invokes msgfmt, creates locale directories, removes stale MO files, and registers rebuild triggers. Git ignores generated MO files.
Install and remove compiled translations
Makefile
The install target copies .mo files into the system locale directory. The uninstall target removes them.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: rog-control-center

Suggested reviewers: owen-sz

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: ignoring and removing compiled .mo translation files.
Description check ✅ Passed The description includes the change summary, rationale, environment, issue status, and completed verification checklist.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation rog-control-center ROG Control Center GUI labels Jul 31, 2026
@scardracs
scardracs force-pushed the chore/ignore-mo-files branch from 2684abd to 5151ea5 Compare July 31, 2026 09:10
@coderabbitai coderabbitai Bot removed the documentation Improvements or additions to documentation label Jul 31, 2026
@scardracs
scardracs force-pushed the chore/ignore-mo-files branch from 5151ea5 to 07a1575 Compare July 31, 2026 15:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rog-control-center/build.rs`:
- Around line 26-49: Update the msgfmt command handling in build.rs so both
execution errors and non-zero exit statuses return an error from the build
script instead of only emitting cargo warnings; preserve successful compilation
and ensure the surrounding build flow stops when msgfmt fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 22023e30-4f20-4666-9f47-ead91816f48d

📥 Commits

Reviewing files that changed from the base of the PR and between 5151ea5 and 3a1992a.

📒 Files selected for processing (12)
  • .gitignore
  • Makefile
  • rog-control-center/build.rs
  • rog-control-center/translations/az/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/en/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/fr/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/it/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/pt_BR/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/ru/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/tr/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/uk_UA/LC_MESSAGES/rog-control-center.mo
  • rog-control-center/translations/zh_CN/LC_MESSAGES/rog-control-center.mo
📜 Review details
🔇 Additional comments (4)
rog-control-center/build.rs (2)

1-25: LGTM!


51-58: LGTM!

.gitignore (1)

30-30: LGTM!

Makefile (1)

104-104: 🗄️ Data Integrity & Integration

Make translation generation an explicit installation prerequisite.

This recipe copies only existing .mo files. Add the actual translation-generation target as a prerequisite of install-data-rog_gui, including for make -j install, and fail if expected files are absent. Do not depend on rog-control-center/build.rs unless it creates the .mo files.

Comment thread rog-control-center/build.rs
@scardracs
scardracs force-pushed the chore/ignore-mo-files branch from 3a1992a to a184225 Compare July 31, 2026 17:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 104: Update the Makefile uninstall recipe to remove the installed
rog-control-center.mo translation catalog from $(datarootdir)/locale, matching
the destination used by the translation install command.

In `@rog-control-center/build.rs`:
- Around line 19-25: Update the catalog-generation flow around po_file and
mo_file so that when rog-control-center.po is absent, any existing
LC_MESSAGES/rog-control-center.mo is removed. Preserve the current creation and
update behavior when the PO source exists, and ensure stale generated catalogs
are not left for installation.
- Line 13: Update the build script’s translation watch configuration around
translations_dir so generated LC_MESSAGES/*.mo files are not watched. Restrict
Cargo’s rerun-if-changed inputs to source translation files such as .po files,
or place generated outputs outside the watched directory while preserving the
existing msgfmt and Slint compilation behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3975d67f-6d4c-45e1-abec-6f885797a9e4

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1992a and a184225.

📒 Files selected for processing (2)
  • Makefile
  • rog-control-center/build.rs
📜 Review details
🔇 Additional comments (3)
rog-control-center/build.rs (2)

1-12: LGTM!

Also applies to: 15-18, 26-45


47-54: LGTM!

Makefile (1)

104-104: 🗄️ Data Integrity & Integration

Confirm the translation build dependency for this installation rule. If msgfmt generates the installed .mo files in this revision, add the translation target and its .po inputs as prerequisites.

Comment thread Makefile
Comment thread rog-control-center/build.rs
Comment thread rog-control-center/build.rs
@scardracs
scardracs force-pushed the chore/ignore-mo-files branch from a184225 to 6fb1663 Compare July 31, 2026 18:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rog-control-center/build.rs`:
- Around line 13-22: Update compile_translations to add a stable
rerun-if-changed trigger for the translation source directory or locale input
set, while retaining per-file .po tracking. Ensure build.rs reruns when locales
are added or generated .mo catalogs are removed, without recursively watching
LC_MESSAGES/*.mo or any other generated catalogs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2492d48-3130-4094-8343-613f8a21820b

📥 Commits

Reviewing files that changed from the base of the PR and between a184225 and 6fb1663.

📒 Files selected for processing (2)
  • Makefile
  • rog-control-center/build.rs
📜 Review details
🔇 Additional comments (3)
rog-control-center/build.rs (2)

1-12: LGTM!


25-45: LGTM!

Also applies to: 48-67

Makefile (1)

104-104: LGTM!

Comment thread rog-control-center/build.rs
@scardracs

Copy link
Copy Markdown
Contributor Author

Closed as superseeded by #252

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

Labels

rog-control-center ROG Control Center GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant