From fb4ff1194542e451d0a867399975a7aa3b7cbb6d Mon Sep 17 00:00:00 2001 From: grandeljay Date: Mon, 13 Jun 2022 07:45:13 +0200 Subject: [PATCH] Add warning about blog only being available in english --- src/pages/blog.php | 11 +++++++++++ src/pages/post.php | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/pages/blog.php b/src/pages/blog.php index b51ccedf..1cfbdf92 100644 --- a/src/pages/blog.php +++ b/src/pages/blog.php @@ -14,6 +14,17 @@ $page->bodyStart(); $page->navigation(); $posts = Blog::getPosts(); + +if ('en' !== \Locale::getPrimaryLanguage($user->locale)) { + $page->messages[] = Page::warning( + sprintf( + /** TRANSLATORS: %s: Language, most likely English */ + __('The blog is currently only available in %s and not translateable. Please let me know if you have any ideas to improve this.'), + '' . \Locale::getDisplayName('en', 'en') . '' + ), + __('Warning') + ); +} ?>
diff --git a/src/pages/post.php b/src/pages/post.php index be277de9..c5383a40 100644 --- a/src/pages/post.php +++ b/src/pages/post.php @@ -32,6 +32,8 @@ $page->navigation();
+ messages() ?> +