Skip to content

Commit 1dd10bc

Browse files
authored
fix(osu!ppy): add missing strings && change getStrings in presence.ts (#9325)
1 parent 75f54cf commit 1dd10bc

File tree

3 files changed

+77
-29
lines changed

3 files changed

+77
-29
lines changed

websites/O/osu ppy/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"zh-tw": "節奏躍然指上!遊戲模式來自「押忍!戰鬥應援團」、「精英節拍特工」、太鼓的以及 osu! 原創的模式。包含一個功能齊全的譜面編輯器。"
3939
},
4040
"url": "osu.ppy.sh",
41-
"version": "2.1.5",
41+
"version": "2.1.6",
4242
"logo": "https://cdn.rcd.gg/PreMiD/websites/O/osu%20ppy/assets/logo.png",
4343
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/O/osu%20ppy/assets/thumbnail.png",
4444
"color": "#FF66AA",

websites/O/osu ppy/osu!ppy.json

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,84 @@
11
{
2-
"osu!ppy.beatmapListing": {
2+
"osu!ppy.accountSettings": {
3+
"description": "Displayed when editing their account settings",
4+
"message": "Changing account settings..."
5+
},
6+
"osu!ppy.beatMapListing": {
37
"description": "Displayed when viewing all beatmaps.",
4-
"message": "Viewing beatmap listings"
8+
"message": "Beatmap Listings"
59
},
6-
"osu!ppy.beatmapLooking": {
10+
"osu!ppy.beatMapLooking": {
711
"description": "Displayed when looking at a beatmap.",
8-
"message": "Looking at beatmap"
12+
"message": "Looking at the beatmap"
913
},
10-
"osu!ppy.beatmapPacks": {
14+
"osu!ppy.beatMapPacks": {
1115
"description": "Displayed when viewing all beatmap packs.",
12-
"message": "Viewing beatmap packs"
13-
},
14-
"osu!ppy.beatmapRankings": {
15-
"description": "Displayed when viewing Kudosu Rankings.",
16-
"message": "Viewing kudosu rankings"
16+
"message": "Beatmap Packs"
1717
},
1818
"osu!ppy.buttonViewBeatmap": {
1919
"description": "Displayed for a button to redirect to the beatmap page.",
2020
"message": "View Beatmap"
2121
},
22+
"osu!ppy.changelog": {
23+
"description": "Displayed when viewing changelog",
24+
"message": "Changelog"
25+
},
26+
"osu!ppy.chatting": {
27+
"description": "Displayed when chatting",
28+
"message": "Chatting..."
29+
},
30+
"osu!ppy.contests": {
31+
"description": "Displayed when browsing contests",
32+
"message": "Contests"
33+
},
2234
"osu!ppy.countryRankings": {
2335
"description": "Country rankings {0} = gamemode. E.g. Country Rankings [osu!]",
2436
"message": "Country rankings [{0}]"
2537
},
38+
"osu!ppy.featuredArtists": {
39+
"description": "Displayed when browsing featured Artists",
40+
"message": "Featured Artists"
41+
},
2642
"osu!ppy.for": {
2743
"description": "{0} = country/for All, {1} = gamemode. E.g. Performance Rankings (for All) [osu!]",
2844
"message": "(for {0}) [{1}]"
2945
},
46+
"osu!ppy.forums": {
47+
"description": "{0} = Forum Name. E.g. Forums Gameplay & Ranking",
48+
"message": "Forums {0}"
49+
},
50+
"osu!ppy.friendList": {
51+
"description": "Displayed when viewing their friend list",
52+
"message": "Their Friend List"
53+
},
54+
"osu!ppy.kudosuRankings": {
55+
"description": "Displayed when viewing Kudosu Rankings.",
56+
"message": "The Kudosu Rankings"
57+
},
58+
"osu!ppy.livestreams": {
59+
"description": "Displayed when browsing livestreams",
60+
"message": "Livestreams"
61+
},
62+
"osu!ppy.osuStore": {
63+
"description": "Displayed when browsing the Osu! Store",
64+
"message": "The osu! Store"
65+
},
66+
"osu!ppy.otherProfile": {
67+
"description": "{0} = Profile Name. E.g. Looking at OsuPlayer1's Profile",
68+
"message": "Looking at {0}'s Profile"
69+
},
3070
"osu!ppy.performanceRankings": {
3171
"description": "Displayed when viewing the performance rankings.",
3272
"message": "Performance rankings"
3373
},
74+
"osu!ppy.rank": {
75+
"description": "{0} = User Rank. E.g. Rank #1",
76+
"message": "Rank {0}"
77+
},
78+
"osu!ppy.readingForum": {
79+
"description": "Displayed when reading Forum",
80+
"message": "Reading a Forum Post"
81+
},
3482
"osu!ppy.scoreRankings": {
3583
"description": "{0} = gamemode. E.g. Score Rankings [osu!]",
3684
"message": "Score rankings [{0}]"
@@ -43,8 +91,20 @@
4391
"description": "Displayed when viewing the support page.",
4492
"message": "Ways to support osu!ppy"
4593
},
46-
"osu!ppy.wikiMainPage": {
47-
"description": "Displayed when viewing the wiki main page.",
48-
"message": "Wiki main page"
94+
"osu!ppy.theirProfile": {
95+
"description": "{0} = User Name E.g. Looking at OsuPlayer1's Profile (Their Own)",
96+
"message": "Looking at {0}'s Profile (Their Own)"
97+
},
98+
"osu!ppy.tournaments": {
99+
"description": "Displayed when browsing tournaments",
100+
"message": "Tournaments"
101+
},
102+
"osu!ppy.unsupportedPage": {
103+
"description": "Displayed when viewing an unsupported page",
104+
"message": "An Unsupported Page"
105+
},
106+
"osu!ppy.watchLists": {
107+
"description": "Displayed when viewing their watchlists",
108+
"message": "Their Watchlists"
49109
}
50110
}

websites/O/osu ppy/presence.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,20 @@ async function getStrings() {
4444
tournaments: 'osu!ppy.tournaments',
4545
unsupportedPage: 'osu!ppy.unsupportedPage',
4646
viewing: 'general.viewing',
47-
viewingForum: 'osu!ppy.viewingForum',
4847
viewingHome: 'general.viewHome',
4948
watchLists: 'osu!ppy.watchLists',
5049
wikiMainPage: 'general.wikiMainPage',
5150
},
52-
await presence.getSetting<string>('lang').catch(() => 'en'),
5351
)
5452
}
5553

56-
let strings: Awaited<ReturnType<typeof getStrings>>
57-
let oldLang: string | null = null
58-
5954
presence.on('UpdateData', async () => {
6055
const presenceData: PresenceData = {
6156
largeImageKey: 'https://cdn.rcd.gg/PreMiD/websites/O/osu%20ppy/assets/logo.png',
6257
}
63-
const [buttons, newLang] = await Promise.all([
64-
presence.getSetting<boolean>('buttons'),
65-
presence.getSetting<string>('lang'),
66-
])
58+
const buttons = presence.getSetting<boolean>('buttons')
6759
const { pathname, href } = document.location
68-
69-
if (oldLang !== newLang) {
70-
oldLang = newLang
71-
strings = await getStrings()
72-
}
60+
const strings = await getStrings()
7361

7462
if (pathname === '/home') {
7563
const inputSelected = document.querySelector<HTMLInputElement>('[type="search"]')
@@ -273,7 +261,7 @@ presence.on('UpdateData', async () => {
273261
presenceData.state = selected.textContent
274262
presenceData.smallImageKey = Assets.Reading
275263
}
276-
else if (pathname.includes('/Main_Page')) {
264+
else if (pathname.includes('/Main_page')) {
277265
presenceData.details = strings.reading
278266
presenceData.state = strings.wikiMainPage
279267
presenceData.smallImageKey = Assets.Reading

0 commit comments

Comments
 (0)