Add git-native terminology toggle#13
Conversation
|
Thanks for the PR. I was thinking about making this functionality myself. Couple issues:
Thank you. |
Adds an opt-in 'Use git terminology' preference that relabels the UI with the underlying git terms (Iteration->Commit, Project->Repository, Reviewed->Staged, Current Files->Working Tree, etc.). - SettingsRepository owns the toggle: git_terminology_enabled() / set_git_terminology_enabled() on the domain port and FreeCADSettingsRepository, reusing the repo's existing cache. - utils.term(cad, git): selects the CAD-friendly or git phrase per the toggle. Both args are translate()/QT_TRANSLATE_NOOP literals. - Display sites pass both variants through term() at the call site. - Command labels are built at Initialize (before the container exists), so they read the pref via settings_repo.read_git_terminology_enabled(); everything else uses the container-cached repo. - preferences page: 'Use git terminology' checkbox under a Terminology group. - tests: settings-repo toggle + cache, term() selection, preferences wiring. Design notes: - No runtime regex remap. The earlier approach ran ~20 regex substitutions on every translated string; term() does a single boolean check and returns one of two prepared strings, so untoggled paths cost nothing and toggled paths do no scanning. - No inline single-word substitution (f-string or %1 placeholder). Each terminology variant is written as a full translate()/QT_TRANSLATE_NOOP literal at its display site, for two reasons: Qt's lupdate can only extract static literals, so both variants stay translatable; and sentences are never fragmented around an inserted word, which would break grammar/agreement in inflected locales. The near-duplicate CAD/git phrases are the deliberate cost of keeping every user-facing string translatable at the point it is shown. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AY7KZvGbYkCem92P3oVkQd
|
Fair notes, that is a lot of regex. My initial reasoning (likely cause of the excessive regex) was to keep the PR as minimal as possible. I had Claude address your points, and it ended up with a lot of code/string duplication - I pushed back, but you can make the final call. Claude listed it's thoughts on the issue in the new commit message. |
3dfbff9 to
45fcb12
Compare
|
Yeah it's way too verbose. I definitely don't want to add that much complexity just to show different text. I'll see if I can find a better compromise. |
Note:
Thanks for putting this together! Let me know if you need someone to wade through slop PRs, or help out with the project - I'd love to be involved.
Claude:
Adds an opt-in 'Use git terminology' preference that relabels the UI with the underlying git terms (Iteration->Commit, Project->Repository, Reviewed->Staged, Current Files->Working Tree, etc.).