mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-06 09:30:49 +00:00
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
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user