Skip to content

fix(ui): internationalize hardcoded labels in sidebar toggle#17244

Open
Coder909-byte wants to merge 1 commit into
payloadcms:mainfrom
Coder909-byte:chore/setup-test
Open

fix(ui): internationalize hardcoded labels in sidebar toggle#17244
Coder909-byte wants to merge 1 commit into
payloadcms:mainfrom
Coder909-byte:chore/setup-test

Conversation

@Coder909-byte

Copy link
Copy Markdown

Which branch should this PR target?
main — Payload v4 development. New features, enhancements, and v4 bug fixes go here.

What?
Internationalized the hardcoded fallback UI strings in the SidebarToggle component by integrating the useTranslation hook.

Why?
The "Hide sidebar" and "Show sidebar" labels were previously hardcoded in English prose within the component layout. To support proper internationalization and localization across the entire Payload admin panel dashboard, these labels need to pull dynamically from the application's global translation keys.

How?
Imported the useTranslation hook from @payloadcms/ui.
Extracted the t function inside the SidebarToggle component structure.
Replaced the hardcoded "Hide sidebar" text string with t('general:hideSidebar').
Replaced the hardcoded "Show sidebar" text string with t('general:showSidebar').

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