Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/util/i18n/const.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { defineMessage } from "react-intl";67import { IntlMessage } from "./types";89// ATTN: these languages have to match the frontend/package.json script "i18n:download",10// be valid for Antd (<AntdConfigProvider localize.../>),11// and also harmonize with localize::loadLocaleData12export const LOCALE = [13"en", // that's the default, i.e. user never explicitly selected a language14"es",15"de",16"zh",17"ru",18"fr",19"it",20"nl",21"ja",22"hi",23"pt",24"ko",25"pl",26"tr",27"he",28"hu",29"ar",30] as const;3132export type Locale = (typeof LOCALE)[number];3334export const DEFAULT_LOCALE: Locale = "en";3536// user's browser is not english, but user wants to keep english37// this is only for the account's other_settings and maps to "en"38export const KEEP_EN_LOCALE = "en-keep";3940export const OTHER_SETTINGS_LOCALE_KEY = "i18n";4142export const OTHER_SETTINGS_REPLY_ENGLISH_KEY = "llm_reply_english";4344// The ordering is a bit "opinionated". The top languages are European ones, and German has the best quality translations.45// Then come other European languges, kind of alphabetical.4647// Then, the Asian group starts with Chinese, as the largest group.48export const LOCALIZATIONS: {49[key in Locale]: {50name: string;51flag: string;52native: string;53trans: IntlMessage;54};55} = {56en: {57name: "English",58flag: "🇺🇸",59native: "English",60trans: defineMessage({61id: "i18n.localization.lang.english",62defaultMessage: "English",63}),64},65de: {66name: "German",67flag: "🇩🇪",68native: "Deutsch",69trans: defineMessage({70id: "i18n.localization.lang.german",71defaultMessage: "German",72}),73},74es: {75name: "Spanish",76flag: "🇪🇸",77native: "Español",78trans: defineMessage({79id: "i18n.localization.lang.spanish",80defaultMessage: "Spanish",81}),82},83fr: {84name: "French",85flag: "🇫🇷",86native: "Français",87trans: defineMessage({88id: "i18n.localization.lang.french",89defaultMessage: "French",90}),91},92it: {93name: "Italian",94flag: "🇮🇹",95native: "Italiano",96trans: defineMessage({97id: "i18n.localization.lang.italian",98defaultMessage: "Italian",99}),100},101nl: {102name: "Dutch",103flag: "🇳🇱",104native: "Nederlands",105trans: defineMessage({106id: "i18n.localization.lang.dutch",107defaultMessage: "Dutch",108}),109},110pl: {111name: "Polish",112flag: "🇵🇱",113native: "Polski",114trans: defineMessage({115id: "i18n.localization.lang.polish",116defaultMessage: "Polish",117}),118},119hu: {120name: "Hungarian",121flag: "🇭🇺",122native: "Magyar",123trans: defineMessage({124id: "i18n.localization.lang.hungarian",125defaultMessage: "Hungarian",126}),127},128ar: {129name: "Arabic",130flag: "🇪🇬",131native: "العربية",132trans: defineMessage({133id: "i18n.localization.lang.arabic",134defaultMessage: "Arabic",135}),136},137pt: {138name: "Portuguese",139flag: "🇵🇹",140native: "Português",141trans: defineMessage({142id: "i18n.localization.lang.portuguese",143defaultMessage: "Portuguese",144}),145},146tr: {147name: "Turkish",148flag: "🇹🇷",149native: "Türkçe",150trans: defineMessage({151id: "i18n.localization.lang.turkish",152defaultMessage: "Turkish",153}),154},155he: {156name: "Hebrew",157flag: "🇮🇱",158native: "עִבְרִית",159trans: defineMessage({160id: "i18n.localization.lang.hebrew",161defaultMessage: "Hebrew",162}),163},164zh: {165name: "Chinese",166flag: "🇨🇳",167native: "中文",168trans: defineMessage({169id: "i18n.localization.lang.chinese",170defaultMessage: "Chinese",171}),172},173ja: {174name: "Japanese",175flag: "🇯🇵",176native: "日本語",177trans: defineMessage({178id: "i18n.localization.lang.japanese",179defaultMessage: "Japanese",180}),181},182hi: {183name: "Hindi",184flag: "🇮🇳",185native: "हिन्दी",186trans: defineMessage({187id: "i18n.localization.lang.hindi",188defaultMessage: "Hindi",189}),190},191ko: {192name: "Korean",193flag: "🇰🇷",194native: "한국어",195trans: defineMessage({196id: "i18n.localization.lang.korean",197defaultMessage: "Korean",198}),199},200ru: {201name: "Russian",202flag: "🇷🇺",203native: "Русский",204trans: defineMessage({205id: "i18n.localization.lang.russian",206defaultMessage: "Russian",207}),208},209} as const;210211212