{% set current_path = request.path %}
{% if current_path.startswith('/loras/recipes') %}
{% set current_page = 'recipes' %}
{% elif current_path.startswith('/checkpoints') %}
{% set current_page = 'checkpoints' %}
{% elif current_path.startswith('/embeddings') %}
{% set current_page = 'embeddings' %}
{% elif current_path.startswith('/other') %}
{% set current_page = 'other' %}
{% elif current_path.startswith('/workflows') %}
{% set current_page = 'workflows' %}
{% elif current_path.startswith('/statistics') %}
{% set current_page = 'statistics' %}
{% else %}
{% set current_page = 'loras' %}
{% endif %}
{# The key is resolved through a variable, like the search placeholder below:
writing t('header.navigation.' ~ current_page) makes the i18n scanner treat
the literal prefix as a key of its own. #}
{% set page_title_key = 'header.navigation.' ~ current_page %}
{# The filter panel lists the page's own items: recipes and workflows are not
models, so their titles name the page's collection instead. #}
{% set filter_title_key = {'recipes': 'recipes.filter.title', 'workflows': 'workflows.filter.title'}.get(current_page, 'header.filter.title') %}
{{ t('header.appTitle') }}
{{ t(page_title_key) }}