Implement dynamic language system with automatic detection

- Add getAvailableLanguages() method to scan lang directory automatically
- Add getNativeLanguageName() method for proper language display names
- Enhance SimpleTemplate engine to support array iteration with {{#array}} syntax
- Update header template to use dynamic language dropdown with native names
- Add German (de.php) and French (fr.php) language files as examples
- Fix search input text color to use black text for better visibility
- Languages now appear automatically when added to engine/lang/ without code changes
This commit is contained in:
2025-11-22 21:06:50 +01:00
parent 26f382c41d
commit 25769cef24
8 changed files with 657 additions and 13 deletions

View File

@@ -18,8 +18,9 @@
{{current_lang_upper}} <i class="bi bi-chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="?lang=nl{{lang_switch_url}}">NL</a></li>
<li><a class="dropdown-item" href="?lang=en{{lang_switch_url}}">EN</a></li>
{{#available_langs}}
<li><a class="dropdown-item {{#is_current}}active{{/is_current}}" href="?lang={{code}}{{lang_switch_url}}">{{native_name}}</a></li>
{{/available_langs}}
</ul>
</div>
</div>
@@ -33,8 +34,9 @@
{{current_lang_upper}} <i class="bi bi-chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href="?lang=nl{{lang_switch_url}}">NL</a></li>
<li><a class="dropdown-item" href="?lang=en{{lang_switch_url}}">EN</a></li>
{{#available_langs}}
<li><a class="dropdown-item {{#is_current}}active{{/is_current}}" href="?lang={{code}}{{lang_switch_url}}">{{native_name}}</a></li>
{{/available_langs}}
</ul>
</div>
</div>