From 721674973ca0a4d98cd081e9ff130c3356ddac03 Mon Sep 17 00:00:00 2001
From: winter
Date: Tue, 24 Dec 2024 17:46:51 +0000
Subject: implement ui translations using gettext
this was horrible i don't like gettext anymore
---
templates/actor_profile.php | 8 ++++----
templates/actor_profile_page.php | 2 +-
templates/global_timeline.php | 4 ++--
templates/interaction_button.php | 6 +++---
templates/local_timeline.php | 4 ++--
templates/note.php | 2 +-
templates/placeholder_text.php | 2 +-
templates/skeleton.php | 6 +++---
8 files changed, 17 insertions(+), 17 deletions(-)
(limited to 'templates')
diff --git a/templates/actor_profile.php b/templates/actor_profile.php
index f721fc8..c5b86c4 100644
--- a/templates/actor_profile.php
+++ b/templates/actor_profile.php
@@ -4,18 +4,18 @@
= $actor->displayName ?>
@= $actor->getFullHandle() ?>
-
Joined on = $actor->created->format('Y-m-d') ?>
+
= sprintf(_('Joined on %s'), $actor->created->format('Y-m-d')) ?>
bio) && $actor->bio != '') { ?>
= $actor->bio ?>
"This user hasn't written a bio yet."]);
+ call_template('placeholder_text', ['message' => _("This user hasn't written a bio yet.")]);
} ?>
\ No newline at end of file
diff --git a/templates/actor_profile_page.php b/templates/actor_profile_page.php
index ffa94e3..bd60e2c 100644
--- a/templates/actor_profile_page.php
+++ b/templates/actor_profile_page.php
@@ -11,7 +11,7 @@ call_template('skeleton', [
echo '
';
$notes = Note::findAllWithAuthor($actor, 50);
if (count($notes) == 0) {
- call_template('placeholder_text', ['message' => "This user hasn't posted anything yet."]);
+ call_template('placeholder_text', ['message' => _("This user hasn't posted anything yet.")]);
}
foreach ($notes as $n) {
call_template('note', ['note' => $n]);
diff --git a/templates/global_timeline.php b/templates/global_timeline.php
index bf91df0..f8fca52 100644
--- a/templates/global_timeline.php
+++ b/templates/global_timeline.php
@@ -1,8 +1,8 @@
- 'Global timeline'], function () {
+ _('Global timeline')], function () {
global $notes;
call_template('alertbox', [
'variety' => 'info',
- 'message' => 'This timeline shows all known public indexable notes.'
+ 'message' => _('This timeline shows all known public indexable notes.')
]);
foreach ($notes as $n) {
call_template('note', ['note' => $n]);
diff --git a/templates/interaction_button.php b/templates/interaction_button.php
index ed257df..40fe392 100644
--- a/templates/interaction_button.php
+++ b/templates/interaction_button.php
@@ -1,9 +1,9 @@
'Like',
- 'dislike' => 'Dislike',
- 'reshare' => 'Reshare'
+ 'like' => _('Like'),
+ 'dislike' => _('Dislike'),
+ 'reshare' => _('Reshare')
};
$icon = match ($action) {
'like' => 'favorite',
diff --git a/templates/local_timeline.php b/templates/local_timeline.php
index f93300a..ec894a9 100644
--- a/templates/local_timeline.php
+++ b/templates/local_timeline.php
@@ -1,8 +1,8 @@
- 'Local timeline'], function () {
+ _('Local timeline')], function () {
global $notes;
call_template('alertbox', [
'variety' => 'info',
- 'message' => 'This timeline shows all public indexable notes posted by users on this server.'
+ 'message' => _('This timeline shows all public indexable notes posted by users on this server.')
]);
foreach ($notes as $n) {
call_template('note', ['note' => $n]);
diff --git a/templates/note.php b/templates/note.php
index 8887afb..83770aa 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -7,7 +7,7 @@
= $note->author->displayName ?>
@= $note->author->getFullHandle() ?>
- =
+ = // TODO: localise
$note->created->format('Y-m-d \a\t H:i')
. (isset($note->modified) && $note->modified != $note->created
? ' (edited ' . $note->modified->format('Y-m-d \a\t H:i') . ')'
diff --git a/templates/placeholder_text.php b/templates/placeholder_text.php
index b27e490..1f03ebc 100644
--- a/templates/placeholder_text.php
+++ b/templates/placeholder_text.php
@@ -1 +1 @@
-= $message ?? "There's nothing here." ?>
\ No newline at end of file
+= $message ?? _("There's nothing here.") ?>
\ No newline at end of file
diff --git a/templates/skeleton.php b/templates/skeleton.php
index 9cc4636..49e4386 100644
--- a/templates/skeleton.php
+++ b/templates/skeleton.php
@@ -14,10 +14,10 @@
--
cgit v1.3