Add Reddit comment permalink

This commit is contained in:
Omar Roth 2019-07-01 12:37:28 -05:00
parent aac240fe41
commit c47f1ae236
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
15 changed files with 28 additions and 14 deletions

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "", "%A %B %-d, %Y": "",
"(edited)": "(تم تعديلة)", "(edited)": "(تم تعديلة)",
"YouTube comment permalink": "رابط التعليق على اليوتيوب", "YouTube comment permalink": "رابط التعليق على اليوتيوب",
"permalink": "",
"`x` marked it with a ❤": "`x` اعجب بهذا", "`x` marked it with a ❤": "`x` اعجب بهذا",
"Audio mode": "الوضع الصوتى", "Audio mode": "الوضع الصوتى",
"Video mode": "وضع الفيديو", "Video mode": "وضع الفيديو",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%A %B %-d, %Y", "%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(editiert)", "(edited)": "(editiert)",
"YouTube comment permalink": "YouTube-Kommentar Permalink", "YouTube comment permalink": "YouTube-Kommentar Permalink",
"permalink": "",
"`x` marked it with a ❤": "`x` markierte es mit einem ❤", "`x` marked it with a ❤": "`x` markierte es mit einem ❤",
"Audio mode": "Audiomodus", "Audio mode": "Audiomodus",
"Video mode": "Videomodus", "Video mode": "Videomodus",

View file

@ -355,6 +355,7 @@
"%A %B %-d, %Y": "%A %B %-d, %Y", "%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(τροποποιημένο)", "(edited)": "(τροποποιημένο)",
"YouTube comment permalink": "Σύνδεσμος YouTube σχολίου", "YouTube comment permalink": "Σύνδεσμος YouTube σχολίου",
"permalink": "",
"`x` marked it with a ❤": "Ο χρηστης `x` έβαλε ❤", "`x` marked it with a ❤": "Ο χρηστης `x` έβαλε ❤",
"Audio mode": "Λειτουργία ήχου", "Audio mode": "Λειτουργία ήχου",
"Video mode": "Λειτουργία βίντεο", "Video mode": "Λειτουργία βίντεο",

View file

@ -355,6 +355,7 @@
"%A %B %-d, %Y": "%A %B %-d, %Y", "%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(edited)", "(edited)": "(edited)",
"YouTube comment permalink": "YouTube comment permalink", "YouTube comment permalink": "YouTube comment permalink",
"permalink": "",
"`x` marked it with a ❤": "`x` marked it with a ❤", "`x` marked it with a ❤": "`x` marked it with a ❤",
"Audio mode": "Audio mode", "Audio mode": "Audio mode",
"Video mode": "Video mode", "Video mode": "Video mode",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%A %-d de %B %Y", "%A %B %-d, %Y": "%A %-d de %B %Y",
"(edited)": "(redaktita)", "(edited)": "(redaktita)",
"YouTube comment permalink": "Fiksligilo de la komento en YouTube", "YouTube comment permalink": "Fiksligilo de la komento en YouTube",
"permalink": "",
"`x` marked it with a ❤": "`x` markis ĝin per ❤", "`x` marked it with a ❤": "`x` markis ĝin per ❤",
"Audio mode": "Aŭda reĝimo", "Audio mode": "Aŭda reĝimo",
"Video mode": "Videa reĝimo", "Video mode": "Videa reĝimo",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%A %B %-d, %Y", "%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(editado)", "(edited)": "(editado)",
"YouTube comment permalink": "Enlace permanente de YouTube del comentario", "YouTube comment permalink": "Enlace permanente de YouTube del comentario",
"permalink": "",
"`x` marked it with a ❤": "`x` lo ha marcado con un ❤", "`x` marked it with a ❤": "`x` lo ha marcado con un ❤",
"Audio mode": "Modo de audio", "Audio mode": "Modo de audio",
"Video mode": "Modo de vídeo", "Video mode": "Modo de vídeo",

View file

@ -309,6 +309,7 @@
"%A %B %-d, %Y": "", "%A %B %-d, %Y": "",
"(edited)": "", "(edited)": "",
"YouTube comment permalink": "", "YouTube comment permalink": "",
"permalink": "",
"`x` marked it with a ❤": "", "`x` marked it with a ❤": "",
"Audio mode": "", "Audio mode": "",
"Video mode": "", "Video mode": "",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%A %-d %B %Y", "%A %B %-d, %Y": "%A %-d %B %Y",
"(edited)": "(modifié)", "(edited)": "(modifié)",
"YouTube comment permalink": "Lien YouTube permanent vers le commentaire", "YouTube comment permalink": "Lien YouTube permanent vers le commentaire",
"permalink": "",
"`x` marked it with a ❤": "`x` l'a marqué d'un ❤", "`x` marked it with a ❤": "`x` l'a marqué d'un ❤",
"Audio mode": "Mode Audio", "Audio mode": "Mode Audio",
"Video mode": "Mode Vidéo", "Video mode": "Mode Vidéo",

View file

@ -309,6 +309,7 @@
"%A %B %-d, %Y": "%A %-d %B %Y", "%A %B %-d, %Y": "%A %-d %B %Y",
"(edited)": "(modificato)", "(edited)": "(modificato)",
"YouTube comment permalink": "Link permanente al commento di YouTube", "YouTube comment permalink": "Link permanente al commento di YouTube",
"permalink": "",
"`x` marked it with a ❤": "`x` l'ha contrassegnato con un ❤", "`x` marked it with a ❤": "`x` l'ha contrassegnato con un ❤",
"Audio mode": "Modalità audio", "Audio mode": "Modalità audio",
"Video mode": "Modalità video", "Video mode": "Modalità video",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "", "%A %B %-d, %Y": "",
"(edited)": "(redigert)", "(edited)": "(redigert)",
"YouTube comment permalink": "Permanent YouTube-lenke til innholdet", "YouTube comment permalink": "Permanent YouTube-lenke til innholdet",
"permalink": "",
"`x` marked it with a ❤": "`x` levnet et ❤", "`x` marked it with a ❤": "`x` levnet et ❤",
"Audio mode": "Lydmodus", "Audio mode": "Lydmodus",
"Video mode": "Video-modus", "Video mode": "Video-modus",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%A %B %-d, %Y", "%A %B %-d, %Y": "%A %B %-d, %Y",
"(edited)": "(bewerkt)", "(edited)": "(bewerkt)",
"YouTube comment permalink": "Link naar YouTube-reactie", "YouTube comment permalink": "Link naar YouTube-reactie",
"permalink": "",
"`x` marked it with a ❤": "`x` heeft dit gemarkeerd met ❤", "`x` marked it with a ❤": "`x` heeft dit gemarkeerd met ❤",
"Audio mode": "Audiomodus", "Audio mode": "Audiomodus",
"Video mode": "Videomodus", "Video mode": "Videomodus",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "", "%A %B %-d, %Y": "",
"(edited)": "(edytowany)", "(edited)": "(edytowany)",
"YouTube comment permalink": "Odnośnik bezpośredni do komentarza na YouTube", "YouTube comment permalink": "Odnośnik bezpośredni do komentarza na YouTube",
"permalink": "",
"`x` marked it with a ❤": "`x` oznaczonych ❤", "`x` marked it with a ❤": "`x` oznaczonych ❤",
"Audio mode": "Tryb audio", "Audio mode": "Tryb audio",
"Video mode": "Tryb wideo", "Video mode": "Tryb wideo",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%-d %B %Y, %A", "%A %B %-d, %Y": "%-d %B %Y, %A",
"(edited)": "(изменено)", "(edited)": "(изменено)",
"YouTube comment permalink": "Прямая ссылка на YouTube", "YouTube comment permalink": "Прямая ссылка на YouTube",
"permalink": "",
"`x` marked it with a ❤": "❤ от автора канала \"`x`\"", "`x` marked it with a ❤": "❤ от автора канала \"`x`\"",
"Audio mode": "Аудио режим", "Audio mode": "Аудио режим",
"Video mode": "Видео режим", "Video mode": "Видео режим",

View file

@ -310,6 +310,7 @@
"%A %B %-d, %Y": "%-d %B %Y, %A", "%A %B %-d, %Y": "%-d %B %Y, %A",
"(edited)": "(змінено)", "(edited)": "(змінено)",
"YouTube comment permalink": "Пряме посилання на коментар в YouTube", "YouTube comment permalink": "Пряме посилання на коментар в YouTube",
"permalink": "",
"`x` marked it with a ❤": "❤ цьому від каналу `x`", "`x` marked it with a ❤": "❤ цьому від каналу `x`",
"Audio mode": "Аудіорежим", "Audio mode": "Аудіорежим",
"Video mode": "Відеорежим", "Video mode": "Відеорежим",

View file

@ -22,6 +22,7 @@ class RedditComment
replies: RedditThing | String, replies: RedditThing | String,
score: Int32, score: Int32,
depth: Int32, depth: Int32,
permalink: String,
created_utc: { created_utc: {
type: Time, type: Time,
converter: RedditComment::TimeConverter, converter: RedditComment::TimeConverter,
@ -363,8 +364,6 @@ def template_reddit_comments(root, locale)
root.each do |child| root.each do |child|
if child.data.is_a?(RedditComment) if child.data.is_a?(RedditComment)
child = child.data.as(RedditComment) child = child.data.as(RedditComment)
author = child.author
score = child.score
body_html = HTML.unescape(child.body_html) body_html = HTML.unescape(child.body_html)
replies_html = "" replies_html = ""
@ -376,13 +375,14 @@ def template_reddit_comments(root, locale)
content = <<-END_HTML content = <<-END_HTML
<p> <p>
<a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a> <a href="javascript:void(0)" onclick="toggle_parent(this)">[ - ]</a>
<b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b> <b><a href="https://www.reddit.com/user/#{child.author}">#{child.author}</a></b>
#{translate(locale, "`x` points", number_with_separator(score))} #{translate(locale, "`x` points", number_with_separator(child.score))}
#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))} <span title="#{child.created_utc.to_s(translate(locale, "%a %B %-d %T %Y UTC"))}">#{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}</span>
</p> <a href="https://www.reddit.com#{child.permalink}" title="#{translate(locale, "permalink")}">#{translate(locale, "permalink")}</a>
<div> </p>
#{body_html} <div>
#{replies_html} #{body_html}
#{replies_html}
</div> </div>
END_HTML END_HTML