Repository navigation
fix(i18n): make media upload and rich text toolbar strings translatable - #105
Closed
dev-shahed wants to merge 1 commit into
Closed
dev-shahed wants to merge 1 commit into
dev-shahed wants to merge 1 commit into
Conversation
Hardcoded English labels never reached translators, so Dokan Lite could not translate "Change", "Upload Image" or the editor toolbar titles. Wrap them in __() with the dokan-lite text domain so they are extracted by wp i18n make-pot from the compiled bundle and loaded through the dokan-plugin-ui script translations. Refs getdokan/dokan#3453 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
Author
|
Closing: this hardcodes the |
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.
Problem
Dokan Lite reported (getdokan/dokan#3453) that some settings strings can't be translated:
WpMediaUpload. Dokan's.pothas the string, but only from its own bundles, so translating it had no effect here.btnTextprop, not in the.potat all.titleattributes.Fix
Wrap them in
__( '…', 'dokan-lite' )from@wordpress/i18n(already an externalised peer dependency).WpMediaUpload.tsx: Upload Image, Add Images, Change, Select Images, Add, Removerich-text-editor.tsx: all toolbar button titles + the two URL promptsWpMedia.ts: media frame title/button "Select"file-view.tsx: Remove aria-labelLiteral
__()calls with thedokan-litedomain are whatwp i18n make-potextracts from Dokan's compiledassets/js/plugin-ui.js, and Dokan already loadsdokan-litescript translations for thedokan-plugin-uihandle.Not changed
<option>labels (Paragraph, Heading 1, Sans Serif…): their text is also their value, so translating them would break the formatting handlers. Needs a value/label split.'default'text domain, which Dokan doesn't load for this script. Left for a follow-up.Verification
npm run typecheckandnpm run lintpass.makepotextraction in Dokan. After merge, Dokan needs itspackage-lock.jsonbumped to the new commit.🤖 Generated with Claude Code