From e634b2576c5ab9f54e808e2c651560b4e286618c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Fri, 26 May 2023 16:02:25 +0900 Subject: [PATCH] =?UTF-8?q?SNS=E3=82=AB=E3=83=BC=E3=83=89=E3=82=92?= =?UTF-8?q?=E6=B2=BB=E3=81=A3=E3=81=9F=E3=81=A8=E6=80=9D=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nitter.example.conf | 2 +- src/formatters.nim | 4 ++-- src/prefs_impl.nim | 12 ++++++------ src/views/general.nim | 8 +++++--- src/views/preferences.nim | 2 +- src/views/profile.nim | 4 ++-- tests/test_profile.py | 6 +++--- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/nitter.example.conf b/nitter.example.conf index c5af7d0..c342d62 100644 --- a/nitter.example.conf +++ b/nitter.example.conf @@ -3,7 +3,7 @@ hostname = "twitter.owacon.moe" title = "オワコンTwitter" address = "0.0.0.0" port = 8088 -https = false # disable to enable cookies when not using https +https = true # disable to enable cookies when not using https httpMaxConnections = 100 staticDir = "./public" diff --git a/src/formatters.nim b/src/formatters.nim index 71f4714..913a190 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -139,10 +139,10 @@ proc pageDesc*(user: User): string = if user.bio.len > 0: stripHtml(user.bio) else: - "The latest tweets from " & user.fullname + user.fullname & "さんから最新のツイート" proc getJoinDate*(user: User): string = - user.joinDate.format("'Joined' MMMM YYYY") + user.joinDate.format("YYYY'年'MM'月に参加'") proc getJoinDateFull*(user: User): string = user.joinDate.format("h:mm tt - d MMM YYYY") diff --git a/src/prefs_impl.nim b/src/prefs_impl.nim index 434bb4c..ec917d8 100644 --- a/src/prefs_impl.nim +++ b/src/prefs_impl.nim @@ -50,7 +50,7 @@ macro genPrefs*(prefDsl: untyped) = const `name`*: PrefList = toOrderedTable(`table`) genPrefs: - Display: + "表示": theme(select, "Nitter"): "テーマ" @@ -58,10 +58,10 @@ genPrefs: "無限スクロール(JS必須)" stickyProfile(checkbox, true): - "Make profile sidebar stick to top" + "プロフィールサイドバーはページ上に付く" bidiSupport(checkbox, false): - "Support bidirectional text (makes clicking on tweets harder)" + "両方向文字対応(ツイートをクリックしにくくなる)" hideTweetStats(checkbox, false): "ツイートの詳細(返事、RT、いいね)を隠す" @@ -76,9 +76,9 @@ genPrefs: "ツイートに返事を隠す" squareAvatars(checkbox, false): - "Square profile pictures" + "四角形プロフィールアイコン" - Media: + "メディア": mp4Playback(checkbox, true): "MP4再生(GIFのみ)" @@ -94,7 +94,7 @@ genPrefs: autoplayGifs(checkbox, true): "自動的にGIFの再生" - "Link replacements (blank to disable)": + "リンクの変換(無効にするには、かっこにして下さい)": replaceTwitter(input, "twitter.owacon.moe"): "ツイッター → Nitter" placeholder: "twitter.owacon.moe" diff --git a/src/views/general.nim b/src/views/general.nim index 5e96d02..d7dfffd 100644 --- a/src/views/general.nim +++ b/src/views/general.nim @@ -90,8 +90,10 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; meta(property="og:type", content=ogType) meta(property="og:title", content=(if ogTitle.len > 0: ogTitle else: titleText)) meta(property="og:description", content=stripHtml(desc)) - meta(property="og:site_name", content="Nitter") - meta(property="og:locale", content="en_US") + meta(property="og:site_name", content="オワコンTwitter") + meta(property="og:locale", content="ja_JP") + meta(property="twitter:title", content=(if ogTitle.len > 0: ogTitle else: titleText)) + meta(property="twitter:description", content=stripHtml(desc)) if banner.len > 0 and not banner.startsWith('#'): let bannerUrl = getPicUrl(banner) @@ -104,7 +106,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc=""; let image = getUrlPrefix(cfg) & getPicUrl(url) meta(property="og:image", content=image) - meta(property="twitter:image:src", content=image) + meta(property="twitter:image", content=image) if rss.len > 0: meta(property="twitter:card", content="summary") diff --git a/src/views/preferences.nim b/src/views/preferences.nim index 0ce4687..8c697c5 100644 --- a/src/views/preferences.nim +++ b/src/views/preferences.nim @@ -41,7 +41,7 @@ proc renderPreferences*(prefs: Prefs; path: string; themes: seq[string]): VNode renderPrefs() h4(class="note"): - text "Preferences are stored client-side using cookies without any personal information." + text "設定は個人情報無しのクッキーとしてクライエントサイドで保存されます。" button(`type`="submit", class="pref-submit"): text "保存" diff --git a/src/views/profile.nim b/src/views/profile.nim index 2b2e410..c30ed42 100644 --- a/src/views/profile.nim +++ b/src/views/profile.nim @@ -68,11 +68,11 @@ proc renderPhotoRail(profile: Profile): VNode = buildHtml(tdiv(class="photo-rail-card")): tdiv(class="photo-rail-header"): a(href=(&"/{profile.user.username}/media")): - icon "picture", count & " Photos and videos" + icon "picture", count & "枚画像や動画" input(id="photo-rail-grid-toggle", `type`="checkbox") label(`for`="photo-rail-grid-toggle", class="photo-rail-header-mobile"): - icon "picture", count & " Photos and videos" + icon "picture", count & "枚画像や動画" icon "down" tdiv(class="photo-rail-grid"): diff --git a/tests/test_profile.py b/tests/test_profile.py index f9b5047..bb4ecba 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -4,8 +4,8 @@ from parameterized import parameterized profiles = [ ['mobile_test', 'Test account', 'Test Account. test test Testing username with @mobile_test_2 and a #hashtag', - 'San Francisco, CA', 'example.com/foobar', 'Joined October 2009', '100'], - ['mobile_test_2', 'mobile test 2', '', '', '', 'Joined January 2011', '13'] + 'San Francisco, CA', 'example.com/foobar', '2009年10月に参加', '100'], + ['mobile_test_2', 'mobile test 2', '', '', '', '2011年1月に参加', '13'] ] verified = [['jack'], ['elonmusk']] @@ -34,7 +34,7 @@ class ProfileTest(BaseTestCase): (location, Profile.location), (website, Profile.website), (joinDate, Profile.joinDate), - (mediaCount + " Photos and videos", Profile.mediaCount) + (mediaCount + "枚画像や動画", Profile.mediaCount) ] for text, selector in tests: