Skip to content

i18n: Fold near-duplicate source strings to reduce translation workload - #743

Open
echoix wants to merge 1 commit into
mainfrom
i18n-fold-similar-strings
Open

echoix wants to merge 1 commit into
mainfrom
i18n-fold-similar-strings

Conversation

@echoix

@echoix echoix commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Description

Many messages were translated separately only because they differ in the quoting of the placeholder, capitalization, trailing period, ellipsis spacing, or wording. This PR uses one variant for each across libraries, tools and the GUI, following the "Formatting messages" rules of doc/development/style_guide.md (the guide itself is unchanged):

  • names of maps, groups, tables etc. in <%s>; file paths and SQL in '%s'
  • capital first letter, no contractions
  • period on errors and complete sentences, none on short phrases and labels
  • ellipsis for ongoing actions (Reading <%s>...)

The runtime deprecated-flag warnings are now one string (Flag '%c' is deprecated and will be removed in a future release. Use format=%s instead.) with the flag and format passed as arguments.

Result: unique source strings go from 14498 to 14339 (about 160 fewer). Because the guide asks for a period on errors, the kept variant is often not the most used one, so 70 strings in the result are not in the current catalogs (69 have no translation in any language).

Only strings that had near-duplicate variants were changed. Other messages still differing from the guide (for example file names in <%s>, or errors without a period) are not touched. Also not included: %lu/%llu variants in the lidar/PDAL tools (duplicated HAVE_LONG_LONG_INT fallback blocks), strings differing in placeholder type, and plural (n_()) strings.

Candidates were found by comparing the message catalogs with a script and rewritten semi-automatically with Claude.

Motivation and context

Reduce the number of strings to translate and keep wording consistent between domains.

How has this been tested?

Regenerated the catalogs with xgettext before and after and compared them. Ran ruff and clang-format on the changed files.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as before)

Checklist

  • PR title provides summary of the changes and starts with one of the
    pre-defined prefixes
  • My code follows the code style
    of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Many messages were translated separately only because they differed in
the quoting of the placeholder, in capitalization, in a trailing period,
in the spacing of an ellipsis or in the wording, for example "Unable to
open file '%s' for writing." and "Unable to open file <%s> for writing",
or "Out of memory!" and "Out of memory". Use one variant for each across
the libraries, tools and the GUI, following the formatting rules of the
style guide: names of maps, groups, tables and the like in <>, file
paths and SQL in single quotes, a capital first letter, no contractions,
a period on errors and on messages with complete sentences, none on short
phrases and labels, and an ellipsis for ongoing actions.

The runtime warnings about deprecated flags are now one string with the
flag and the output format passed as arguments, using "Use" instead of
"Please use" as in the flag descriptions.

The candidate strings were found with a script comparing the message
catalogs and rewritten semi-automatically; Claude was used for this.
@echoix
echoix force-pushed the i18n-fold-similar-strings branch from 757e459 to b9aa579 Compare October 12, 2026 14:10
@github-actions github-actions Bot added the tests label Oct 12, 2026
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.

2 participants