{% import "macros/translate.html" as macros_translate %}

{%- set language_strings = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
{%- if not language_strings -%}
    {%- set language_strings = load_data(path="themes/duckquill/i18n/" ~ lang ~ ".toml", required=false) -%}
{%- endif -%}

{%- if note -%}
	{%- set alert_type = "note" -%}
	{%- set alert_string = macros_translate::translate(key="note", default="Note", language_strings=language_strings) -%}
{%- elif tip -%}
	{%- set alert_type = "tip" -%}
	{%- set alert_string = macros_translate::translate(key="tip", default="Tip", language_strings=language_strings) -%}
{%- elif important -%}
	{%- set alert_type = "important" -%}
	{%- set alert_string = macros_translate::translate(key="important", default="Important", language_strings=language_strings) -%}
{%- elif warning -%}
	{%- set alert_type = "warning" -%}
	{%- set alert_string = macros_translate::translate(key="warning", default="Warning", language_strings=language_strings) -%}
{%- elif caution -%}
	{%- set alert_type = "caution" -%}
	{%- set alert_string = macros_translate::translate(key="caution", default="Caution", language_strings=language_strings) -%}
{%- endif -%}

<blockquote class="{{ alert_type }}">
	<p class="alert-title">
		<i class="icon"></i>
		{{- alert_string -}}
	</p>
	{{ body | markdown | safe }}
</blockquote>
