Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Create AI Podcast: Clarify that free trial credits do not reset.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@
bar.appendChild( fill );
creditsEl.appendChild( bar );

const reset = formatResetPhrase( quota?.resetsAt );
const resetsNever = quota?.resetsAt === 'never';
const reset = resetsNever ? null : formatResetPhrase( quota?.resetsAt );

const meta = document.createElement( 'div' );
meta.className = 'jetpack-create-ai-podcast__credits-meta';
Expand All @@ -324,14 +325,20 @@
sep.className = 'jetpack-create-ai-podcast__credits-meta-sep';
sep.setAttribute( 'aria-hidden', 'true' );
sep.textContent = '·';
meta.appendChild( sep );

const resetEl = document.createElement( 'span' );
resetEl.className = 'jetpack-create-ai-podcast__credits-meta-reset';
resetEl.textContent = reset
? sprintf( data.i18n.creditsResetSummary, reset.inline )
: data.i18n.creditsResetMonthly;
meta.appendChild( resetEl );
let resetText = '';
if ( reset ) {
resetText = sprintf( data.i18n.creditsResetSummary, reset.inline );
} else if ( ! resetsNever ) {
resetText = data.i18n.creditsResetMonthly;
}
if ( resetText ) {
meta.appendChild( sep );
resetEl.textContent = resetText;
meta.appendChild( resetEl );
}

creditsEl.appendChild( meta );

Expand All @@ -345,6 +352,8 @@
outMessage = upgradeUrl
? sprintf( data.i18n.outOfCreditsUpgrade, reset.inline )
: sprintf( data.i18n.outOfCreditsWait, reset.inline );
} else if ( resetsNever ) {
outMessage = data.i18n.outOfTrialCredits;
}
creditsEl.appendChild(
buildBanner( {
Expand All @@ -356,6 +365,17 @@
reset,
} )
);
} else if ( resetsNever ) {
creditsEl.appendChild(
buildBanner( {
state: 'low',
title: data.i18n.trialBannerTitle,
message: data.i18n.trialBannerMessage,
upgradeUrl,
quota: quotaSummary,
reset,
} )
);
} else if ( isLow && upgradeUrl ) {
creditsEl.appendChild(
buildBanner( {
Expand All @@ -374,8 +394,7 @@
* Translate quota.resetsAt into a relative phrase that works both inside
* a sentence (e.g. "your credits refresh {inline}") and as a stand-alone
* summary line (e.g. "Resets {inline}"). Returns null when the timestamp
* is missing or malformed so callers fall back to a generic "monthly"
* blurb.
* is missing or malformed so callers can use generic monthly copy.
*
* @param resetsAt - ISO-8601 reset timestamp.
* @return {{ inline: string, days: number, date: Date } | null} Phrase, days until reset, and parsed Date — or null when input is missing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,16 @@ private static function build_localized_data(): array {
'relativeDays' => __( 'in %d days', 'jetpack-podcast' ),
// translators: %s: formatted date, e.g. "May 20, 2026".
'relativeOn' => __( 'on %s', 'jetpack-podcast' ),
'trialBannerTitle' => __( 'Try before you buy', 'jetpack-podcast' ),
'trialBannerMessage' => __( 'Generate a podcast from your posts and see how it sounds on your site. Free trial is limited to one podcast episode.', 'jetpack-podcast' ),
'runningLowTitle' => __( 'Running low', 'jetpack-podcast' ),
'runningLowMessage' => __( 'Upgrade your plan to keep generating without waiting for the monthly refresh.', 'jetpack-podcast' ),
'outOfCreditsTitle' => __( 'Out of credits', 'jetpack-podcast' ),
// translators: %s: relative time, e.g. "in 12 days" or "tomorrow".
'outOfCreditsWait' => __( 'Your credits will refresh %s.', 'jetpack-podcast' ),
// translators: %s: relative time, e.g. "in 12 days" or "tomorrow".
'outOfCreditsUpgrade' => __( 'Upgrade your plan for more credits, or wait until they refresh %s.', 'jetpack-podcast' ),
'outOfTrialCredits' => __( 'You have used your one-time trial credit. Upgrade your plan for more credits.', 'jetpack-podcast' ),
'noPostsFound' => __( 'No posts match.', 'jetpack-podcast' ),
'loadingPosts' => __( 'Loading posts…', 'jetpack-podcast' ),
'pickPosts' => __( 'Select at least one post to continue.', 'jetpack-podcast' ),
Expand Down
Loading