forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {msg} from '@lingui/macro'
2
3export type TerminologyPreference = 'skeet' | 'post' | 'spell'
4
5/**
6 * Returns the appropriate terminology based on the user's preference
7 * @param preference - The user's terminology preference ('skeet', 'post', or 'spell')
8 * @param variants - An object with message descriptors for each terminology option
9 * @returns The appropriate message descriptor based on the preference
10 */
11export function getTerminology<T extends {skeet: any; post: any; spell: any}>(
12 preference: TerminologyPreference | undefined,
13 variants: T,
14): T[keyof T] {
15 const pref = preference ?? 'skeet'
16 return variants[pref]
17}
18
19/**
20 * Common terminology variants used throughout the app
21 */
22export const TERMINOLOGY = {
23 // Single post
24 singular: {
25 skeet: msg`skeet`,
26 post: msg`post`,
27 spell: msg`spell`,
28 },
29 // Multiple posts
30 plural: {
31 skeet: msg`skeets`,
32 post: msg`posts`,
33 spell: msg`spells`,
34 },
35 // "Skeet by @handle"
36 byHandle: (handle: string) => ({
37 skeet: msg`Skeet by @${handle}`,
38 post: msg`Post by @${handle}`,
39 spell: msg`Spell by @${handle}`,
40 }),
41 // Repost terminology
42 repost: {
43 singular: {
44 skeet: msg`reskeet`,
45 post: msg`repost`,
46 spell: msg`respell`,
47 },
48 plural: {
49 skeet: msg`reskeets`,
50 post: msg`reposts`,
51 spell: msg`respells`,
52 },
53 pastTense: {
54 skeet: msg`reskeeted`,
55 post: msg`reposted`,
56 spell: msg`respelled`,
57 },
58 byLine: {
59 skeet: msg`Reskeeted By`,
60 post: msg`Reposted By`,
61 spell: msg`Respelled By`,
62 },
63 action: {
64 skeet: msg`reskeet`,
65 post: msg`repost`,
66 spell: msg`respell`,
67 },
68 },
69 // For metrics/counts
70 metrics: {
71 skeet: msg`skeets metrics`,
72 post: msg`posts metrics`,
73 spell: msg`spells metrics`,
74 },
75 // For carousel
76 carousel: {
77 skeet: msg`Combine reskeets into a horizontal carousel`,
78 post: msg`Combine reposts into a horizontal carousel`,
79 spell: msg`Combine respells into a horizontal carousel`,
80 },
81 // For notifications
82 viaRepostNotification: {
83 skeet: msg`Disable "via reskeet" notifications`,
84 post: msg`Disable "via repost" notifications`,
85 spell: msg`Disable "via respell" notifications`,
86 },
87 viaRepostPrivacy: {
88 skeet: msg`Forcefully disables the notifications other people receive when you like/reskeet a skeet someone else has reskeeted for privacy.`,
89 post: msg`Forcefully disables the notifications other people receive when you like/repost a post someone else has reposted for privacy.`,
90 spell: msg`Forcefully disables the notifications other people receive when you like/respell a spell someone else has respelled for privacy.`,
91 },
92 // For external share buttons
93 externalShareButtons: {
94 skeet: msg`Show "Open original skeet" and "Open skeet in PDSls" buttons`,
95 post: msg`Show "Open original post" and "Open post in PDSls" buttons`,
96 spell: msg`Show "Open original spell" and "Open spell in PDSls" buttons`,
97 },
98 // For metrics labels
99 repostMetrics: {
100 skeet: msg`Disable reskeets metrics`,
101 post: msg`Disable reposts metrics`,
102 spell: msg`Disable respells metrics`,
103 },
104 // For deletion messages
105 deleted: {
106 skeet: msg`This skeet was deleted by its author`,
107 post: msg`This post was deleted by its author`,
108 spell: msg`This spell was deleted by its author`,
109 },
110 deletedShort: {
111 skeet: msg`Skeet has been deleted`,
112 post: msg`Post has been deleted`,
113 spell: msg`Spell has been deleted`,
114 },
115 // For error messages
116 notFound: {
117 skeet: msg`Skeet not found`,
118 post: msg`Post not found`,
119 spell: msg`Spell not found`,
120 },
121 blocked: {
122 skeet: msg`Skeet blocked`,
123 post: msg`Post blocked`,
124 spell: msg`Spell blocked`,
125 },
126 errorLoading: {
127 skeet: msg`Error loading skeet`,
128 post: msg`Error loading post`,
129 spell: msg`Error loading spell`,
130 },
131 // For success messages
132 sent: {
133 skeet: msg`Your skeet was sent`,
134 post: msg`Your post was sent`,
135 spell: msg`Your spell was sent`,
136 },
137 sentPlural: {
138 skeet: msg`Your skeets were sent`,
139 post: msg`Your posts were sent`,
140 spell: msg`Your spells were sent`,
141 },
142 pinned: {
143 skeet: msg`Skeet pinned`,
144 post: msg`Post pinned`,
145 spell: msg`Spell pinned`,
146 },
147 unpinned: {
148 skeet: msg`Skeet unpinned`,
149 post: msg`Post unpinned`,
150 spell: msg`Spell unpinned`,
151 },
152 failedToPin: {
153 skeet: msg`Failed to pin skeet`,
154 post: msg`Failed to pin post`,
155 spell: msg`Failed to pin spell`,
156 },
157 // For composer
158 addAnother: {
159 skeet: msg`Add another skeet`,
160 post: msg`Add another post`,
161 spell: msg`Add another spell`,
162 },
163 anythingBut: {
164 skeet: msg`Anything but skeet`,
165 post: msg`Anything but post`,
166 spell: msg`Anything but spell`,
167 },
168 delete: {
169 skeet: msg`Delete skeet`,
170 post: msg`Delete post`,
171 spell: msg`Delete spell`,
172 },
173 discard: {
174 skeet: msg`Discard skeet?`,
175 post: msg`Discard post?`,
176 spell: msg`Discard spell?`,
177 },
178 discardConfirm: {
179 skeet: msg`Are you sure you'd like to discard this skeet?`,
180 post: msg`Are you sure you'd like to discard this post?`,
181 spell: msg`Are you sure you'd like to discard this spell?`,
182 },
183 view: {
184 skeet: msg`View skeet`,
185 post: msg`View post`,
186 spell: msg`View spell`,
187 },
188 // For composer actions
189 composeNew: {
190 skeet: msg`Compose new skeet`,
191 post: msg`Compose new post`,
192 spell: msg`Compose new spell`,
193 },
194 newAction: {
195 skeet: msg`New Skeet`,
196 post: msg`New Post`,
197 spell: msg`New Spell`,
198 },
199 postAll: {
200 skeet: msg`Skeet All`,
201 post: msg`Post All`,
202 spell: msg`Spell All`,
203 },
204 postSingle: {
205 skeet: msg`Skeet`,
206 post: msg`Post`,
207 spell: msg`Spell`,
208 },
209 // For language selection
210 selectLanguage: {
211 skeet: msg`Select skeet language`,
212 post: msg`Select post language`,
213 spell: msg`Select spell language`,
214 },
215 chooseLanguages: {
216 skeet: msg`Choose Skeet Languages`,
217 post: msg`Choose Post Languages`,
218 spell: msg`Choose Spell Languages`,
219 },
220 languageDescription: {
221 skeet: msg`Select up to 3 languages used in this skeet`,
222 post: msg`Select up to 3 languages used in this post`,
223 spell: msg`Select up to 3 languages used in this spell`,
224 },
225 replyingLanguage: (langs: string) => ({
226 skeet: msg`The skeet you're replying to was marked as being written in ${langs}`,
227 post: msg`The post you're replying to was marked as being written in ${langs}`,
228 spell: msg`The spell you're replying to was marked as being written in ${langs}`,
229 }),
230 // For interaction settings
231 interactionSettings: {
232 skeet: msg`Skeet interaction settings`,
233 post: msg`Post interaction settings`,
234 spell: msg`Spell interaction settings`,
235 },
236 editInteractionSettings: {
237 skeet: msg`Edit skeet interaction settings`,
238 post: msg`Edit post interaction settings`,
239 spell: msg`Edit spell interaction settings`,
240 },
241 whoCanInteract: {
242 skeet: msg`Who can interact with this skeet?`,
243 post: msg`Who can interact with this post?`,
244 spell: msg`Who can interact with this spell?`,
245 },
246 // For embedding
247 embed: {
248 skeet: msg`Embed skeet`,
249 post: msg`Embed post`,
250 spell: msg`Embed spell`,
251 },
252 embedDescription: {
253 skeet: msg`Embed this skeet in your website. Simply copy the following snippet and paste it into the HTML code of your website.`,
254 post: msg`Embed this post in your website. Simply copy the following snippet and paste it into the HTML code of your website.`,
255 spell: msg`Embed this spell in your website. Simply copy the following snippet and paste it into the HTML code of your website.`,
256 },
257 // For sharing
258 copyLink: {
259 skeet: msg`Copy link to skeet`,
260 post: msg`Copy link to post`,
261 spell: msg`Copy link to spell`,
262 },
263 shareUri: {
264 skeet: msg`Share skeet at:// URI`,
265 post: msg`Share post at:// URI`,
266 spell: msg`Share spell at:// URI`,
267 },
268 copyUri: {
269 skeet: msg`Copy skeet at:// URI`,
270 post: msg`Copy post at:// URI`,
271 spell: msg`Copy spell at:// URI`,
272 },
273 sendTo: {
274 skeet: msg`Send skeet to...`,
275 post: msg`Send post to...`,
276 spell: msg`Send spell to...`,
277 },
278 openOriginal: {
279 skeet: msg`Open original skeet`,
280 post: msg`Open original post`,
281 spell: msg`Open original spell`,
282 },
283 openInPDSls: {
284 skeet: msg`Open skeet in PDSls`,
285 post: msg`Open post in PDSls`,
286 spell: msg`Open spell in PDSls`,
287 },
288 // For reporting
289 report: {
290 skeet: msg`Report this skeet`,
291 post: msg`Report this post`,
292 spell: msg`Report this spell`,
293 },
294 reportWhy: {
295 skeet: msg`Why should this skeet be reviewed?`,
296 post: msg`Why should this post be reviewed?`,
297 spell: msg`Why should this spell be reviewed?`,
298 },
299 // For search and browse
300 search: {
301 skeet: msg`Search skeets`,
302 post: msg`Search posts`,
303 spell: msg`Search spells`,
304 },
305 searchProfile: (handle: string) => ({
306 skeet: msg`Search @${handle}'s skeets`,
307 post: msg`Search @${handle}'s posts`,
308 spell: msg`Search @${handle}'s spells`,
309 }),
310 searchMy: {
311 skeet: msg`Search my skeets`,
312 post: msg`Search my posts`,
313 spell: msg`Search my spells`,
314 },
315 browse: (tag: string) => ({
316 skeet: msg`Browse skeets about ${tag}`,
317 post: msg`Browse posts about ${tag}`,
318 spell: msg`Browse spells about ${tag}`,
319 }),
320 browseTagged: (tag: string) => ({
321 skeet: msg`Browse skeets tagged with ${tag}`,
322 post: msg`Browse posts tagged with ${tag}`,
323 spell: msg`Browse spells tagged with ${tag}`,
324 }),
325 seeTag: (tag: string) => ({
326 skeet: msg`See ${tag} skeets`,
327 post: msg`See ${tag} posts`,
328 spell: msg`See ${tag} spells`,
329 }),
330 seeTagByUser: (tag: string) => ({
331 skeet: msg`See ${tag} skeets by user`,
332 post: msg`See ${tag} posts by user`,
333 spell: msg`See ${tag} spells by user`,
334 }),
335 // For loading and errors
336 loadNew: {
337 skeet: msg`Load new skeets`,
338 post: msg`Load new posts`,
339 spell: msg`Load new spells`,
340 },
341 fetchError: {
342 skeet: msg`There was an issue fetching skeets. Tap here to try again.`,
343 post: msg`There was an issue fetching posts. Tap here to try again.`,
344 spell: msg`There was an issue fetching spells. Tap here to try again.`,
345 },
346 uploadFailed: {
347 skeet: msg`Skeet failed to upload. Please check your Internet connection and try again.`,
348 post: msg`Post failed to upload. Please check your Internet connection and try again.`,
349 spell: msg`Spell failed to upload. Please check your Internet connection and try again.`,
350 },
351 // For feeds and filtering
352 ranOut: {
353 skeet: msg`We ran out of skeets from your follows. Here's the latest from`,
354 post: msg`We ran out of posts from your follows. Here's the latest from`,
355 spell: msg`We ran out of spells from your follows. Here's the latest from`,
356 },
357 // For quote posts
358 quoteAction: {
359 skeet: msg`Quote skeet`,
360 post: msg`Quote post`,
361 spell: msg`Quote spell`,
362 },
363 quoteDisabled: {
364 skeet: msg`Quote skeets disabled`,
365 post: msg`Quote posts disabled`,
366 spell: msg`Quote spells disabled`,
367 },
368 allowQuote: {
369 skeet: msg`Allow quote skeets`,
370 post: msg`Allow quote posts`,
371 spell: msg`Allow quote spells`,
372 },
373 quoteAuthorDisabled: {
374 skeet: msg`This skeet's author has disabled quote skeets.`,
375 post: msg`This post's author has disabled quote posts.`,
376 spell: msg`This spell's author has disabled quote spells.`,
377 },
378 cancelQuote: {
379 skeet: msg`Cancel quote skeet`,
380 post: msg`Cancel quote post`,
381 spell: msg`Cancel quote spell`,
382 },
383 noQuoteYet: {
384 skeet: msg`No one but the author can quote this skeet.`,
385 post: msg`No one but the author can quote this post.`,
386 spell: msg`No one but the author can quote this spell.`,
387 },
388 // For reply settings
389 repliesDisabled: {
390 skeet: msg`Replies to this skeet are disabled.`,
391 post: msg`Replies to this post are disabled.`,
392 spell: msg`Replies to this spell are disabled.`,
393 },
394 everyoneCanReply: {
395 skeet: msg`Everybody can reply to this skeet.`,
396 post: msg`Everybody can reply to this post.`,
397 spell: msg`Everybody can reply to this spell.`,
398 },
399 unknownThreadgate: {
400 skeet: msg`This skeet has an unknown type of threadgate on it. Your app may be out of date.`,
401 post: msg`This post has an unknown type of threadgate on it. Your app may be out of date.`,
402 spell: msg`This spell has an unknown type of threadgate on it. Your app may be out of date.`,
403 },
404 // For replies
405 repliedTo: {
406 skeet: msg`Replied to a skeet`,
407 post: msg`Replied to a post`,
408 spell: msg`Replied to a spell`,
409 },
410 repliedToBlocked: {
411 skeet: msg`Replied to a blocked skeet`,
412 post: msg`Replied to a blocked post`,
413 spell: msg`Replied to a blocked spell`,
414 },
415 replyWasDeleted: {
416 skeet: msg`We're sorry! The skeet you are replying to has been deleted.`,
417 post: msg`We're sorry! The post you are replying to has been deleted.`,
418 spell: msg`We're sorry! The spell you are replying to has been deleted.`,
419 },
420 sortReplies: {
421 skeet: msg`Sort replies to the same skeet by:`,
422 post: msg`Sort replies to the same post by:`,
423 spell: msg`Sort replies to the same spell by:`,
424 },
425 showRepliesTree: {
426 skeet: msg`Show skeet replies in a threaded tree view`,
427 post: msg`Show post replies in a threaded tree view`,
428 spell: msg`Show spell replies in a threaded tree view`,
429 },
430 // For visibility
431 onlyLoggedIn: {
432 skeet: msg`This skeet is only visible to logged-in users.`,
433 post: msg`This post is only visible to logged-in users.`,
434 spell: msg`This spell is only visible to logged-in users.`,
435 },
436 noteOnlyLoggedIn: {
437 skeet: msg`Note: This skeet is only visible to logged-in users.`,
438 post: msg`Note: This post is only visible to logged-in users.`,
439 spell: msg`Note: This spell is only visible to logged-in users.`,
440 },
441}