Skip to content
Open
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
5 changes: 3 additions & 2 deletions client/src/i18n/TranslationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ar from './translations/ar'
import br from './translations/br'
import cs from './translations/cs'
import pl from './translations/pl'
import tr from './translations/tr'
import { SUPPORTED_LANGUAGES, SupportedLanguageCode } from './supportedLanguages'

export { SUPPORTED_LANGUAGES }
Expand All @@ -23,7 +24,7 @@ type TranslationStrings = Record<string, string | { name: string; category: stri

// Keyed by SupportedLanguageCode so TypeScript enforces all languages have a translation.
const translations: Record<SupportedLanguageCode, TranslationStrings> = {
de, en, es, fr, hu, it, ru, zh, 'zh-TW': zhTw, nl, id, ar, br, cs, pl,
de, en, es, fr, hu, it, ru, zh, 'zh-TW': zhTw, nl, id, ar, br, cs, pl, tr,
}

// Derived from SUPPORTED_LANGUAGES — add new languages there, not here.
Expand All @@ -38,7 +39,7 @@ export function getLocaleForLanguage(language: string): string {

export function getIntlLanguage(language: string): string {
if (language === 'br') return 'pt-BR'
return ['de', 'es', 'fr', 'hu', 'it', 'ru', 'zh', 'zh-TW', 'nl', 'ar', 'cs', 'pl', 'id'].includes(language) ? language : 'en'
return ['de', 'es', 'fr', 'hu', 'it', 'ru', 'zh', 'zh-TW', 'nl', 'ar', 'cs', 'pl', 'id', 'tr'].includes(language) ? language : 'en'
}

export function isRtlLanguage(language: string): boolean {
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/supportedLanguages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const SUPPORTED_LANGUAGES = [
{ value: 'it', label: 'Italiano', locale: 'it-IT' },
{ value: 'ar', label: 'العربية', locale: 'ar-SA' },
{ value: 'id', label: 'Bahasa Indonesia', locale: 'id-ID' },
{ value: 'tr', label: 'Turkish', locale: 'tr-TR' },
] as const

export type SupportedLanguageCode = typeof SUPPORTED_LANGUAGES[number]['value']
Expand Down
Loading
Loading