Simplify plan name localization in dashboard
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled

Use a single expression to derive the plan key (offering.name or 'free') and pass it to i18n when updating .bento-plan-name. This removes the previous ternary and duplicates, allowing dynamic offering names to be localized consistently.
This commit is contained in:
jelveh
2026-03-19 18:28:42 -07:00
parent a6b18ff844
commit 4a4a92ccaf
+2 -4
View File
@@ -260,11 +260,9 @@ const TabHome = {
// Load plan data
try {
const hasSubscription = window.user?.subscription?.active;
const planName = hasSubscription
? (window.user?.subscription?.offering?.name || i18n('billing.offering.pro'))
: i18n('billing.offering.free');
const planName = window.user?.subscription?.offering?.name || 'free';
$el_window.find('.bento-plan-name').text(planName);
$el_window.find('.bento-plan-name').text(i18n(planName));
if ( hasSubscription ) {
$el_window.find('.bento-plan-badge').text('Active subscription').addClass('active');