Skip to content

Commit

Permalink
misc: Switch to British English as the default language. (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern authored Aug 6, 2024
2 parents 85f8d2a + a9fbf92 commit 8290d34
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 13 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions source/constants/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { Locale, LocalisationLanguage } from "logos:constants/languages/loc
import type { TranslationLanguage } from "logos:constants/languages/translation";
import type { RateLimit, TimeStruct } from "logos/models/guild";

const FEATURE_LOCALE: Locale = "eng-US";
const FEATURE_LOCALE: Locale = "eng-GB";
const FEATURE_LANGUAGE: FeatureLanguage = "English";
const LEARNING_LOCALE: Locale = "eng-US";
const LEARNING_LANGUAGE: LearningLanguage = "English/American";
const LOCALISATION_LOCALE: Locale = "eng-US";
const LOCALISATION_LANGUAGE: LocalisationLanguage = "English/American";
const TRANSLATION_LANGUAGE: TranslationLanguage = "English/American";
const LEARNING_LOCALE: Locale = "eng-GB";
const LEARNING_LANGUAGE: LearningLanguage = "English/British";
const LOCALISATION_LOCALE: Locale = "eng-GB";
const LOCALISATION_LANGUAGE: LocalisationLanguage = "English/British";
const TRANSLATION_LANGUAGE: TranslationLanguage = "English/British";

const COMMAND_RATE_LIMIT: RateLimit = { uses: 5, within: [10, "second"] };
const REPORT_RATE_LIMIT: RateLimit = { uses: 50, within: [1, "day"] };
Expand Down
4 changes: 2 additions & 2 deletions test/source/constants/languages/learning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ describe("isLocale()", () => {

describe("getLocaleByLanguage()", () => {
it("returns the language corresponding to the passed learning locale.", () => {
expect(getLogosLocaleByLanguage("English/American")).to.equal("eng-US");
expect(getLogosLocaleByLanguage("English/British")).to.equal("eng-GB");
expect(getLogosLocaleByLanguage("German")).to.equal("deu");
});
});

describe("getWiktionaryLanguageName()", () => {
it("returns the Wiktionary name for the learning language if available.", () => {
expect(getWiktionaryLanguageName("English/American")).to.equal("English");
expect(getWiktionaryLanguageName("English/British")).to.equal("English");
expect(getWiktionaryLanguageName("Norwegian/Bokmal")).to.equal("Norwegian Bokmål");
});
});
10 changes: 5 additions & 5 deletions test/source/constants/languages/localisation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("isLogosLanguage()", () => {

describe("isLogosLocale()", () => {
it("returns true if the passed locale is supported by Logos.", () => {
expect(isLogosLocale("eng-US")).to.be.true; // American English
expect(isLogosLocale("eng-GB")).to.be.true; // British English
});

it("returns false if the passed locale is not supported by Logos.", () => {
Expand All @@ -44,21 +44,21 @@ describe("isLogosLocale()", () => {

describe("getDiscordLocaleByLanguage()", () => {
it("returns the language corresponding to the passed locale.", () => {
expect(getDiscordLocaleByLanguage("English/American")).to.equal("en-US");
expect(getDiscordLocaleByLanguage("English/British")).to.equal("en-GB");
expect(getDiscordLocaleByLanguage("German")).to.equal("de");
});
});

describe("getLogosLocaleByLanguage()", () => {
it("returns the language corresponding to the passed locale.", () => {
expect(getLogosLocaleByLanguage("English/American")).to.equal("eng-US");
expect(getLogosLocaleByLanguage("English/British")).to.equal("eng-GB");
expect(getLogosLocaleByLanguage("German")).to.equal("deu");
});
});

describe("getDiscordLanguageByLocale()", () => {
it("returns the language corresponding to the passed locale if the locale is valid.", () => {
expect(getDiscordLanguageByLocale("en-US")).to.equal("English/American");
expect(getDiscordLanguageByLocale("en-GB")).to.equal("English/British");
expect(getDiscordLanguageByLocale("ro")).to.equal("Romanian");
});

Expand All @@ -70,7 +70,7 @@ describe("getDiscordLanguageByLocale()", () => {

describe("getLogosLanguageByLocale()", () => {
it("returns the language corresponding to the passed locale.", () => {
expect(getLogosLanguageByLocale("eng-US")).to.equal("English/American");
expect(getLogosLanguageByLocale("eng-GB")).to.equal("English/British");
expect(getLogosLanguageByLocale("ron")).to.equal("Romanian");
});
});

0 comments on commit 8290d34

Please sign in to comment.