Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Switch to British English as the default language. #375

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
});
});