locales: use --add-location=file to stop cacti.pot line-number churn - #132
Merged
Merged
Conversation
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
force-pushed
the
chore/gettext-add-location-file
branch
from
September 28, 2026 20:05
ffe8b1e to
b2ae08e
Compare
bmfmancini
approved these changes
Sep 29, 2026
browniebraun
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
locales/po/cacti.potrecords a source location for every translatable string. Todaybuild_gettext.shrunsxgettextwith 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
xgettextwith--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.potwith 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(allplugin_*repos plus Cacti coredevelop/1.2.x).