@using BTCPayServer.Views.Server
@model EditTranslationViewModel
@{
	ViewData.SetLayoutModel(new LayoutModel(nameof(ServerNavPages.Translations), Context.GetRouteValue("translation") as string)
        .SetCategory(WellKnownCategories.Server));
    ViewData.SetBreadcrumbs([new(StringLocalizer["Translations"], Action: nameof(BTCPayServer.Plugins.Translations.Controllers.UITranslationController.ListTranslations))]);
}

<form method="post" class="d-flex flex-column">
	<div class="sticky-header">
		<vc:title-header />
		<div>
			<button cheat-mode="true" class="btn btn-outline-info" name="command" value="Fake" text-translate="true">Fill fake</button>
			<button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save" text-translate="true">Save</button>
		</div>
	</div>
	<partial name="_StatusMessage" />

	<div class="d-flex mb-4">
		<div class="flex-fill">
			<p>@ViewLocalizer["Translations are formatted as JSON; for example, <b>{0}</b> translates <b>{1}</b> to <b>{2}</b>.", "{ \"Welcome\": \"Bienvenue\" }", "Welcome", "Bienvenue"]</p>
			<p class="mb-0" text-translate="true">
				To use this translation's fallback, you can:
			</p>
            <ul>
                <li text-translate="true">Remove the entry from this translation.</li>
                <li text-translate="true">Set the translation to match the string in the fallback.</li>
            </ul>
			<p class="mb-0" text-translate="true">Please note that not all text is translatable, and future updates may modify existing translations or introduce new translatable phrases.</p>
		</div>
	</div>

	<div class="row">
		<div class="col-xl-8 col-xxl-constrain d-flex flex-column">
			<div class="form-group">
				<label asp-for="Translations" class="form-label"></label>
				<textarea asp-for="Translations" class="form-control translation-editor" rows="@Model.Lines" cols="40"></textarea>
				<span asp-validation-for="Translations" class="text-danger"></span>
			</div>
		</div>
	</div>
</form>
