From 7178c2d6c5c7375be3f7ffb1c2c523e5c2d641e5 Mon Sep 17 00:00:00 2001 From: cutls Date: Sun, 29 Jul 2018 18:43:08 +0900 Subject: [PATCH] TheDesk Akane (16.0.0) - phase:2.1 --- app/js/lang/lang.js | 92 +++++++++++++++++++++++++++++++++++++-- app/js/tl/notification.js | 19 ++++---- app/js/tl/tag.js | 6 +-- app/js/tl/tl.js | 4 +- app/js/ui/layout.js | 33 ++++++++------ app/js/ui/spotify.js | 8 ++-- app/js/ui/tips.js | 4 +- 7 files changed, 127 insertions(+), 39 deletions(-) diff --git a/app/js/lang/lang.js b/app/js/lang/lang.js index 6674e2c0..e6038393 100644 --- a/app/js/lang/lang.js +++ b/app/js/lang/lang.js @@ -216,17 +216,17 @@ var lang_list_remove={ "ja":"リストから削除", "en":"Remove from the list" } -//js/notification.js +//tl/notification.js var lang_notf_new={ "ja":"件の新しい通知", "en":" new notifications" } -//js/speech.js +//tl/speech.js var lang_speech_refresh={ "ja":"音声読み上げ設定を更新しました。", "en":"Refresh setting of TTS" } -//js/src.js +//tl/src.js var lang_src_ts={ "ja":"時系列", "en":"chronological order" @@ -234,4 +234,88 @@ var lang_src_ts={ var lang_src_people={ "ja":"人がトゥート", "en":" people toot" -} \ No newline at end of file +} +//tl/tag.js +var lang_tags_always={ + "ja":"常に", + "en":"Always toots with " +} +var lang_tags_realtime={ + "ja":"実況", + "en":"Tag-stream toot" +} +var lang_tags_tagunpin={ + "ja":"{{tag}}をよく使うタグから削除", + "en":"Unpin {{tag}}" +} +var lang_tags_tagwarn={ + "ja":"次に{{tag}}なしでトゥートするまで全てのトゥートに{{tag}}が付与されます。", + "en":"When you toot without {{tag}}, tag-streaming mode will be off." +} +//tl/tl.js +var lang_tl_media={ + "ja":"メディア", + "en":"Media" +} +//ui/layout.js +var lang_layout_gotop={ + "ja":"一番上へ。アイコンが赤のときはストリーミングに接続できていません。F5等で再読込をお試し下さい。", + "en":"Go top of this column. When icon is red, this column cannot connect straming API. Please reload." +} +var lang_layout_thisacct={ + "ja":"このアカウントの{{notf}}", + "en":"{{notf}} of this account" +} +var lang_layout_delthis={ + "ja":"このカラムを削除", + "en":"Remove this column" +} +var lang_layout_setthis={ + "ja":"このカラムの設定", + "en":"Setting of this column" +} +var lang_layout_mediafil={ + "ja":"メディアフィルター", + "en":"Media filtering" +} +var lang_layout_linkana={ + "ja":"リンク解析", + "en":"Auto Link Analyzer" +} +var lang_layout_linkanades={ + "ja":"リンクの解析を切り替え(OFFで制限を回避出来る場合があります)", + "en":"Auto link analyzer(You may got limitation of API)" +} +var lang_layout_tts={ + "ja":"読み上げ", + "en":"Text to speech " +} +var lang_layout_headercolor={ + "ja":"TLヘッダーカラー", + "en":"Header color of this column" +} +var lang_layout_nodata={ + "ja":"[ここにトゥートはありません。]
F5/⌘+Rで再読込できます。", + "en":"[No data]
F5/⌘+R to reload" +} +var lang_layout_dm={ + "ja":"ダイレクトメッセージ", + "en":"Direct Message" +} +//ui/spotify.js +var lang_spotify_img={ + "ja":"アルバムアートワークを添付します。", + "en":"Attach an album artwork" +} +var lang_spotify_imgno={ + "ja":"アルバムアートワークを添付しません。", + "en":"Not ttach an album artwork" +} +var lang_spotify_acct={ + "ja":"アカウント連携をしてください。", + "en":"Connect TheDesk to Spotify" +} +var lang_spotify_np={ + "ja":"NowPlaying文書を更新しました。", + "en":"Done:templete of NowPlaying" +} diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index 821043ba..7927dfbe 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -173,14 +173,14 @@ function notfToggle(acct, tlid) { notfCanceler(acct) } function notfCanceler(acct){ - $(".notf-reply_" + acct_id).text(0); - $(".notf-reply_" + acct_id).addClass("hide"); - $(".notf-fav_" + acct_id).text(0); - $(".notf-fav_" + acct_id).addClass("hide"); - $(".notf-bt_" + acct_id).text(0); - $(".notf-bt_" + acct_id).addClass("hide"); - $(".notf-follow_" + acct_id).text(0); - $(".notf-follow_" + acct_id).addClass("hide"); + $(".notf-reply_" + acct).text(0); + $(".notf-reply_" + acct).addClass("hide"); + $(".notf-fav_" + acct).text(0); + $(".notf-fav_" + acct).addClass("hide"); + $(".notf-bt_" + acct).text(0); + $(".notf-bt_" + acct).addClass("hide"); + $(".notf-follow_" + acct).text(0); + $(".notf-follow_" + acct).addClass("hide"); $(".notf-icon_" + acct).removeClass("red-text"); } function allNotfRead(){ @@ -199,9 +199,8 @@ function allNotfRead(){ } else { var obj = JSON.parse(multi); } - console.log(obj); - var templete; Object.keys(obj).forEach(function(key) { + console.log(key); notfCanceler(key) }); } diff --git a/app/js/tl/tag.js b/app/js/tl/tag.js index 94a5b550..3e58997c 100644 --- a/app/js/tl/tag.js +++ b/app/js/tl/tag.js @@ -56,8 +56,8 @@ function favTag(){ var tags=""; Object.keys(obj).forEach(function(key) { var tag = obj[key]; - tags = tags + '#' + tag + ' TL Toot '+ - '実況 削除 '; + tags = tags + '#' + tag + ' TL Toot '+ + ''+lang_tags_realtime[lang]+' '+lang_del[lang]+' '; }); if(obj.length>0){ $("#taglist").append("My Tags:" + tags); @@ -108,5 +108,5 @@ function tagTL(a,b,c,d){ } function autoToot(tag){ localStorage.setItem("stable",tag); - Materialize.toast("次に"+tag+"なしでトゥートするまで全てのトゥートに"+tag+"が付与されます。",3000); + Materialize.toast(lang_tags_tagwarn[lang].replace("{{tag}}" ,'#'+tag.name),3000); } \ No newline at end of file diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 6c1fafa0..225ef0f2 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -331,7 +331,7 @@ function cap(type, data, acct_id) { } } else if (type == "local-media") { if(localStorage.getItem("local_" + acct_id) && !locale){ - var response=localStorage.getItem("local_" + acct_id)+"(メディア)"; + var response=localStorage.getItem("local_" + acct_id)+"("+lang_tl_media[lang]+")"; }else{ var response="Local TL(Media)"; } @@ -343,7 +343,7 @@ function cap(type, data, acct_id) { } } else if (type == "pub-media") { if(localStorage.getItem("public_" + acct_id) && !locale){ - var response=localStorage.getItem("public_" + acct_id)+"(メディア)"; + var response=localStorage.getItem("public_" + acct_id)+"("+lang_tl_media[lang]+")"; }else{ var response="Federated TL(Media)"; } diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 95d2900c..ac542182 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -75,9 +75,14 @@ function parseColumn() { var notf_attr=''; } if(localStorage.getItem("notification_" + acct.domain)){ - var unique_notf=localStorage.getItem("notification_" + acct.domain); + var unique_notf=lang_layout_thisacct[lang].replace("{{notf}}" ,localStorage.getItem("notification_" + acct.domain)); }else{ - var unique_notf="通知"; + if(lang=="ja"){ + var notflocale="通知"; + }else if(lang=="en"){ + var notflocale="Notification"; + } + var unique_notf=lang_layout_thisacct[lang].replace("{{notf}}" ,notflocale); } var insert=""; var icnsert=""; @@ -104,26 +109,26 @@ function parseColumn() { } var html = '
'+ '
'+ + ')" class="setting nex" title="'+lang_layout_setthis[lang]+'"'+icnsert+'>settings'+ '
perm_mediaOnメディアフィルター
linkOnリンク解析
hearingOn読み上げTL
TLヘッダーの色
[ここにトゥートはありません。]
F5/⌘+Rで再読込できます。
'; + ')" class="setting nex">perm_mediaOn'+lang_layout_mediafil[lang]+'
linkOn'+lang_layout_linkana[lang]+'
hearingOn'+lang_layout_tts[lang]+'TL
'+lang_layout_headercolor[lang]+'
'+lang_layout_nodata[lang]+'
'; $("#timeline-container").append(html); localStorage.removeItem("pool_" + key); if (acct.data) { @@ -204,7 +209,7 @@ function addselCk(){ $("#noauth").addClass("hide"); } if(domain=="knzk.me" || domain=="mstdn.y-zu.org"){ - $("#type-sel").append(''); + $("#type-sel").append(''); $('#type-sel').material_select('update'); }else{ $("#direct-add").remove(); diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index 40e210c7..3a6a2dba 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -57,10 +57,10 @@ function spotifyFlagSave(){ var awk = $("[name=awk]:checked").val(); if(awk=="yes"){ localStorage.setItem("artwork","yes"); - Materialize.toast("アルバムアートワークを添付します。", 3000); + Materialize.toast(lang_spotify_img[lang], 3000); }else{ localStorage.removeItem("artwork"); - Materialize.toast("アルバムアートワークを添付しません。", 3000); + Materialize.toast(lang_spotify_imgno[lang], 3000); } } function nowplaying(mode){ @@ -115,7 +115,7 @@ function nowplaying(mode){ $("#textarea").val(content); }); }else{ - alert("アカウント連携設定をして下さい。"); + alert(lang_spotify_acct[lang]); } }else if(mode=="itunes"){ var electron = require("electron"); @@ -155,7 +155,7 @@ function nowplaying(mode){ function spotifySave(){ var temp=$("#np-temp").val(); localStorage.setItem("np-temp", temp); - Materialize.toast("NowPlaying文章を更新しました。", 3000); + Materialize.toast(lang_spotify_np[lang], 3000); } if(location.search){ var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/); diff --git a/app/js/ui/tips.js b/app/js/ui/tips.js index 26a31e13..d5e1a8a6 100644 --- a/app/js/ui/tips.js +++ b/app/js/ui/tips.js @@ -128,7 +128,7 @@ function spotifytips(){ spotint=setInterval(spotStart, 1000); }); }else{ - alert("アカウント連携設定をして下さい。"); + alert(lang_spotify_acct[lang]); } } function spotStart(){ @@ -172,7 +172,7 @@ function clockStart(){ if(nowMin<10){nowMin="0"+nowMin } var nowSec = nowTime.getSeconds(); // 秒を抜き出す if(nowSec<10){nowSec="0"+nowSec } - var msg = nowTime.getFullYear()+"年"+(nowTime.getMonth()+1)+"月"+nowTime.getDate()+'日'+nowHour + ":" + nowMin + ":" + nowSec+""; + var msg = nowTime.getFullYear()+"/"+(nowTime.getMonth()+1)+"/"+nowTime.getDate()+''+nowHour + ":" + nowMin + ":" + nowSec+""; $("#tips-text").html(msg); } function sleep(waitMsec) {