PostScheduleLabel: Updated the component to return a translatable str… #67616
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.
Description:
What?
As mentioned in the #67487 issue, we need to break the string mentioned here
gutenberg/packages/editor/src/components/post-schedule/label.js
Lines 60 to 95 in 7e9e53d
Such that translators can easily translate the string.
So I have updated the
usePostScheduleLabel
with a prop for which will be used to identify where we are using this, so that if it's used in the Post Publish Panel, it will return an output which says "It will go live on %s", this allows the translators to translate the string for most of the langugages, providing them better context.Why?
This was mentioned in the following issue #67487 and also suggested to break the string so it will be easy for translations.
How?
Basically we have broken down the initial string such that now it will be returning a full label with string for the provided post publish panel, while it will work normally for the rest of the instances.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast