# @ViewData["Title"] – NaLU AI
@(ViewData[

@{ // Detect language from URL — reliable regardless of ViewData render order var _isEn = Context.Request.Path.StartsWithSegments("/en"); var _lp = _isEn ? "/en" : ""; // Map current URL to the alternate language equivalent var _cur = Context.Request.Path.Value ?? "/"; // Known pages that have a real PT↔EN pair var _knownEn = new HashSet<string> { "/en", "/en/pricing", "/en/validators", "/en/playground", "/en/docs", "/en/docs/quickstart", "/en/docs/api-reference", "/en/docs/mcp", "/en/docs/n8n", "/en/docs/credits", "/en/docs/errors", "/en/terms", "/en/privacy" }; var _knownPt = new HashSet<string> { "/", "/precos", "/validadores", "/playground", "/docs", "/docs/quickstart", "/docs/api-reference", "/docs/mcp", "/docs/n8n", "/docs/creditos", "/docs/erros", "/termos", "/privacidade" }; bool _hasAlternate = _isEn ? _knownEn.Contains(_cur) : _knownPt.Contains(_cur); string _altUrl = _isEn ? _cur switch { "/en" => "/", "/en/pricing" => "/precos", "/en/validators" => "/validadores", "/en/playground" => "/playground", "/en/docs" => "/docs", "/en/docs/quickstart" => "/docs/quickstart", "/en/docs/api-reference" => "/docs/api-reference", "/en/docs/mcp" => "/docs/mcp", "/en/docs/n8n" => "/docs/n8n", "/en/docs/credits" => "/docs/creditos", "/en/docs/errors" => "/docs/erros", "/en/terms" => "/termos", "/en/privacy" => "/privacidade", _ => "/" } : _cur switch { "/" => "/en", "/precos" => "/en/pricing", "/validadores" => "/en/validators", "/playground" => "/en/playground", "/docs" => "/en/docs", "/docs/quickstart" => "/en/docs/quickstart", "/docs/api-reference" => "/en/docs/api-reference", "/docs/mcp" => "/en/docs/mcp", "/docs/n8n" => "/en/docs/n8n", "/docs/creditos" => "/en/docs/credits", "/docs/erros" => "/en/docs/errors", "/termos" => "/en/terms", "/privacidade" => "/en/privacy", _ => "/en" }; // Base URL for absolute hrefs (canonical + hreflang) var _base = $"{Context.Request.Scheme}://{Context.Request.Host}"; var _ptAbsolute = _isEn ? $"{_base}{_altUrl}" : $"{_base}{_cur}"; var _enAbsolute = _isEn ? $"{_base}{_cur}" : $"{_base}{_altUrl}"; }
@if (_hasAlternate) { }
@await RenderSectionAsync("Head", required: false)
@RenderBody()
@await RenderSectionAsync("Scripts", required: false)