aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorwinter2024-12-24 17:46:51 +0000
committerwinter2024-12-24 17:46:51 +0000
commit721674973ca0a4d98cd081e9ff130c3356ddac03 (patch)
tree5caa082baa4f23bd8a88f4f268fea6d9233f6553 /templates
parentd5a57276eb27e215dd0b1bd5eb67ac26acc9575b (diff)
implement ui translations using gettext
this was horrible i don't like gettext anymore
Diffstat (limited to 'templates')
-rw-r--r--templates/actor_profile.php8
-rw-r--r--templates/actor_profile_page.php2
-rw-r--r--templates/global_timeline.php4
-rw-r--r--templates/interaction_button.php6
-rw-r--r--templates/local_timeline.php4
-rw-r--r--templates/note.php2
-rw-r--r--templates/placeholder_text.php2
-rw-r--r--templates/skeleton.php6
8 files changed, 17 insertions, 17 deletions
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 @@
<div>
<div class="displayName"><?= $actor->displayName ?></div>
<div class="handle">@<?= $actor->getFullHandle() ?></div>
- <div class="joinedDate">Joined on <?= $actor->created->format('Y-m-d') ?></div>
+ <div class="joinedDate"><?= sprintf(_('Joined on %s'), $actor->created->format('Y-m-d')) ?></div>
</div>
<div>
<?php if (!$actor->isLocal): ?>
- <a class="icon material-symbols-outlined" href="<?= $actor->homepage ?>" title="Open remote profile page"
- target="_blank">open_in_new</a>
+ <a class="icon material-symbols-outlined" href="<?= $actor->homepage ?>"
+ title="<?= _('Open remote profile page') ?>" target="_blank">open_in_new</a>
<?php endif; ?>
</div>
</div>
<?php if (isset($actor->bio) && $actor->bio != '') { ?>
<p class="bio"><?= $actor->bio ?></p>
<?php } else {
- call_template('placeholder_text', ['message' => "This user hasn't written a bio yet."]);
+ call_template('placeholder_text', ['message' => _("This user hasn't written a bio yet.")]);
} ?>
</div> \ 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 '<hr>';
$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 @@
-<?php call_template('skeleton', ['pageTitle' => 'Global timeline'], function () {
+<?php call_template('skeleton', ['pageTitle' => _('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 @@
<?php
$active = $active ?? false;
$tooltip = match ($action) {
- 'like' => '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 @@
-<?php call_template('skeleton', ['pageTitle' => 'Local timeline'], function () {
+<?php call_template('skeleton', ['pageTitle' => _('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 @@
<span class="authorName"><?= $note->author->displayName ?></span>
<span class="authorHandle">@<?= $note->author->getFullHandle() ?></span>
<a class="timestamp" href="/@/<?= $note->author->getFullHandle() ?>/note/<?= $note->id ?>">
- <?=
+ <?= // 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 @@
-<p class="placeholder"><?= $message ?? "There's nothing here." ?></p> \ No newline at end of file
+<p class="placeholder"><?= $message ?? _("There's nothing here.") ?></p> \ 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 @@
<header>
<nav>
<ul>
- <li><a href="/feed/global">Global</a></li>
- <li><a href="/feed/local">Local</a></li>
+ <li><a href="/feed/global"><?= _('Global') ?></a></li>
+ <li><a href="/feed/local"><?= _('Local') ?></a></li>
</ul>
- <span id="siteTitle">Digitigrade</span>
+ <span id="siteTitle"><?= _('Digitigrade') ?></span>
</nav>
</header>
<main>