Add crowdin live-translate feature!

This commit is contained in:
Thomas Camlong
2023-10-31 00:21:01 +01:00
parent 181193bdf8
commit 53ef4a0579
4 changed files with 23 additions and 43 deletions

View File

@@ -2,7 +2,6 @@ export type Language = {
shortName: string;
originalName: string;
translatedName: string;
emoji: string;
/**
* The country identified b<y the ISO-3166 alpha 2 code:
@@ -18,7 +17,6 @@ export const languages = [
shortName: 'de',
originalName: 'Deutsch',
translatedName: 'German',
emoji: '🇩🇪',
country: 'DE',
locale: 'de',
},
@@ -26,7 +24,6 @@ export const languages = [
shortName: 'en',
originalName: 'English',
translatedName: 'English',
emoji: '🇬🇧',
country: 'GB',
locale: 'en-gb',
},
@@ -35,7 +32,6 @@ export const languages = [
shortName: 'da',
originalName: 'Dansk',
translatedName: 'Danish',
emoji: '🇩🇰',
country: 'DK',
locale: 'da',
},
@@ -44,7 +40,6 @@ export const languages = [
shortName: 'he',
originalName: 'עברית',
translatedName: 'Hebrew',
emoji: '🇮🇱',
country: 'IL',
locale: 'he',
},
@@ -52,7 +47,6 @@ export const languages = [
shortName: 'es',
originalName: 'Español',
translatedName: 'Spanish',
emoji: '🇪🇸',
country: 'ES',
locale: 'es',
},
@@ -60,7 +54,6 @@ export const languages = [
shortName: 'fr',
originalName: 'Français',
translatedName: 'French',
emoji: '🇫🇷',
country: 'FR',
locale: 'fr',
},
@@ -68,7 +61,6 @@ export const languages = [
shortName: 'it',
originalName: 'Italiano',
translatedName: 'Italian',
emoji: '🇮🇹',
country: 'IT',
locale: 'it',
},
@@ -76,7 +68,6 @@ export const languages = [
shortName: 'ja',
originalName: '日本語',
translatedName: 'Japanese',
emoji: '🇯🇵',
country: 'JP',
locale: 'ja',
},
@@ -84,24 +75,14 @@ export const languages = [
shortName: 'ko',
originalName: '한국어',
translatedName: 'Korean',
emoji: '🇰🇷',
country: 'KR',
locale: 'ko',
},
{
shortName: 'lol',
originalName: 'LOLCAT',
translatedName: 'LOLCAT',
emoji: '🐱',
country: 'LOL',
locale: 'en-gb',
},
// Norwegian
{
shortName: 'no',
originalName: 'Norsk',
translatedName: 'Norwegian',
emoji: '🇳🇴',
country: 'NO',
locale: 'nb',
},
@@ -110,7 +91,6 @@ export const languages = [
shortName: 'sk',
originalName: 'Slovenčina',
translatedName: 'Slovak',
emoji: '🇸🇰',
country: 'SK',
locale: 'sk',
},
@@ -118,7 +98,6 @@ export const languages = [
shortName: 'nl',
originalName: 'Nederlands',
translatedName: 'Dutch',
emoji: '🇳🇱',
country: 'NL',
locale: 'nl',
},
@@ -126,7 +105,6 @@ export const languages = [
shortName: 'pl',
originalName: 'Polski',
translatedName: 'Polish',
emoji: '🇵🇱',
country: 'PL',
locale: 'pl',
},
@@ -134,7 +112,6 @@ export const languages = [
shortName: 'pt',
originalName: 'Português',
translatedName: 'Portuguese',
emoji: '🇵🇹',
country: 'PT',
locale: 'pt',
},
@@ -142,7 +119,6 @@ export const languages = [
shortName: 'ru',
originalName: 'Русский',
translatedName: 'Russian',
emoji: '🇷🇺',
country: 'RU',
locale: 'ru',
},
@@ -150,7 +126,6 @@ export const languages = [
shortName: 'sl',
originalName: 'Slovenščina',
translatedName: 'Slovenian',
emoji: '🇸🇮',
country: 'SI',
locale: 'sl',
},
@@ -158,7 +133,6 @@ export const languages = [
shortName: 'sv',
originalName: 'Svenska',
translatedName: 'Swedish',
emoji: '🇸🇪',
country: 'SE',
locale: 'sv',
},
@@ -166,7 +140,6 @@ export const languages = [
shortName: 'uk',
originalName: 'Українська',
translatedName: 'Ukrainian',
emoji: '🇺🇦',
country: 'UA',
locale: 'uk',
},
@@ -175,7 +148,6 @@ export const languages = [
shortName: 'vi',
originalName: 'Tiếng Việt',
translatedName: 'Vietnamese',
emoji: '🇻🇳',
country: 'VN',
locale: 'vi',
},
@@ -183,14 +155,12 @@ export const languages = [
shortName: 'zh',
originalName: '中文',
translatedName: 'Chinese',
emoji: '🇨🇳',
country: 'CN',
locale: 'zh-cn',
},
{
originalName: 'Ελληνικά',
translatedName: 'Greek',
emoji: '🇬🇷',
country: 'GR',
shortName: 'gr',
locale: 'el',
@@ -199,7 +169,6 @@ export const languages = [
shortName: 'tr',
originalName: 'Türkçe',
translatedName: 'Turkish',
emoji: '🇹🇷',
country: 'TR',
locale: 'tr',
},
@@ -207,7 +176,6 @@ export const languages = [
shortName: 'lv',
originalName: 'Latvian',
translatedName: 'Latvian',
emoji: '🇱🇻',
country: 'LV',
locale: 'lv',
},
@@ -215,7 +183,6 @@ export const languages = [
shortName: 'hr',
originalName: 'Hrvatski',
translatedName: 'Croatian',
emoji: '🇭🇷',
country: 'HR',
locale: 'hr',
},
@@ -224,10 +191,17 @@ export const languages = [
shortName: 'hu',
originalName: 'Magyar',
translatedName: 'Hungarian',
emoji: '🇭🇺',
country: 'HU',
locale: 'hu',
},
// Crowdin Live translate
{
shortName: 'cr',
originalName: 'Crowdin',
translatedName: '(Live translation)',
country: 'CROWDIN',
locale: 'cr',
},
] as const satisfies Readonly<Language[]>;
export const getLanguageByCode = (code: string | null) =>