{% set column_titles = {} %}
{% for column_num, single_column_data in columns %}
{% if single_column_data['column_type'] == 'bible' %}
{% if single_column_data['contents']|length == 0 %} {# No content found #}
{% set single_column_title = app.session.get('ui_str')["meta.bible.notfound.subtitle"] %}
{% else %}
{% set v1 = single_column_data['contents']|first|first.findMainVerse() %}
{% set vn = single_column_data['contents']|last|last.findMainVerse() %}
{% set c1 = v1.chapter %}
{% set cn = vn.chapter %}
{% set matches_chapter_boundaries = (v1 == c1.verses|first) and (vn == cn.verses|last) %}
{# Let's avoid having to rewrite a lot of the same array entries with a lot of the translation calls #}
{% set translator_vars = {
'_9100_': single_column_data['translation'].name,
'_8100_': single_column_data['book'].name,
'_8200_': c1.ordering,
'_8210_': c1.ordering,
'_8220_': cn.ordering,
'_8300_': v1.indexDisplay,
'_8310_': v1.indexDisplay,
'_8320_': vn.indexDisplay,
'_8380_': single_column_data['translation'].abbreviation,
'_3000_': single_column_data['translation'].language_name
} %}
{% if single_column_data['contents']|length == 1 %} {# Content from one chapter #}
{% if matches_chapter_boundaries %}
{% set single_column_title = app.session.get('ui_str')["meta.bible.chapter.subtitle"]|replace(translator_vars)|replace({" ": " "})|raw %}
{% elseif single_column_data['contents']|first|length == 1 %}
{% set single_column_title = app.session.get('ui_str')["meta.bible.verse.subtitle"]|replace(translator_vars)|raw %}
{% else %}
{% set single_column_title = app.session.get('ui_str')["meta.bible.verserange.subtitle"]|replace(translator_vars)|raw %}
{% endif %}
{% else %} {# Content from multiple chapters #}
{% if matches_chapter_boundaries %}
{% set single_column_title = app.session.get('ui_str')["meta.bible.chapterrange.fullchapters.subtitle"]|replace(translator_vars)|raw %}
{% else %}
{% set single_column_title = app.session.get('ui_str')["meta.bible.chapterrange.verses.subtitle"]|replace(translator_vars)|raw %}
{% endif %}
{% endif %}
{% endif %}
{% elseif single_column_data['column_type'] == 'exposition' and (single_column_data['translation'] is defined or single_column_data['passage'] is defined) %}
{# Show name of specific translation if a specific translation was requested; show a more generic title otherwise #}
{% if single_column_data['lock_translation'] is defined and single_column_data['lock_translation'] == true %}
{% set book_title = single_column_data['translation'].getNameOrTitle() %}
{% else %}
{% set book_title = single_column_data['translation'].translatedTitle %}
{% endif %}
{% if single_column_data['passage'].swedenborgSection is null %}
{% set single_column_title = app.session.get('ui_str')["meta.exposition.passage.unnumbered.subtitle.generic"]|replace({'_1000_': book_title})|raw %}
{% else %}
{% set single_column_title = app.session.get('ui_str')["meta.exposition.passage.numbered.subtitle.generic"]|replace({'_1000_': book_title, '_2000_': single_column_data['passage'].swedenborgSection})|raw %}
{% endif %}
{% elseif single_column_data['column_type'] == 'dependent' %}
{% set single_column_title = "[Dependency error]" %}
{% else %}
{% set single_column_title = "[Content error]" %}
{% endif %}
{% set column_titles = column_titles|merge({('_84'~column_num~'0_'): single_column_title}) %}
{% endfor %}
{% if columns|length == 2 %}
{{ "_8410_; _8420_"|replace(column_titles)|raw }} {{ app.session.get('ui_str')["meta.userinterface"] }}
{% elseif columns|length == 3 %}
{{ "_8410_; _8420_; _8430_"|replace(column_titles)|raw }} {{ app.session.get('ui_str')["meta.userinterface"] }}
{% endif %}