Adds localization support across application views
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
This commit is contained in:
parent
1f400dcc6e
commit
ef174af0e1
36 changed files with 821 additions and 263 deletions
|
|
@ -1,15 +1,15 @@
|
|||
<swp-invoices-card>
|
||||
<swp-invoices-header>
|
||||
<swp-invoices-title>Faktura-historik</swp-invoices-title>
|
||||
<swp-invoices-title localize="account.invoices.title">Faktura-historik</swp-invoices-title>
|
||||
</swp-invoices-header>
|
||||
|
||||
<swp-invoice-table>
|
||||
<swp-invoice-table-header>
|
||||
<swp-invoice-row>
|
||||
<swp-invoice-cell>Dato</swp-invoice-cell>
|
||||
<swp-invoice-cell>Fakturanr.</swp-invoice-cell>
|
||||
<swp-invoice-cell>Beløb</swp-invoice-cell>
|
||||
<swp-invoice-cell>Status</swp-invoice-cell>
|
||||
<swp-invoice-cell localize="account.invoices.date">Dato</swp-invoice-cell>
|
||||
<swp-invoice-cell localize="account.invoices.invoiceNumber">Fakturanr.</swp-invoice-cell>
|
||||
<swp-invoice-cell localize="account.invoices.amount">Beløb</swp-invoice-cell>
|
||||
<swp-invoice-cell localize="common.status">Status</swp-invoice-cell>
|
||||
<swp-invoice-cell></swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
</swp-invoice-table-header>
|
||||
|
|
@ -21,13 +21,13 @@
|
|||
<swp-invoice-cell>
|
||||
<swp-invoice-status class="paid">
|
||||
<i class="ph ph-check-circle"></i>
|
||||
Betalt
|
||||
<span localize="account.invoices.paid">Betalt</span>
|
||||
</swp-invoice-status>
|
||||
</swp-invoice-cell>
|
||||
<swp-invoice-cell>
|
||||
<swp-download-btn>
|
||||
<i class="ph ph-download"></i>
|
||||
PDF
|
||||
<span localize="account.invoices.download">PDF</span>
|
||||
</swp-download-btn>
|
||||
</swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
|
|
@ -39,13 +39,13 @@
|
|||
<swp-invoice-cell>
|
||||
<swp-invoice-status class="paid">
|
||||
<i class="ph ph-check-circle"></i>
|
||||
Betalt
|
||||
<span localize="account.invoices.paid">Betalt</span>
|
||||
</swp-invoice-status>
|
||||
</swp-invoice-cell>
|
||||
<swp-invoice-cell>
|
||||
<swp-download-btn>
|
||||
<i class="ph ph-download"></i>
|
||||
PDF
|
||||
<span localize="account.invoices.download">PDF</span>
|
||||
</swp-download-btn>
|
||||
</swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
|
|
@ -57,13 +57,13 @@
|
|||
<swp-invoice-cell>
|
||||
<swp-invoice-status class="paid">
|
||||
<i class="ph ph-check-circle"></i>
|
||||
Betalt
|
||||
<span localize="account.invoices.paid">Betalt</span>
|
||||
</swp-invoice-status>
|
||||
</swp-invoice-cell>
|
||||
<swp-invoice-cell>
|
||||
<swp-download-btn>
|
||||
<i class="ph ph-download"></i>
|
||||
PDF
|
||||
<span localize="account.invoices.download">PDF</span>
|
||||
</swp-download-btn>
|
||||
</swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
|
|
@ -75,13 +75,13 @@
|
|||
<swp-invoice-cell>
|
||||
<swp-invoice-status class="paid">
|
||||
<i class="ph ph-check-circle"></i>
|
||||
Betalt
|
||||
<span localize="account.invoices.paid">Betalt</span>
|
||||
</swp-invoice-status>
|
||||
</swp-invoice-cell>
|
||||
<swp-invoice-cell>
|
||||
<swp-download-btn>
|
||||
<i class="ph ph-download"></i>
|
||||
PDF
|
||||
<span localize="account.invoices.download">PDF</span>
|
||||
</swp-download-btn>
|
||||
</swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
|
|
@ -93,13 +93,13 @@
|
|||
<swp-invoice-cell>
|
||||
<swp-invoice-status class="paid">
|
||||
<i class="ph ph-check-circle"></i>
|
||||
Betalt
|
||||
<span localize="account.invoices.paid">Betalt</span>
|
||||
</swp-invoice-status>
|
||||
</swp-invoice-cell>
|
||||
<swp-invoice-cell>
|
||||
<swp-download-btn>
|
||||
<i class="ph ph-download"></i>
|
||||
PDF
|
||||
<span localize="account.invoices.download">PDF</span>
|
||||
</swp-download-btn>
|
||||
</swp-invoice-cell>
|
||||
</swp-invoice-row>
|
||||
|
|
|
|||
|
|
@ -9,32 +9,32 @@
|
|||
</swp-payment-info>
|
||||
<swp-btn class="secondary sm">
|
||||
<i class="ph ph-pencil"></i>
|
||||
Skift
|
||||
<span localize="account.payment.change">Skift</span>
|
||||
</swp-btn>
|
||||
</swp-payment-method>
|
||||
|
||||
<swp-payment-detail>
|
||||
<swp-payment-label>Betalingsfrekvens</swp-payment-label>
|
||||
<swp-payment-value>Månedlig</swp-payment-value>
|
||||
<swp-payment-label localize="account.payment.frequency">Betalingsfrekvens</swp-payment-label>
|
||||
<swp-payment-value localize="account.payment.monthly">Månedlig</swp-payment-value>
|
||||
</swp-payment-detail>
|
||||
|
||||
<swp-payment-detail>
|
||||
<swp-payment-label>Næste betaling</swp-payment-label>
|
||||
<swp-payment-label localize="account.payment.nextPayment">Næste betaling</swp-payment-label>
|
||||
<swp-payment-value class="highlight">1. februar 2026</swp-payment-value>
|
||||
</swp-payment-detail>
|
||||
|
||||
<swp-payment-detail>
|
||||
<swp-payment-label>Beløb</swp-payment-label>
|
||||
<swp-payment-label localize="account.payment.amount">Beløb</swp-payment-label>
|
||||
<swp-payment-value>599,00 kr</swp-payment-value>
|
||||
</swp-payment-detail>
|
||||
|
||||
<swp-payment-detail>
|
||||
<swp-payment-label>Kortudløb</swp-payment-label>
|
||||
<swp-payment-label localize="account.payment.cardExpiry">Kortudløb</swp-payment-label>
|
||||
<swp-payment-value>08/2027</swp-payment-value>
|
||||
</swp-payment-detail>
|
||||
|
||||
<swp-btn class="outline" style="margin-top: var(--spacing-2);">
|
||||
<i class="ph ph-arrows-clockwise"></i>
|
||||
Skift til årlig betaling (spar 15%)
|
||||
<span localize="account.payment.switchToYearly">Skift til årlig betaling (spar 15%)</span>
|
||||
</swp-btn>
|
||||
</swp-payment-card>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
@using PlanTempus.Application.Features.Accounts.Models
|
||||
@using PlanTempus.Application.Features.Localization.Services
|
||||
@model IEnumerable<PlanInfo>
|
||||
|
||||
@{
|
||||
var currentPlanKey = (string)ViewBag.CurrentPlanKey;
|
||||
var L = (ILocalizationService)ViewBag.Localization;
|
||||
}
|
||||
|
||||
<swp-plan-grid>
|
||||
|
|
@ -16,14 +18,14 @@
|
|||
};
|
||||
|
||||
var badgeClass = isCurrent ? "current" : plan.BadgeClass;
|
||||
var badgeText = isCurrent ? "Nuværende plan" : plan.BadgeText;
|
||||
var badgeText = isCurrent ? L.Get("account.subscription.currentPlan") : plan.BadgeText;
|
||||
var badgeIcon = isCurrent ? "ph-check" : plan.BadgeIcon;
|
||||
|
||||
var buttonText = isCurrent
|
||||
? "Nuværende plan"
|
||||
? L.Get("account.subscription.currentPlan")
|
||||
: plan.IsContactSales
|
||||
? "Kontakt salg"
|
||||
: $"Skift til {plan.Name}";
|
||||
? L.Get("account.subscription.contactSales")
|
||||
: L.Get("account.subscription.switchTo").Replace("{plan}", plan.Name);
|
||||
|
||||
var buttonClass = isCurrent
|
||||
? "secondary"
|
||||
|
|
@ -42,11 +44,11 @@
|
|||
@if (plan.PricePerMonth.HasValue)
|
||||
{
|
||||
<swp-plan-price-amount>@plan.PriceDisplay</swp-plan-price-amount>
|
||||
<swp-plan-price-period>kr/md</swp-plan-price-period>
|
||||
<swp-plan-price-period localize="account.subscription.pricePerMonth">kr/md</swp-plan-price-period>
|
||||
}
|
||||
else
|
||||
{
|
||||
<swp-plan-price-amount>Kontakt os</swp-plan-price-amount>
|
||||
<swp-plan-price-amount localize="account.subscription.contactUs">Kontakt os</swp-plan-price-amount>
|
||||
}
|
||||
</swp-plan-price>
|
||||
<swp-plan-features>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using PlanTempus.Application.Features.Accounts.Models;
|
||||
using PlanTempus.Application.Features.Localization.Services;
|
||||
|
||||
namespace PlanTempus.Application.Features.Account.Components;
|
||||
|
||||
|
|
@ -9,6 +10,13 @@ namespace PlanTempus.Application.Features.Account.Components;
|
|||
/// </summary>
|
||||
public class SubscriptionPlansViewComponent : ViewComponent
|
||||
{
|
||||
private readonly ILocalizationService _localization;
|
||||
|
||||
public SubscriptionPlansViewComponent(ILocalizationService localization)
|
||||
{
|
||||
_localization = localization;
|
||||
}
|
||||
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
var plans = PlanCatalog.GetAllPlans();
|
||||
|
|
@ -16,6 +24,7 @@ public class SubscriptionPlansViewComponent : ViewComponent
|
|||
var currentPlanKey = "pro";
|
||||
|
||||
ViewBag.CurrentPlanKey = currentPlanKey;
|
||||
ViewBag.Localization = _localization;
|
||||
return View(plans);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue