Fix FTL crash when realm has i18n disabled

Guard locale references with null-safe defaults — the master realm
ships with internationalization off, so locale is undefined and
${locale.currentLanguageTag} threw InvalidReferenceException.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-04-10 10:11:49 +02:00
parent f1b98fe8d7
commit d7f904c183

View File

@@ -1,6 +1,6 @@
<#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true displayRequiredFields=false showAnotherWayIfPresent=true> <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true displayRequiredFields=false showAnotherWayIfPresent=true>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="${locale.currentLanguageTag}"> <html lang="${(locale.currentLanguageTag)!'en'}">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
@@ -95,7 +95,7 @@
</div> </div>
<!-- Locale selector --> <!-- Locale selector -->
<#if realm.internationalizationEnabled && locale.supported?size gt 1> <#if realm.internationalizationEnabled?? && realm.internationalizationEnabled && locale?? && locale.supported?? && locale.supported?size gt 1>
<div class="mt-6 bg-white border-4 border-gray-900 p-3 shadow-[6px_6px_0px_rgba(0,0,0,1)] flex items-center justify-center gap-4 flex-wrap"> <div class="mt-6 bg-white border-4 border-gray-900 p-3 shadow-[6px_6px_0px_rgba(0,0,0,1)] flex items-center justify-center gap-4 flex-wrap">
<span class="font-black uppercase text-xs tracking-widest text-gray-500">// Langue</span> <span class="font-black uppercase text-xs tracking-widest text-gray-500">// Langue</span>
<#list locale.supported as l> <#list locale.supported as l>