diff --git a/i2p2www/pages/global/lang.html b/i2p2www/pages/global/lang.html
index 4c09d66e..91356aff 100644
--- a/i2p2www/pages/global/lang.html
+++ b/i2p2www/pages/global/lang.html
@@ -1,11 +1,3 @@
-{%- macro change_lang(lang) -%}
-{%- if request.endpoint == 'site_show' -%}{{ url_for('site_show', lang=lang, page=page) }}
-{%- elif request.endpoint == 'blog_entry' -%}{{ url_for('blog_entry', lang=lang, slug=slug) }}
-{%- elif request.endpoint == 'meetings_show' -%}{{ url_for('meetings_show', lang=lang, id=id) }}
-{%- elif request.endpoint -%}{{ url_for(request.endpoint, lang=lang) }}
-{%- else -%}{{ url_for('site_show', lang=lang) }}
-{%- endif -%}
-{%- endmacro -%}
 }})
 }})
diff --git a/i2p2www/pages/global/layout.html b/i2p2www/pages/global/layout.html
index 6fc7fb43..5ef6d7aa 100644
--- a/i2p2www/pages/global/layout.html
+++ b/i2p2www/pages/global/layout.html
@@ -1,4 +1,4 @@
-{%- from "global/macros" import site_url with context -%}
+{%- from "global/macros" import site_url, change_lang with context -%}
diff --git a/i2p2www/pages/global/macros b/i2p2www/pages/global/macros
index a99b1d17..92fabf41 100644
--- a/i2p2www/pages/global/macros
+++ b/i2p2www/pages/global/macros
@@ -3,3 +3,11 @@
{%- else -%}{{ url_for('site_show', lang=g.lang) }}
{%- endif -%}
{%- endmacro -%}
+{%- macro change_lang(lang) -%}
+{%- if request.endpoint == 'site_show' -%}{{ url_for('site_show', lang=lang, page=page) }}
+{%- elif request.endpoint == 'blog_entry' -%}{{ url_for('blog_entry', lang=lang, slug=slug) }}
+{%- elif request.endpoint == 'meetings_show' -%}{{ url_for('meetings_show', lang=lang, id=id) }}
+{%- elif request.endpoint -%}{{ url_for(request.endpoint, lang=lang) }}
+{%- else -%}{{ url_for('site_show', lang=lang) }}
+{%- endif -%}
+{%- endmacro -%}