From 76a1aa5fe2823d97089a3c109a175b95a73d7fd5 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 16:02:03 -0800 Subject: [PATCH 01/16] Rename/re-icon "favorites" to "bookmarks": closes #9176 --- locales/en-US.yml | 18 +++--- packages/client/src/navbar.ts | 2 +- packages/client/src/pages/favorites.vue | 62 ++++++++++++-------- packages/client/src/scripts/get-note-menu.ts | 6 +- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 6ad3bf614..f58296b9f 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -32,12 +32,12 @@ uploading: "Uploading..." save: "Save" users: "Users" addUser: "Add a user" -favorite: "Add to favorites" -favorites: "Favorites" -unfavorite: "Remove from favorites" -favorited: "Added to favorites." -alreadyFavorited: "Already added to favorites." -cantFavorite: "Couldn't add to favorites." +favorite: "Add to bookmarks" +favorites: "Bookmarks" +unfavorite: "Remove from bookmarks" +favorited: "Added to bookmarks." +alreadyFavorited: "Already added to bookmarks." +cantFavorite: "Couldn't add to bookmarks." pin: "Pin to profile" unpin: "Unpin from profile" copyContent: "Copy contents" @@ -679,7 +679,7 @@ disableShowingAnimatedImages: "Don't play animated images" verificationEmailSent: "A verification email has been sent. Please follow the included link to complete verification." notSet: "Not set" emailVerified: "Email has been verified" -noteFavoritesCount: "Number of favorite notes" +noteFavoritesCount: "Number of bookmarked notes" pageLikesCount: "Number of liked Pages" pageLikedCount: "Number of received Page likes" contact: "Contact" @@ -1250,8 +1250,8 @@ _permissions: "write:blocks": "Edit your list of blocked users" "read:drive": "Access your Drive files and folders" "write:drive": "Edit or delete your Drive files and folders" - "read:favorites": "View your list of favorites" - "write:favorites": "Edit your list of favorites" + "read:favorites": "View your list of bookmarks" + "write:favorites": "Edit your list of bookmarks" "read:following": "View information on who you follow" "write:following": "Follow or unfollow other accounts" "read:messaging": "View your chats" diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 308f3f96b..6785428a5 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -72,7 +72,7 @@ export const navbarItemDef = reactive({ }, favorites: { title: 'favorites', - icon: 'ph-star-bold ph-lg', + icon: 'ph-bookmark-simple-bold ph-lg', show: computed(() => $i != null), to: '/my/favorites', }, diff --git a/packages/client/src/pages/favorites.vue b/packages/client/src/pages/favorites.vue index c2a6b0600..4895af18d 100644 --- a/packages/client/src/pages/favorites.vue +++ b/packages/client/src/pages/favorites.vue @@ -1,35 +1,45 @@ diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index 0e53aad2a..9c52b2e24 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -231,12 +231,12 @@ export function getNoteMenu(props: { action: translate, } : undefined, null, - statePromise.then(state => state.isFavorited ? { - icon: 'ph-star-bold ph-lg', + statePromise.then(state => state?.isFavorited ? { + icon: 'ph-bookmark-simple-bold ph-lg', text: i18n.ts.unfavorite, action: () => toggleFavorite(false), } : { - icon: 'ph-star-bold ph-lg', + icon: 'ph-bookmark-simple-bold ph-lg', text: i18n.ts.favorite, action: () => toggleFavorite(true), }), From d97fe8a4b3d833669412de4322b00c1ea64b7276 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 22:39:50 -0800 Subject: [PATCH 02/16] No hover cursor on mobile --- packages/client/src/components/MkNote.vue | 4 ++++ packages/client/src/components/MkNoteDetailed.vue | 9 ++++++++- packages/client/src/components/MkNoteSub.vue | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 20d2bbee4..613203091 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -428,6 +428,10 @@ function readPromo() { padding: 28px 32px 18px; cursor: pointer; + @media (pointer: coarse) { + cursor: default; + } + > .avatar { flex-shrink: 0; display: block; diff --git a/packages/client/src/components/MkNoteDetailed.vue b/packages/client/src/components/MkNoteDetailed.vue index 54d7ec0ca..2deb18441 100644 --- a/packages/client/src/components/MkNoteDetailed.vue +++ b/packages/client/src/components/MkNoteDetailed.vue @@ -347,7 +347,10 @@ if (appearNote.replyId) { > .reply-to-more { opacity: 0.7; cursor: pointer; - + + @media (pointer: coarse) { + cursor: default; + } } > .renote { @@ -546,6 +549,10 @@ if (appearNote.replyId) { > .reply { border-top: solid 0.5px var(--divider); cursor: pointer; + + @media (pointer: coarse) { + cursor: default; + } } > .reply, .reply-to, .reply-to-more { diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index c1943920d..5a3539222 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -88,6 +88,10 @@ const replies: misskey.entities.Note[] = props.conversation?.filter(item => item flex: 1; min-width: 0; cursor: pointer; + + @media (pointer: coarse) { + cursor: default; + } > .header { margin-bottom: 2px; From 1638e3396426fb4113536dcb27dda2d4a6c2308c Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:11:11 -0800 Subject: [PATCH 03/16] Renote confirmation (closes #9051 & #9166) --- CALCKEY.md | 1 + .../client/src/components/MkRenoteButton.vue | 59 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 892c79607..dfcb191e4 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -89,6 +89,7 @@ - Patron list - Animations respect reduced motion - Obliteration of Ai-chan +- Undo renote button inside original note - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index c3cc5794e..7550c4ab0 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -55,29 +55,45 @@ useTooltip(buttonRef, async (showing) => { const renote = (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); - if (defaultStore.state.seperateRenoteQuote) { - os.api('notes/create', { - renoteId: props.note.id, - visibility: props.note.visibility, - }); - const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; - if (el) { - const rect = el.getBoundingClientRect(); - const x = rect.left + (el.offsetWidth / 2); - const y = rect.top + (el.offsetHeight / 2); - os.popup(Ripple, { x, y }, {}, 'end'); - } - } else { - os.popupMenu([{ - text: i18n.ts.renote, - icon: 'ph-repeat-bold ph-lg', + let buttonActions = [{ + text: i18n.ts.renote, + icon: 'ph-repeat-bold ph-lg', + action: () => { + os.api('notes/create', { + renoteId: props.note.id, + visibility: props.note.visibility, + }); + const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; + if (el) { + const rect = el.getBoundingClientRect(); + const x = rect.left + (el.offsetWidth / 2); + const y = rect.top + (el.offsetHeight / 2); + os.popup(Ripple, { x, y }, {}, 'end'); + } + }, + }]; + let users; + os.api('notes/renotes', { + noteId: props.note.id, + limit: 11, + }).then((renotes) => { + users = renotes.map(x => x.user); + }); + const hasRenotedBefore = users.includes($i); + + if (hasRenotedBefore) { + buttonActions.push({ + text: i18n.ts.unrenote, + icon: 'ph-eraser-bold ph-lg', action: () => { - os.api('notes/create', { - renoteId: props.note.id, - visibility: props.note.visibility, + os.api('notes/unrenote', { + noteId: props.note.id, }); }, - }, { + }); + } + if (!defaultStore.state.seperateRenoteQuote) { + buttonActions.push({ text: i18n.ts.quote, icon: 'ph-quotes-bold ph-lg', action: () => { @@ -85,10 +101,9 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { renote: props.note, }); }, - }], buttonRef.value, { - viaKeyboard, }); } + os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard }); }; From b262272a23ba77cf2a52ff58500faa9f42610f26 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:13:08 -0800 Subject: [PATCH 04/16] Release candidate 8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2651c05f5..53e6b1abd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.7", + "version": "12.119.0-calc.18-rc.8", "codename": "aqua", "repository": { "type": "git", From 55b76cde929c30c51073fe9cdd5660945f6ad589 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:19:37 -0800 Subject: [PATCH 05/16] fix --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 53e6b1abd..a4923241d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.8", + "version": "12.119.0-calc.18-rc.9", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 7550c4ab0..cee568772 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -53,7 +53,7 @@ useTooltip(buttonRef, async (showing) => { }, {}, 'closed'); }); -const renote = (viaKeyboard = false, ev?: MouseEvent) => { +const renote = async (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); let buttonActions = [{ text: i18n.ts.renote, @@ -72,13 +72,12 @@ const renote = (viaKeyboard = false, ev?: MouseEvent) => { } }, }]; - let users; - os.api('notes/renotes', { + const renotes = await os.api('notes/renotes', { noteId: props.note.id, limit: 11, - }).then((renotes) => { - users = renotes.map(x => x.user); }); + + const users = renotes.map(x => x.user); const hasRenotedBefore = users.includes($i); if (hasRenotedBefore) { From 5769298b17cee93f2fc766d7ce52cda65022e0a4 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:22:43 -0800 Subject: [PATCH 06/16] fix --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a4923241d..4d0963fc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.9", + "version": "12.119.0-calc.18-rc.10", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index cee568772..39dce4948 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -77,8 +77,8 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { limit: 11, }); - const users = renotes.map(x => x.user); - const hasRenotedBefore = users.includes($i); + const users = renotes.map(x => x.user.id); + const hasRenotedBefore = users.includes($i.id); if (hasRenotedBefore) { buttonActions.push({ From a3ff46bb7fb054e7cf926bfdd47a111140ba46c4 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:28:16 -0800 Subject: [PATCH 07/16] Consistent styling --- package.json | 2 +- packages/client/src/components/MkRenoteButton.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4d0963fc3..d732f2f79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.10", + "version": "12.119.0-calc.18-rc.11", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 39dce4948..3b7cc7a02 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -58,6 +58,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { let buttonActions = [{ text: i18n.ts.renote, icon: 'ph-repeat-bold ph-lg', + danger: false, action: () => { os.api('notes/create', { renoteId: props.note.id, @@ -83,7 +84,8 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { if (hasRenotedBefore) { buttonActions.push({ text: i18n.ts.unrenote, - icon: 'ph-eraser-bold ph-lg', + icon: 'ph-trash-bold ph-lg', + danger: true, action: () => { os.api('notes/unrenote', { noteId: props.note.id, @@ -95,6 +97,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { buttonActions.push({ text: i18n.ts.quote, icon: 'ph-quotes-bold ph-lg', + danger: false, action: () => { os.post({ renote: props.note, From ea2f8d8c22f8009dc7ffc063fcab8a323bc0de56 Mon Sep 17 00:00:00 2001 From: thatonecalculator Date: Thu, 1 Dec 2022 23:37:25 -0800 Subject: [PATCH 08/16] take back button after quote button if combined --- .../client/src/components/MkRenoteButton.vue | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index 3b7cc7a02..ffba924f9 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -55,6 +55,15 @@ useTooltip(buttonRef, async (showing) => { const renote = async (viaKeyboard = false, ev?: MouseEvent) => { pleaseLogin(); + + const renotes = await os.api('notes/renotes', { + noteId: props.note.id, + limit: 11, + }); + + const users = renotes.map(x => x.user.id); + const hasRenotedBefore = users.includes($i.id); + let buttonActions = [{ text: i18n.ts.renote, icon: 'ph-repeat-bold ph-lg', @@ -73,26 +82,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { } }, }]; - const renotes = await os.api('notes/renotes', { - noteId: props.note.id, - limit: 11, - }); - const users = renotes.map(x => x.user.id); - const hasRenotedBefore = users.includes($i.id); - - if (hasRenotedBefore) { - buttonActions.push({ - text: i18n.ts.unrenote, - icon: 'ph-trash-bold ph-lg', - danger: true, - action: () => { - os.api('notes/unrenote', { - noteId: props.note.id, - }); - }, - }); - } if (!defaultStore.state.seperateRenoteQuote) { buttonActions.push({ text: i18n.ts.quote, @@ -105,6 +95,19 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { }, }); } + + if (hasRenotedBefore) { + buttonActions.push({ + text: i18n.ts.unrenote, + icon: 'ph-trash-bold ph-lg', + danger: true, + action: () => { + os.api('notes/unrenote', { + noteId: props.note.id, + }); + }, + }); + } os.popupMenu(buttonActions, buttonRef.value, { viaKeyboard }); }; From a6e28381ad218a3d9df809ea6e21f95c6a840299 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 2 Dec 2022 20:46:56 +0000 Subject: [PATCH 09/16] Add more patrons! --- patrons.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patrons.json b/patrons.json index 65306d72f..6d6af6041 100644 --- a/patrons.json +++ b/patrons.json @@ -4,6 +4,8 @@ "@shoq@newsroom.social", "@pikadude@erisly.social", "@sage@stop.voring.me", - "@sky@therian.club" + "@sky@therian.club", + "@panos@electricrequiem.com", + "@redhunt07@www.foxyhole.io", ] } From 1e2afa3ca8ceb83a8e845f989da7602e916d0753 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Fri, 2 Dec 2022 20:48:19 +0000 Subject: [PATCH 10/16] Trailing comma --- patrons.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patrons.json b/patrons.json index 6d6af6041..194c0e98c 100644 --- a/patrons.json +++ b/patrons.json @@ -6,6 +6,6 @@ "@sage@stop.voring.me", "@sky@therian.club", "@panos@electricrequiem.com", - "@redhunt07@www.foxyhole.io", + "@redhunt07@www.foxyhole.io" ] } From 79b451e262399da4052ed83618ec2f4a53f91d62 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 18:45:24 -0800 Subject: [PATCH 11/16] Hide share button if unavailable (closes #9175) --- packages/client/src/pages/gallery/post.vue | 3 ++- packages/client/src/pages/page.vue | 3 ++- packages/client/src/scripts/get-note-menu.ts | 5 +++-- packages/client/src/scripts/share-available.ts | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 packages/client/src/scripts/share-available.ts diff --git a/packages/client/src/pages/gallery/post.vue b/packages/client/src/pages/gallery/post.vue index 43d3651b8..a4be9e85f 100644 --- a/packages/client/src/pages/gallery/post.vue +++ b/packages/client/src/pages/gallery/post.vue @@ -24,7 +24,7 @@
- +
@@ -67,6 +67,7 @@ import { url } from '@/config'; import { useRouter } from '@/router'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { shareAvailable } from '@/scripts/share-available'; const router = useRouter(); diff --git a/packages/client/src/pages/page.vue b/packages/client/src/pages/page.vue index 2497db950..e89fd3e2a 100644 --- a/packages/client/src/pages/page.vue +++ b/packages/client/src/pages/page.vue @@ -34,7 +34,7 @@
- +
@@ -81,6 +81,7 @@ import MkPagination from '@/components/MkPagination.vue'; import MkPagePreview from '@/components/MkPagePreview.vue'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { shareAvailable } from '@/scripts/share-available'; const props = defineProps<{ pageName: string; diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index 9c52b2e24..e17ade59c 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -8,6 +8,7 @@ import * as os from '@/os'; import copyToClipboard from '@/scripts/copy-to-clipboard'; import { url } from '@/config'; import { noteActions } from '@/store'; +import { shareAvailable } from '@/scripts/share-available'; export function getNoteMenu(props: { note: misskey.entities.Note; @@ -220,11 +221,11 @@ export function getNoteMenu(props: { window.open(appearNote.url || appearNote.uri, '_blank'); }, } : undefined, - { + shareAvailable() ? { icon: 'ph-share-network-bold ph-lg', text: i18n.ts.share, action: share, - }, + } : undefined, instance.translatorAvailable ? { icon: 'ph-translate-bold ph-lg', text: i18n.ts.translate, diff --git a/packages/client/src/scripts/share-available.ts b/packages/client/src/scripts/share-available.ts new file mode 100644 index 000000000..8056d6dc2 --- /dev/null +++ b/packages/client/src/scripts/share-available.ts @@ -0,0 +1,6 @@ +export function shareAvailable(): boolean { + if (navigator.share) { + return true; + } + return false; +} From ec1079bd299a3df35e0970ce42da939e6002b0ad Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:32:32 -0800 Subject: [PATCH 12/16] =?UTF-8?q?release:=20=F0=9F=94=96=20.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d732f2f79..7e0d15401 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.11", + "version": "12.119.0-calc.18", "codename": "aqua", "repository": { "type": "git", From de3e0b23412fe591ce57fff22cd1c7bfcb8f6ad6 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:50:18 -0800 Subject: [PATCH 13/16] feat: Docker update script (closes #9159) --- push-docker.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 push-docker.sh diff --git a/push-docker.sh b/push-docker.sh new file mode 100755 index 000000000..434c9cc63 --- /dev/null +++ b/push-docker.sh @@ -0,0 +1,10 @@ +sudo systemctl start docker.service +sudo docker rmi $(docker images -q) +sudo docker compose build +sudo docker tag thatonecalculator/calckey:latest thatonecalculator/calckey:$(git describe --tags --exact-match) +sudo docker images +echo "\nPress any key to continue\n" +read +sudo docker push thatonecalculator/calckey:$(git describe --tags --exact-match) +sudo docker push thatonecalculator/calckey:latest +sudo systemctl stop docker.service From 2562f7ac980c18c37416592c232f5b844b6abe96 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:56:45 -0800 Subject: [PATCH 14/16] locale --- locales/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index f58296b9f..0f3fff72e 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1227,7 +1227,7 @@ _tutorial: step5_3: "The Home {icon} timeline is where you can see posts from your followers." step5_4: "The Local {icon} timeline is where you can see posts from everyone else on this instance." step5_5: "The Recommended {icon} timeline is where you can see posts from instances the admins recommend." - step5_6: "The Social {icon} timeline is where you can see posts from friends of your followers." + step5_6: "The Social {icon} timeline is your home + local." step5_7: "The Global {icon} timeline is where you can see posts from every other connected instance." step6_1: "So, what is this place?" step6_2: "Well, you didn't just join Calckey. You joined a portal to the Fediverse, an interconnected network of thousands of servers, called \"instances\"." From f793b9ecd78e9aeabb6b2ce5632d66a7bbb1a5d3 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 13 Dec 2022 11:59:02 +0100 Subject: [PATCH 15/16] Delete empty locales --- locales/hr-HR.yml | 1 - locales/ht-HT.yml | 1 - locales/jbo-EN.yml | 1 - locales/si-LK.yml | 1 - 4 files changed, 4 deletions(-) delete mode 100644 locales/hr-HR.yml delete mode 100644 locales/ht-HT.yml delete mode 100644 locales/jbo-EN.yml delete mode 100644 locales/si-LK.yml diff --git a/locales/hr-HR.yml b/locales/hr-HR.yml deleted file mode 100644 index ed97d539c..000000000 --- a/locales/hr-HR.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/locales/ht-HT.yml b/locales/ht-HT.yml deleted file mode 100644 index ed97d539c..000000000 --- a/locales/ht-HT.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/locales/jbo-EN.yml b/locales/jbo-EN.yml deleted file mode 100644 index ed97d539c..000000000 --- a/locales/jbo-EN.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/locales/si-LK.yml b/locales/si-LK.yml deleted file mode 100644 index ed97d539c..000000000 --- a/locales/si-LK.yml +++ /dev/null @@ -1 +0,0 @@ ---- From e875bfc5d777654147f7f8848f4fd6c5bf1f2912 Mon Sep 17 00:00:00 2001 From: CherryKitten Date: Tue, 13 Dec 2022 20:04:29 +0100 Subject: [PATCH 16/16] Always fetch locales when initiating client --- packages/backend/src/server/web/boot.js | 49 +++++++++++-------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index b6c862743..0342603c6 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -22,37 +22,32 @@ renderError('SOMETHING_HAPPENED_IN_PROMISE', e); }; - const v = localStorage.getItem('v') || VERSION; - //#region Detect language & fetch translations - const localeVersion = localStorage.getItem('localeVersion'); - const localeOutdated = (localeVersion == null || localeVersion !== v); - - if (!localStorage.hasOwnProperty('locale') || localeOutdated) { - const supportedLangs = LANGS; - let lang = localStorage.getItem('lang'); - if (lang == null || !supportedLangs.includes(lang)) { - if (supportedLangs.includes(navigator.language)) { - lang = navigator.language; - } else { - lang = supportedLangs.find(x => x.split('-')[0] === navigator.language); - - // Fallback - if (lang == null) lang = 'en-US'; - } - } - - const res = await fetch(`/assets/locales/${lang}.${v}.json`); - if (res.status === 200) { - localStorage.setItem('lang', lang); - localStorage.setItem('locale', await res.text()); - localStorage.setItem('localeVersion', v); + const v = localStorage.getItem('v') || VERSION; + + const supportedLangs = LANGS; + let lang = localStorage.getItem('lang'); + if (lang == null || !supportedLangs.includes(lang)) { + if (supportedLangs.includes(navigator.language)) { + lang = navigator.language; } else { - await checkUpdate(); - renderError('LOCALE_FETCH'); - return; + lang = supportedLangs.find(x => x.split('-')[0] === navigator.language); + + // Fallback + if (lang == null) lang = 'en-US'; } } + + const res = await fetch(`/assets/locales/${lang}.${v}.json`); + if (res.status === 200) { + localStorage.setItem('lang', lang); + localStorage.setItem('locale', await res.text()); + localStorage.setItem('localeVersion', v); + } else { + await checkUpdate(); + renderError('LOCALE_FETCH'); + return; + } //#endregion //#region Script