✅ Add tests for some tools functions (#1377)
* ✅ Add tests for some tools functions * 🐛 Build issue with language definition
This commit is contained in:
@@ -13,7 +13,7 @@ export type Language = {
|
||||
locale: string;
|
||||
};
|
||||
|
||||
export const languages: Language[] = [
|
||||
export const languages = [
|
||||
{
|
||||
shortName: 'de',
|
||||
originalName: 'Deutsch',
|
||||
@@ -93,6 +93,7 @@ export const languages: Language[] = [
|
||||
originalName: 'LOLCAT',
|
||||
translatedName: 'LOLCAT',
|
||||
emoji: '🐱',
|
||||
country: 'LOL',
|
||||
locale: 'en-gb',
|
||||
},
|
||||
// Norwegian
|
||||
@@ -224,9 +225,11 @@ export const languages: Language[] = [
|
||||
originalName: 'Magyar',
|
||||
translatedName: 'Hungarian',
|
||||
emoji: '🇭🇺',
|
||||
country: 'HU',
|
||||
locale: 'hu',
|
||||
},
|
||||
];
|
||||
] as const satisfies Readonly<Language[]>;
|
||||
|
||||
export const getLanguageByCode = (code: string | null) =>
|
||||
languages.find((language) => language.shortName === code) ?? languages[languages.length - 1];
|
||||
languages.find((language) => language.shortName === code) ??
|
||||
languages.find((x) => x.locale === 'en-gb')!;
|
||||
|
||||
Reference in New Issue
Block a user