Skip to content

locales: use --add-location=file to stop cacti.pot line-number churn - #132

Merged
TheWitness merged 1 commit into
developfrom
chore/gettext-add-location-file
Sep 29, 2026
Merged

TheWitness merged 1 commit into
developfrom
chore/gettext-add-location-file

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

locales/po/cacti.pot records a source location for every translatable string. Today build_gettext.sh runs xgettext with the default --add-location=full, so those comments include line numbers (#: setup.php:653). Line numbers shift whenever code is inserted/removed/moved, so the committed template goes stale on almost any change, repeatedly failing the "Verify translation template is up to date" CI check on otherwise-unrelated PRs and forcing a pot regeneration each time.

Change

Run xgettext with --add-location=file, so locations record only the file name (#: setup.php). Translators still see which file a string lives in, but the template stays stable when surrounding lines move — eliminating the recurring CI failures.

Regenerated cacti.pot with the updated script. The large diff is entirely location-comment reformatting: no msgids were added or removed.

Part of a fleet-wide change applying the same fix to every Cacti repo that ships a build_gettext.sh (all plugin_* repos plus Cacti core develop/1.2.x).

Copilot AI lite review requested due to automatic review settings September 28, 2026 19:36
build_gettext.sh now runs xgettext with --add-location=file, so
locales/po/cacti.pot records only the file name for each string, not the
file:line. Line-numbered locations churn on almost every code change,
which repeatedly breaks the 'Verify translation template is up to date'
CI check on unrelated PRs. Filename-only locations still tell translators
which file a string lives in but stay stable when surrounding lines move.
Regenerated cacti.pot with the updated script; only location comments
changed (no msgids added or removed).
@TheWitness
TheWitness force-pushed the chore/gettext-add-location-file branch from ffe8b1e to b2ae08e Compare September 28, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@TheWitness
TheWitness merged commit 573c065 into develop Sep 29, 2026
5 checks passed
@TheWitness
TheWitness deleted the chore/gettext-add-location-file branch September 29, 2026 00:43
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.

4 participants