Fix: add @namespace to MultiLangInput so Blazor can recognize the component class
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
@namespace ECommerce.Module.Components.Shared
|
||||
@using System.Globalization
|
||||
|
||||
<div class="space-y-2">
|
||||
<div>DEBUG: ActiveCulture=@ActiveCulture, HideTabs=@HideTabs, IsTextArea=@IsTextArea</div>
|
||||
@if (!HideTabs)
|
||||
{
|
||||
<div class="flex flex-wrap gap-2 mb-2">
|
||||
@foreach (var culture in SupportedCultures)
|
||||
{
|
||||
<button type="button" @onclick="() => SelectCulture(culture.Key)"
|
||||
class="btn btn-sm @(ActiveCulture == culture.Key ? "btn-primary" : "btn-ghost")">
|
||||
@culture.Value
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="relative">
|
||||
@if (IsTextArea)
|
||||
{
|
||||
@@ -14,6 +27,13 @@
|
||||
placeholder="@(Placeholder)" />
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (Value != null && Value.ContainsKey(ActiveCulture))
|
||||
{
|
||||
<div class="text-xs opacity-50 text-right">
|
||||
Chars: @Value[ActiveCulture].Length
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@@ -27,12 +47,12 @@
|
||||
[Parameter] public bool HideTabs { get; set; } = false;
|
||||
|
||||
private static readonly Dictionary<string, string> SupportedCultures = new()
|
||||
{
|
||||
{ "en", "English" },
|
||||
{ "ar", "العربية" },
|
||||
{ "es", "Español" },
|
||||
{ "de", "Deutsch" }
|
||||
};
|
||||
{
|
||||
{ "en", "English" },
|
||||
{ "ar", "العربية" },
|
||||
{ "es", "Español" },
|
||||
{ "de", "Deutsch" }
|
||||
};
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user