8000 fix(i18n): progress says when there is nothing to translate by Klehm · Pull Request #65 · Klehm/content-blocks-project · GitHub
[go: up one dir, main page]

Skip to content

fix(i18n): progress says when there is nothing to translate - #65

Merged
Klehm merged 1 commit into
masterfrom
fix/i18n-progress-empty-area
Sep 29, 2026
Merged

Klehm merged 1 commit into
masterfrom
fix/i18n-progress-empty-area

Conversation

@Klehm
@Klehm Klehm commented Sep 29, 2026
Copy link
Copy Markdown
Owner

A page just created has no translatable field yet. Its TranslationProgress was percent: 100 and complete: true, which is right for "is there work left?", but a host badge reading it showed a brand-new page as a green "100%".

Change

  • TranslationProgress::isEmpty(): true when there is nothing to translate. That covers a new page, or a page holding only images and dividers (shared media are already left out of progress).
  • toArray(), and so cb_i18n_progress(), gains an empty key.
  • percent and complete are unchanged. They are part of the frozen cb_i18n_progress() output, so a host checks empty before showing a "translated" badge.

The workbench meter and content-blocks:i18n:status still show 100% for such a page. They are untouched here.

Docs

  • CHANGELOG entry.
  • README example: progress.empty ? '—' : progress.percent ~ '%'.
  • Rationale in docs/internals/i18n.md (Three states).

Tests

  • 4 new cases in TranslationProgressTest: empty scope, shared-media-only scope, fully translated (not empty), and plus().
  • i18n PHPUnit (244) and Vitest (39) green.
  • PHPStan and php-cs-fixer clean.

🤖 Generated with Claude Code

A page just created has no translatable field, so its progress was 100% and
complete, and a host's page list showed it with a green "100%" badge.
`TranslationProgress::toArray()` (and so `cb_i18n_progress()`) now carries
`empty`, with `isEmpty()` beside it. `percent` and `complete` are unchanged:
they are frozen output, and still right for "is there work left?".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Klehm
Klehm merged commit cc22db3 into master Sep 29, 2026
36 checks passed
@Klehm
Klehm deleted the fix/i18n-progress-empty-area branch September 29, 2026 10:12
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.

1 participant

0