feat(viewer): context-aware section texts for read-only users#1139
Merged
Conversation
Public visitors and viewers no longer see editor-specific hints (e.g. "When editing this page..." or CTAs to add pages). All section strings are extracted into a new i18n namespace `viewer` for future language support.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the section “empty/overview” UI copy to be context-aware for read-only users, and moves viewer-facing strings into a new viewer i18n namespace to support future localization.
Changes:
- Added a new English
vieweri18n namespace with section-related strings. - Registered the
viewernamespace in the i18n initialization. - Updated
EmptySectionChildrenListto useviewertranslations and hide editor-only hints/CTAs for read-only users.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui/leafwiki-ui/src/locales/en/viewer.json | Adds viewer-facing, section-related localized strings (including read-only variants). |
| ui/leafwiki-ui/src/lib/i18n.ts | Registers the new viewer namespace in i18next resources. |
| ui/leafwiki-ui/src/features/viewer/EmptySectionChildrenList.tsx | Switches hardcoded strings to i18n and conditionally shows editor hints only when not read-only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Public visitors and viewers no longer see editor-specific hints (e.g. "When editing this page..." or CTAs to add pages). All section strings are extracted into a new i18n namespace
viewerfor future language support.