From dab00bd98c07aa28c883bda27969a8de451e1a59 Mon Sep 17 00:00:00 2001 From: daudix Date: Mon, 17 Jun 2024 07:33:32 +0300 Subject: [PATCH] Make more strings translatable (I hate how i18n is handled in Zola) --- config.toml | 14 +++++++++++++- templates/anchor-link.html | 2 +- templates/partials/comments.html | 18 ++++++++++-------- templates/partials/footer.html | 8 ++++++-- templates/partials/head.html | 6 ++++-- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/config.toml b/config.toml index 6c3f71d..03d178f 100644 --- a/config.toml +++ b/config.toml @@ -13,14 +13,18 @@ author = "Duck Quack" taxonomies = [{ name = "tags", feed = true }] [translations] +anchor_link = "Anchor link for" archived = "Archived" author = "Author" +blog_post_author = "Blog post author" +boosts_from = "Boosts from" comments = "Comments" comments_description = "You can comment on this blog post by publicly replying to this post using a Mastodon or other ActivityPub/Fediverse account. Known non-private replies are displayed below." -comments_loading = "Loading…" +comments_loading = "Loading" comments_noscript = "Loading comments relies on JavaScript. Try enabling JavaScript and reloading, or visit the original post on Mastodon." disclaimer = "Disclaimer" drafted = "Drafted" +faves_from = "Favorites from" feed = "Feed" file_an_issue = "File an Issue" filter_by_tag = "Filter by tag" @@ -40,6 +44,8 @@ table_of_contents = "Table of Contents" tags = "Tags" tags_in_total = "tags in total" trigger_warning = "Trigger Warning" +view_comment = "View comment at" +view_profile = "View profile at" [languages.ru] title = "Duckquill" @@ -49,14 +55,18 @@ generate_feed = true taxonomies = [{ name = "tags", feed = true }] [languages.ru.translations] +anchor_link = "Якорная ссылка для" archived = "Архивировано" author = "Автор" +blog_post_author = "Автор блог-поста" +boosts_from = "Продвижения с" comments = "Комментарии" comments_description = "Вы можете оставить комментарий к этому блог-посту, публично ответив на него с помощью аккаунта Mastodon или другого аккаунта ActivityPub/Fediverse. Известные неприватные ответы отображены ниже." comments_loading = "Загрузка…" comments_noscript = "Загрузка комментариев зависит от JavaScript. Попробуйте включить JavaScript и перезагрузить, или посетите оригинальный пост на Mastodon." disclaimer = "Дисклеймер" drafted = "Черновик" +faves_from = "Избранное с" feed = "Лента" file_an_issue = "Отправить Отчет об Ошибке" filter_by_tag = "Фильтр по тегам" @@ -76,6 +86,8 @@ table_of_contents = "Оглавление" tags = "Теги" tags_in_total = "тегов в общем" trigger_warning = "Предупреждение о Тревоге" +view_comment = "Показать комментарий на" +view_profile = "Показать профиль на" [markdown] highlight_code = true diff --git a/templates/anchor-link.html b/templates/anchor-link.html index 982d193..0a4ebf0 100644 --- a/templates/anchor-link.html +++ b/templates/anchor-link.html @@ -1 +1 @@ - + diff --git a/templates/partials/comments.html b/templates/partials/comments.html index 52529c5..58aa44b 100644 --- a/templates/partials/comments.html +++ b/templates/partials/comments.html @@ -24,7 +24,9 @@

{{ trans(key="comments_description", lang=lang) }}

- {{ trans(key="load_comments", lang=lang) }} + + {{ trans(key="load_comments", lang=lang) }} +

@@ -68,7 +70,7 @@ function loadComments() { let commentsWrapper = document.getElementById("comments-wrapper"); - document.getElementById("load-comments").innerHTML = "{{ trans(key='comments_loading', lang=lang) }}"; + document.getElementById("load-comments").innerHTML = "{{ trans(key='comments_loading', lang=lang) }}…"; fetch("https://{{ host }}/api/v1/statuses/{{ id }}/context") .then(function (response) { return response.json(); @@ -143,7 +145,7 @@ avatar.setAttribute("rel", "external nofollow"); avatar.setAttribute( "title", - `View profile at @${status.account.username}@${instance}` + `{{ trans(key="view_profile", lang=lang) }} @${status.account.username}@${instance}` ); avatar.appendChild(avatarPicture); @@ -171,7 +173,7 @@ let permalink = document.createElement("a"); permalink.setAttribute("href", status.url); permalink.setAttribute("itemprop", "url"); - permalink.setAttribute("title", `View comment at ${instance}`); + permalink.setAttribute("title", `{{ trans(key="view_comment", lang=lang) }} ${instance}`); permalink.setAttribute("rel", "external nofollow"); permalink.textContent = new Date( status.created_at @@ -193,7 +195,7 @@ let boosts = document.createElement("a"); boosts.className = "boosts"; boosts.setAttribute("href", `${status.url}/reblogs`); - boosts.setAttribute("title", `Boosts from ${instance}`); + boosts.setAttribute("title", `{{ trans(key="boosts_from", lang=lang) }} ${instance}`); let boostsIcon = document.createElement("i"); boostsIcon.className = "icon"; @@ -204,7 +206,7 @@ let faves = document.createElement("a"); faves.className = "faves"; faves.setAttribute("href", `${status.url}/favourites`); - faves.setAttribute("title", `Favorites from ${instance}`); + faves.setAttribute("title", `{{ trans(key="faves_from", lang=lang) }} ${instance}`); let favesIcon = document.createElement("i"); favesIcon.className = "icon"; @@ -229,13 +231,13 @@ avatar.classList.add("op"); avatar.setAttribute( "title", - "Blog post author; " + avatar.getAttribute("title") + "{{ trans(key="blog_post_author", lang=lang) }}: " + avatar.getAttribute("title") ); instanceBadge.classList.add("op"); instanceBadge.setAttribute( "title", - "Blog post author: " + instanceBadge.getAttribute("title") + "{{ trans(key="blog_post_author", lang=lang) }}: " + instanceBadge.getAttribute("title") ); } diff --git a/templates/partials/footer.html b/templates/partials/footer.html index d797ed1..acccd63 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -1,11 +1,15 @@