Implements localization for dashboard, cash register, account, and profile sections Adds localization keys for various UI elements, improving internationalization support Refactors view components to use ILocalizationService for dynamic text rendering Prepares ground for multi-language support with translation-ready markup
30 lines
915 B
C#
30 lines
915 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using PlanTempus.Application.Features.Accounts.Models;
|
|
using PlanTempus.Application.Features.Localization.Services;
|
|
|
|
namespace PlanTempus.Application.Features.Account.Components;
|
|
|
|
/// <summary>
|
|
/// ViewComponent for the subscription plan selection grid.
|
|
/// Shows all available plans with the current plan highlighted.
|
|
/// </summary>
|
|
public class SubscriptionPlansViewComponent : ViewComponent
|
|
{
|
|
private readonly ILocalizationService _localization;
|
|
|
|
public SubscriptionPlansViewComponent(ILocalizationService localization)
|
|
{
|
|
_localization = localization;
|
|
}
|
|
|
|
public IViewComponentResult Invoke()
|
|
{
|
|
var plans = PlanCatalog.GetAllPlans();
|
|
// Mock: current plan is "pro"
|
|
var currentPlanKey = "pro";
|
|
|
|
ViewBag.CurrentPlanKey = currentPlanKey;
|
|
ViewBag.Localization = _localization;
|
|
return View(plans);
|
|
}
|
|
}
|