Skip to content

Commit

Permalink
Merge branch 'main' into 376-support-more-sections-in-the-dictionary-…
Browse files Browse the repository at this point in the history
…adapters
  • Loading branch information
vxern committed Aug 6, 2024
2 parents 3622f42 + 85f8d2a commit 9de1f94
Show file tree
Hide file tree
Showing 97 changed files with 1,431 additions and 695 deletions.
13 changes: 12 additions & 1 deletion assets/localisations/commands/eng-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@
"word.strings.sourcedResponsibly.dictionaries.one": "the dictionary above",
"word.strings.sourcedResponsibly.dictionaries.two": "the dictionaries above",
"word.strings.sourcedResponsibly.dictionaries.many": "the dictionaries above",
"context.name": "context",
"context.description": "Search for a phrase to see it used in context.",
"context.options.phrase.name": "phrase",
"context.options.phrase.description": "The phrase to search for.",
"context.options.language.name": "language",
"context.options.language.description": "The language to search for the phrase in.",
"context.options.caseSensitive.name": "case-sensitive",
"context.options.caseSensitive.description": "Whether to make the search case-sensitive.",
"context.strings.noSentencesFound.title": "No sentences found",
"context.strings.noSentencesFound.description": "Could not find sentences containing the specified phrase.",
"context.strings.phraseInContext.title": "Phrase '{phrase}' in context",
"list.name": "list",
"list.description": "Allows the viewing of various information about users.",
"list.options.warnings.name": "warnings",
Expand Down Expand Up @@ -642,7 +653,7 @@
"praise.options.comment.name": "comment",
"praise.options.comment.description": "A comment to attach to the praise.",
"praise.strings.praised.title": "User praised!",
"praise.strings.praised.description": "{user_mention} has just been notified that you have praised them.",
"praise.strings.praised.description": "You have praised {user_mention}.",
"praise.strings.cannotPraiseSelf.title": "Cannot praise self",
"praise.strings.cannotPraiseSelf.description": "You cannot praise yourself.",
"praise.strings.failed.title": "Failed to praise user",
Expand Down
9 changes: 6 additions & 3 deletions assets/localisations/entry/eng-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"entry.verification.answers.alreadyAnswered.description": "You have already submitted answers to the verification questions. You will be notified once your request to join is reviewed by the moderators.",
"entry.verification.answers.submitted.title": "Answers submitted",
"entry.verification.answers.submitted.description.submitted": "Your answers to the verification questions have been submitted.",
"entry.verification.answers.submitted.description.willBeReviewed": "Your request to join the server will be reviewed by the server staff, and you will be notified via DMs when your entry request is accepted.",
"entry.verification.answers.submitted.description.willBeReviewed": "Your request to enter the server will be reviewed, and you will be notified when your entry request is accepted.",
"entry.verification.answers.failed.title": "Failed to submit answers",
"entry.verification.answers.failed.description": "Due to unknown reasons, submitting your answers to the verification questions failed.",
"entry.verification.answers": "Verification Answers",
Expand Down Expand Up @@ -60,11 +60,14 @@
"entry.verification.vote.sureToForce.reject.description": "Are you sure you want to forcibly reject this entry request?",
"entry.verification.vote.sureToForce.yes": "Yes, I am sure",
"entry.verification.vote.sureToForce.no": "No, cancel",
"entry.verification.vote.inquiryInProgress.title": "Cannot vote during inquiry",
"entry.verification.vote.inquiryInProgress.description": "Voting on this entry request is currently disabled because an inquiry is in progress.",
"entry.verification.inquiry.inquiry": "Inquiry",
"entry.verification.inquiry.open": "Open Inquiry",
"entry.verification.inquiry.channel": "Inquiry channel for {user}.",
"entry.verification.inquiry.failed.title": "Failed to open inquiry",
"entry.verification.inquiry.failed.description": "Due to unknown reasons, opening an inquiry with this user failed.",
"entry.verification.inquiry.opened.title": "Inquiry opened!",
"entry.verification.inquiry.opened.description": "An inquiry has been opened to review the user's request to join {guild_name}."
}
"entry.verification.inquiry.opened.description": "An inquiry has been opened to review the user's request to join {guild_name}.",
"entry.verification.inquiry.verificationAnswers": "Verification Answers"
}
2 changes: 2 additions & 0 deletions assets/localisations/events/eng-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"events.messageUpdate.description": "{user} has updated their message in {channel}.",
"events.messageUpdate.fields.before": "Before",
"events.messageUpdate.fields.after": "After",
"events.memberKick.title": "User kicked",
"events.memberKick.description": "{user} has been kicked by {moderator}.",
"events.entryRequestAccept.title": "Entry request accepted",
"events.entryRequestAccept.description": "{user}'s entry request has been accepted by {moderator}.",
"events.entryRequestReject.title": "Entry request rejected",
Expand Down
11 changes: 7 additions & 4 deletions assets/localisations/services/eng-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
"notices.resources.description.contributable.usingCommand": "Using the {command} command.",
"notices.resources.description.contributable.openingIssue": "Opening an issue in the repository, mentioning the resources to add.",
"notices.resources.description.contributable.makingPullRequest": "Forking the repository, adding the resources as needed, and creating a pull request.",

"reports.users": "Reported users",
"reports.reason": "Reason for report",
"reports.link": "Link to message",
"reports.noLinkProvided": "No link to message provided.",
"reports.previousInfractions": "Previous infractions of {username}",

"reports.noReports": "There are no unresolved user reports.",
"resources.noResources": "There are no new resource submissions.",
"suggestion.suggestion": "Suggestion",

"suggestions.noSuggestions": "There are no new server suggestions.",
"tickets.noTickets": "There are no open tickets.",
"entryRequests.noEntryRequests": "There are no unresolved requests to enter the server.",
"submittedBy": "Submitted by",
"submittedAt": "Submitted at",
"markResolved": "Mark issue as resolved",
Expand All @@ -30,5 +32,6 @@
"cannotRemovePrompt.description": "You cannot remove this prompt.",
"close": "Close",
"cannotCloseIssue.title": "Cannot close issue",
"cannotCloseIssue.description": "You cannot close this issue."
"cannotCloseIssue.description": "You cannot close this issue.",
"allUpToDate": "All up to date!"
}
1 change: 1 addition & 0 deletions source/constants/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export default Object.freeze({
removePrompt: "remove_prompt",
selectRoles: "select_roles",
showInChat: "show_in_chat",
noPrompts: "no_prompts",
} as const);
5 changes: 5 additions & 0 deletions source/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dictionaries from "logos:constants/dictionaries";
import emojis from "logos:constants/emojis";
import endpoints from "logos:constants/endpoints";
import gifs from "logos:constants/gifs";
import keys from "logos:constants/keys";
import languages from "logos:constants/languages";
import licences from "logos:constants/licences";
import links from "logos:constants/links";
Expand All @@ -34,12 +35,15 @@ const constants = Object.freeze({
MAXIMUM_HISTORY_ENTRIES: 100,
MAXIMUM_QUEUE_ENTRIES: 100,
MAXIMUM_EMBED_FIELD_LENGTH: 1024,
MAXIMUM_EMBED_DESCRIPTION_LENGTH: 3072,
RESULTS_PER_PAGE: 10,
STATUS_CYCLE_PERIOD: 1000 * 10, // 10 seconds in milliseconds.
INTERACTION_TOKEN_EXPIRY: 1000 * 60 * 15 - 1000 * 10, // 14 minutes, 50 seconds in milliseconds.
SLOWMODE_COLLISION_TIMEOUT: 1000 * 20, // 20 seconds in milliseconds.
AUTO_DELETE_MESSAGE_TIMEOUT: 1000 * 10, // 10 seconds in milliseconds.
PICK_MISSING_WORD_CHOICES: 4,
SHORT_TEXT_LENGTH: 60,
SENTENCE_PAIRS_TO_SHOW: 5,
LOCALISATIONS_DIRECTORY: "./assets/localisations",
SENTENCE_PAIRS_DIRECTORY: "./assets/sentences",
} as const);
Expand All @@ -57,6 +61,7 @@ export default Object.freeze({
emojis,
endpoints,
gifs,
keys,
languages,
licences,
links,
Expand Down
38 changes: 38 additions & 0 deletions source/constants/contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,10 @@ export default Object.freeze({
after: localise("events.messageUpdate.fields.after", locale)(),
},
}),
memberKick: ({ localise, locale }) => ({
title: localise("events.memberKick.title", locale)(),
description: localise("events.memberKick.description", locale),
}),
entryRequestAccept: ({ localise, locale }) => ({
title: localise("events.entryRequestAccept.title", locale)(),
description: localise("events.entryRequestAccept.description", locale),
Expand Down Expand Up @@ -1567,5 +1571,39 @@ export default Object.freeze({
cannotUseUntil: localise("interactions.rateLimited.description.cannotUseAgainUntil", locale),
},
}),
inquiryInProgress: ({ localise, locale }) => ({
title: localise("entry.verification.vote.inquiryInProgress.title", locale)(),
description: localise("entry.verification.vote.inquiryInProgress.description", locale)(),
}),
noReports: ({ localise, locale }) => ({
title: localise("allUpToDate", locale)(),
description: localise("reports.noReports", locale)(),
}),
noResources: ({ localise, locale }) => ({
title: localise("allUpToDate", locale)(),
description: localise("resources.noResources", locale)(),
}),
noSuggestions: ({ localise, locale }) => ({
title: localise("allUpToDate", locale)(),
description: localise("suggestions.noSuggestions", locale)(),
}),
noTickets: ({ localise, locale }) => ({
title: localise("allUpToDate", locale)(),
description: localise("tickets.noTickets", locale)(),
}),
noEntryRequests: ({ localise, locale }) => ({
title: localise("allUpToDate", locale)(),
description: localise("entryRequests.noEntryRequests", locale)(),
}),
verificationAnswers: ({ localise, locale }) => ({
verificationAnswers: localise("entry.verification.inquiry.verificationAnswers", locale)(),
}),
noSentencesFound: ({ localise, locale }) => ({
title: localise("context.strings.noSentencesFound.title", locale)(),
description: localise("context.strings.noSentencesFound.description", locale)(),
}),
phraseInContext: ({ localise, locale }) => ({
title: localise("context.strings.phraseInContext.title", locale),
}),
} satisfies Record<string, ContextBuilder<any>>);
export type { ContextBuilder };
2 changes: 1 addition & 1 deletion source/constants/contributions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LearningLanguage } from "logos:constants/languages";
import type { LearningLanguage } from "logos:constants/languages/learning";

interface Contributor {
readonly username: string;
Expand Down
14 changes: 4 additions & 10 deletions source/constants/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import type {
FeatureLanguage,
LearningLanguage,
Locale,
LocalisationLanguage,
TranslationLanguage,
} from "logos:constants/languages";
import type { FeatureLanguage } from "logos:constants/languages/feature";
import type { LearningLanguage } from "logos:constants/languages/learning";
import type { Locale, LocalisationLanguage } from "logos:constants/languages/localisation";
import type { TranslationLanguage } from "logos:constants/languages/translation";
import type { RateLimit, TimeStruct } from "logos/models/guild";

const FEATURE_LOCALE: Locale = "eng-US";
Expand All @@ -31,8 +28,6 @@ const MUSIC_DISCONNECT_TIMEOUT: TimeStruct = [2, "minute"];
const MINIMUM_VOICE_CHANNELS = 0;
const MAXIMUM_VOICE_CHANNELS = 5;

const WARN_MESSAGE_DELETE_TIMEOUT = 1000 * 10; // 10 seconds in milliseconds.

export default Object.freeze({
LOCALISATION_LANGUAGE,
LOCALISATION_LOCALE,
Expand All @@ -53,5 +48,4 @@ export default Object.freeze({
MUSIC_DISCONNECT_TIMEOUT,
MINIMUM_VOICE_CHANNELS,
MAXIMUM_VOICE_CHANNELS,
WARN_MESSAGE_DELETE_TIMEOUT,
});
2 changes: 1 addition & 1 deletion source/constants/dictionaries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LearningLanguage } from "logos:constants/languages";
import type { LearningLanguage } from "logos:constants/languages/learning";

const sections = [
"partOfSpeech",
Expand Down
1 change: 1 addition & 0 deletions source/constants/emojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default Object.freeze({
unbanned: "😇",
joined: "😁",
left: "😔",
kicked: "🚪",
},
message: {
updated: "⬆️",
Expand Down
11 changes: 11 additions & 0 deletions source/constants/keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const keys = Object.freeze({
redis: {
sentencePairIndex: ({ locale }: { locale: string }) => `${locale}:SI`,
sentencePair: ({ locale, sentenceId }: { locale: string; sentenceId: string | number }) =>
`${locale}:S:${sentenceId}`,
lemmaUseIndex: ({ locale, lemma }: { locale: string; lemma: string }) => `${locale}:LI:${lemma}`,
lemmaFormIndex: ({ locale, lemma }: { locale: string; lemma: string }) => `${locale}:LF:${lemma.toLowerCase()}`,
},
});

export default keys;
125 changes: 8 additions & 117 deletions source/constants/languages.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,15 @@
import {
type CLDLanguage,
type CLDLocale,
type Language as DetectionLanguage,
type Locale as DetectionLocale,
type Detector,
type ELDLanguage,
type ELDLocale,
type FastTextLanguage,
type FastTextLocale,
type TinyLDLanguage,
type TinyLDLocale,
getCLDLanguageByLocale as getCLDDetectionLanguageByLocale,
getELDLanguageByLocale as getELDDetectionLanguageByLocale,
getFastTextLanguageByLocale as getFastTextDetectionLanguageByLocale,
getTinyLDLanguageByLocale as getTinyLDDetectionLanguageByLocale,
isCLDLocale,
isELDLocale,
isFastTextLocale,
isTinyLDLocale,
} from "logos:constants/languages/detection";
import { type Language as FeatureLanguage, isLanguage as isFeatureLanguage } from "logos:constants/languages/feature";
import {
type Language as LearningLanguage,
getLocaleByLanguage as getLocaleByLearningLanguage,
isLanguage as isLearningLanguage,
isLocale as isLearningLocale,
} from "logos:constants/languages/learning";
import type { DetectionLanguage } from "logos:constants/languages/detection";
import { type FeatureLanguage, isFeatureLanguage } from "logos:constants/languages/feature";
import type { LearningLanguage } from "logos:constants/languages/learning";
import {
type DiscordLocale,
type Locale,
type Language as LocalisationLanguage,
getDiscordLocaleByLanguage as getDiscordLocaleByLocalisationLanguage,
getDiscordLanguageByLocale as getDiscordLocalisationLanguageByLocale,
getLogosLocaleByLanguage as getLocaleByLocalisationLanguage,
getLogosLanguageByLocale as getLocalisationLanguageByLocale,
isDiscordLanguage as isDiscordLocalisationLanguage,
isLogosLanguage as isLocalisationLanguage,
type LocalisationLanguage,
languageToLocale as localisationLanguageToLocale,
languages as localisationLanguages,
} from "logos:constants/languages/localisation";
import {
type DeepLLanguage,
type DeepLLocale,
type GoogleTranslateLanguage,
type GoogleTranslateLocale,
type LingvanexLanguage,
type LingvanexLocale,
type Language as TranslationLanguage,
type Locale as TranslationLocale,
type Translator,
getDeepLLocaleByLanguage as getDeepLLocaleByTranslationLanguage,
getDeepLLanguageByLocale as getDeepLTranslationLanguageByLocale,
getGoogleTranslateLocaleByLanguage as getGoogleTranslateLocaleByTranslationLanguage,
getGoogleTranslateLanguageByLocale as getGoogleTranslateTranslationLanguageByLocale,
getLingvanexLocaleByLanguage as getLingvanexLocaleByTranslationLanguage,
getLingvanexLanguageByLocale as getLingvanexTranslationLanguageByLocale,
isDeepLLocale,
isGoogleTranslateLocale,
isLingvanexLocale,
isLanguage as isTranslationLanguage,
type TranslationLanguage,
isTranslationLanguage,
languages as translationLanguages,
} from "logos:constants/languages/translation";

Expand Down Expand Up @@ -138,65 +89,5 @@ interface Languages<Language extends string> {
}

export default languages;
export {
getDiscordLocaleByLocalisationLanguage,
getLocaleByLocalisationLanguage,
getDiscordLocalisationLanguageByLocale,
getLocalisationLanguageByLocale,
isDiscordLocalisationLanguage,
isLocalisationLanguage,
getLocaleByLearningLanguage,
isLearningLanguage,
isLearningLocale,
isTranslationLanguage,
getDeepLLocaleByTranslationLanguage,
getGoogleTranslateLocaleByTranslationLanguage,
getDeepLTranslationLanguageByLocale,
getGoogleTranslateTranslationLanguageByLocale,
isGoogleTranslateLocale,
isDeepLLocale,
isFeatureLanguage,
getTinyLDDetectionLanguageByLocale,
isTinyLDLocale,
getCLDDetectionLanguageByLocale,
isCLDLocale,
getTranslationLanguage,
getFeatureLanguage,
getBaseLanguage,
getLingvanexTranslationLanguageByLocale,
getLingvanexLocaleByTranslationLanguage,
isLingvanexLocale,
getFastTextDetectionLanguageByLocale,
isFastTextLocale,
getELDDetectionLanguageByLocale,
isELDLocale,
};
export type {
Detector,
Translator,
LearningLanguage,
FeatureLanguage,
LocalisationLanguage,
TranslationLanguage,
Language,
Locale,
GoogleTranslateLanguage,
DeepLLanguage,
Languages,
TranslationLocale,
DeepLLocale,
GoogleTranslateLocale,
TinyLDLanguage,
TinyLDLocale,
CLDLanguage,
CLDLocale,
DetectionLanguage,
DetectionLocale,
WithBaseLanguage,
LingvanexLanguage,
LingvanexLocale,
FastTextLanguage,
FastTextLocale,
ELDLanguage,
ELDLocale,
};
export { getTranslationLanguage, getFeatureLanguage, getBaseLanguage };
export type { Language, Languages, WithBaseLanguage };
Loading

0 comments on commit 9de1f94

Please sign in to comment.