From 38f03c375eafdb6b95190729479c6fa0d721b400 Mon Sep 17 00:00:00 2001
From: Jonas Kohl
Date: Mon, 16 Sep 2024 11:31:53 +0200
Subject: More i18n
---
src/application/views/form_addpost.php | 11 ++++---
src/application/views/form_login.php | 11 ++++---
src/application/views/form_newtopic.php | 13 +++++---
src/application/views/form_register.php | 23 ++++++++------
src/application/views/nav_logged_in.php | 9 ++----
src/application/views/view_post.php | 20 ++++++------
src/application/views/view_topic_start.php | 43 ++++++++++++--------------
src/application/views/view_topics.php | 2 +-
src/application/views/view_user.php | 49 ++++++++++++++++--------------
9 files changed, 94 insertions(+), 87 deletions(-)
(limited to 'src/application/views')
diff --git a/src/application/views/form_addpost.php b/src/application/views/form_addpost.php
index 88648b4..72dafe5 100644
--- a/src/application/views/form_addpost.php
+++ b/src/application/views/form_addpost.php
@@ -8,7 +8,7 @@ if ($lastFormUri !== $_SERVER["REQUEST_URI"]) $lastForm = [];
RequestUtils::clearLastForm();
?>
-
+
$_formError]);
@@ -16,12 +16,15 @@ if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
?>
diff --git a/src/application/views/form_login.php b/src/application/views/form_login.php
index de8f28c..1ae20a9 100644
--- a/src/application/views/form_login.php
+++ b/src/application/views/form_login.php
@@ -21,21 +21,24 @@ if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
?>
diff --git a/src/application/views/form_newtopic.php b/src/application/views/form_newtopic.php
index 2e58268..a40f3a6 100644
--- a/src/application/views/form_newtopic.php
+++ b/src/application/views/form_newtopic.php
@@ -10,7 +10,7 @@ RequestUtils::clearLastForm();
?>
diff --git a/src/application/views/form_register.php b/src/application/views/form_register.php
index 83f3f4e..a37e5c3 100644
--- a/src/application/views/form_register.php
+++ b/src/application/views/form_register.php
@@ -21,54 +21,57 @@ if (($_formError = RequestUtils::getAndClearFormError()) !== null) {
?>
diff --git a/src/application/views/nav_logged_in.php b/src/application/views/nav_logged_in.php
index 8ed8d07..39c65cb 100644
--- a/src/application/views/nav_logged_in.php
+++ b/src/application/views/nav_logged_in.php
@@ -2,12 +2,9 @@
use mystic\forum\orm\User;
?>
-Welcome,
-id === User::SUPERUSER_ID): ?>
-= htmlentities($user->displayName) ?>!
-
-= htmlentities($user->displayName) ?>!
-
+
= __("Welcome, %user%!", [
+ "user" => ($user->id === User::SUPERUSER_ID) ? ('' . htmlentities($user->displayName) . '') : ('' . htmlentities($user->displayName) . '')
+]) ?>
- View profile
- ">Log out
diff --git a/src/application/views/view_post.php b/src/application/views/view_post.php
index a7624ae..510b22c 100644
--- a/src/application/views/view_post.php
+++ b/src/application/views/view_post.php
@@ -31,7 +31,7 @@ $your_are_the_author = $GLOBALS["currentUser"]?->id === $postAuthor?->id;
- This post has been deleted
+ = __("This post has been deleted") ?>
@@ -41,10 +41,10 @@ $your_are_the_author = $GLOBALS["currentUser"]?->id === $postAuthor?->id;
diff --git a/src/application/views/view_topic_start.php b/src/application/views/view_topic_start.php
index fc54623..35befc7 100644
--- a/src/application/views/view_topic_start.php
+++ b/src/application/views/view_topic_start.php
@@ -16,17 +16,15 @@ $canDelete = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor-
-
-
-
-
+
+
@@ -37,14 +35,14 @@ $canDelete = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor-
- You must be logged in to view attachments
+ = __("You must be logged in to view attachments") ?>
@@ -65,37 +63,34 @@ $canDelete = ($GLOBALS["currentUser"]?->id === $topicAuthor->id && $topicAuthor-
= htmlentities($topic->title) ?>
-
+
-
+
- Started by
-
- = htmlentities($topicAuthor->displayName) ?>
-
- (deleted)
-
- on = htmlentities($topic->creationDate->format("c")) ?>
+ = __("Started by %user% on %date%", [
+ "user" => ($topicAuthor !== null) ? ('' . htmlentities($topicAuthor->displayName) . '') : __("(deleted)"),
+ "date" => '' . htmlentities($topic->creationDate->format("c")) . '',
+ ]); ?>
-
diff --git a/src/application/views/view_topics.php b/src/application/views/view_topics.php
index cb871cb..291fbdc 100644
--- a/src/application/views/view_topics.php
+++ b/src/application/views/view_topics.php
@@ -6,7 +6,7 @@ use mystic\forum\orm\UserPermissions;
if ($GLOBALS["currentUser"]?->hasPermission(UserPermissions::CREATE_OWN_TOPIC)):
?>
- New topic
+ = __("New topic") ?>
diff --git a/src/application/views/view_user.php b/src/application/views/view_user.php
index 79b57d2..536cc33 100644
--- a/src/application/views/view_user.php
+++ b/src/application/views/view_user.php
@@ -12,15 +12,11 @@ $canEdit = ($user->id === $GLOBALS["currentUser"]?->id && $user->hasPermission(U
$isOwnProfile = $user->id === $GLOBALS["currentUser"]?->id;
-$sIsOwn_your = "";
-if ($isOwnProfile)
- $sIsOwn_your = " your";
-
$sUserPossessive = "";
if ($isOwnProfile)
- $sUserPossessive = "Your";
+ $sUserPossessive = "Your posts";
else
- $sUserPossessive = $user->displayName . "'s";
+ $sUserPossessive = "%display_name%'s posts";
$dateJoined = DateTime::createFromImmutable($user->created);
$dateJoined->setTime(0, 0, 0, 0);
@@ -30,9 +26,11 @@ $dateJoined->setTime(0, 0, 0, 0);
= htmlentities($user->displayName) ?>
-
You
+
= __("You") ?>
- @= htmlentities($user->name) ?> •
Member since = htmlentities($dateJoined->format("c")); ?>
+ @= htmlentities($user->name) ?> •
= __("Member since %join_date%", [
+ "join_date" => '' . htmlentities($dateJoined->format("c")) . '',
+ ]) ?>
@@ -40,7 +38,9 @@ $dateJoined->setTime(0, 0, 0, 0);
-
= $sUserPossessive ?> posts
+
= __($sUserPossessive, [
+ "display_name" => $user->displayName,
+]) ?>
0): ?>
-
+
- This user has not posted anything yet
+ = __("This user has not posted anything yet") ?>
@@ -69,7 +72,7 @@ $dateJoined->setTime(0, 0, 0, 0);
--
cgit v1.2.3