umami/src/lib/lang.js

106 lines
3.1 KiB
JavaScript
Raw Normal View History

2020-10-03 20:45:19 +02:00
import {
arSA,
2023-02-22 12:25:13 +01:00
be,
2022-08-02 02:14:36 +02:00
bn,
2020-10-22 19:36:08 +02:00
cs,
2021-03-15 22:25:43 +01:00
sk,
2020-10-22 19:36:08 +02:00
da,
2020-10-03 20:45:19 +02:00
de,
2020-10-22 19:36:08 +02:00
el,
enUS,
enGB,
2020-10-03 20:45:19 +02:00
es,
2020-10-22 19:36:08 +02:00
fi,
2020-10-03 20:45:19 +02:00
fr,
2021-03-13 07:30:26 +01:00
faIR,
2020-12-04 12:13:18 +01:00
he,
hi,
2023-04-20 03:42:29 +02:00
hr,
2020-10-22 19:36:08 +02:00
id,
2020-12-12 10:10:58 +01:00
it,
2020-10-22 19:36:08 +02:00
ja,
km,
2021-07-23 04:16:21 +02:00
ko,
lt,
2021-05-17 07:04:40 +02:00
mn,
2021-03-27 04:52:54 +01:00
ms,
2020-10-22 19:36:08 +02:00
nb,
nl,
2020-11-07 02:30:21 +01:00
pl,
2020-10-03 20:45:19 +02:00
pt,
ptBR,
2020-10-03 20:45:19 +02:00
ro,
2020-10-22 19:36:08 +02:00
ru,
2021-08-20 10:09:04 +02:00
sl,
2020-10-22 19:36:08 +02:00
sv,
2020-11-25 09:32:34 +01:00
ta,
2022-08-02 02:14:36 +02:00
th,
2020-10-22 19:36:08 +02:00
tr,
2020-10-03 20:45:19 +02:00
uk,
2020-10-22 19:36:08 +02:00
zhCN,
zhTW,
2021-05-20 00:40:03 +02:00
ca,
2021-06-29 06:11:12 +02:00
hu,
2021-11-22 07:38:11 +01:00
vi,
2020-10-03 20:45:19 +02:00
} from 'date-fns/locale';
2020-09-08 04:48:40 +02:00
export const languages = {
2021-11-05 01:09:03 +01:00
'ar-SA': { label: 'العربية', dateLocale: arSA, dir: 'rtl' },
2023-02-22 12:25:13 +01:00
'be-BY': { label: 'Беларуская', dateLocale: be },
'bn-BD': { label: 'বাংলা', dateLocale: bn },
2021-11-05 01:09:03 +01:00
'ca-ES': { label: 'Català', dateLocale: ca },
'cs-CZ': { label: 'Čeština', dateLocale: cs },
'da-DK': { label: 'Dansk', dateLocale: da },
'de-CH': { label: 'Schwiizerdütsch', dateLocale: de },
2021-11-05 01:09:03 +01:00
'de-DE': { label: 'Deutsch', dateLocale: de },
'el-GR': { label: 'Ελληνικά', dateLocale: el },
2021-11-05 01:09:03 +01:00
'en-GB': { label: 'English (UK)', dateLocale: enGB },
'en-US': { label: 'English (US)', dateLocale: enUS },
2021-11-05 01:09:03 +01:00
'es-MX': { label: 'Español', dateLocale: es },
'fa-IR': { label: 'فارسی', dateLocale: faIR, dir: 'rtl' },
'fi-FI': { label: 'Suomi', dateLocale: fi },
2021-11-05 01:09:03 +01:00
'fo-FO': { label: 'Føroyskt' },
'fr-FR': { label: 'Français', dateLocale: fr },
2022-06-27 05:56:24 +02:00
'ga-ES': { label: 'Galacian (Spain)', dateLocale: es },
2021-11-05 01:09:03 +01:00
'he-IL': { label: 'עברית', dateLocale: he },
'hi-IN': { label: 'हिन्दी', dateLocale: hi },
2023-01-23 18:54:35 +01:00
'hr-HR': { label: 'Hrvatski', dateLocale: hr },
'hu-HU': { label: 'Hungarian', dateLocale: hu },
2021-11-05 01:09:03 +01:00
'id-ID': { label: 'Bahasa Indonesia', dateLocale: id },
'it-IT': { label: 'Italiano', dateLocale: it },
2021-11-05 01:09:03 +01:00
'ja-JP': { label: '日本語', dateLocale: ja },
'km-KH': { label: 'ភាសាខ្មែរ', dateLocale: km },
2021-11-05 01:09:03 +01:00
'ko-KR': { label: '한국어', dateLocale: ko },
'lt-LT': { label: 'Lietuvių', dateLocale: lt },
2021-11-05 01:09:03 +01:00
'mn-MN': { label: 'Монгол', dateLocale: mn },
'ms-MY': { label: 'Malay', dateLocale: ms },
'my-MM': { label: 'မြန်မာဘာသာ', dateLocale: enUS },
'nl-NL': { label: 'Nederlands', dateLocale: nl },
2021-11-05 01:09:03 +01:00
'nb-NO': { label: 'Norsk Bokmål', dateLocale: nb },
'pl-PL': { label: 'Polski', dateLocale: pl },
'pt-BR': { label: 'Português do Brasil', dateLocale: ptBR },
'pt-PT': { label: 'Português', dateLocale: pt },
2021-11-05 01:09:03 +01:00
'ro-RO': { label: 'Română', dateLocale: ro },
'ru-RU': { label: 'Русский', dateLocale: ru },
2023-04-20 03:42:29 +02:00
'si-LK': { label: 'සිංහල', dateLocale: id },
2021-11-05 01:09:03 +01:00
'sk-SK': { label: 'Slovenčina', dateLocale: sk },
'sl-SI': { label: 'Slovenščina', dateLocale: sl },
'sv-SE': { label: 'Svenska', dateLocale: sv },
'ta-IN': { label: 'தமிழ்', dateLocale: ta },
2022-08-02 02:14:36 +02:00
'th-TH': { label: 'ภาษาไทย', dateLocale: th },
2021-11-05 01:09:03 +01:00
'tr-TR': { label: 'Türkçe', dateLocale: tr },
'uk-UA': { label: 'українська', dateLocale: uk },
'ur-PK': { label: 'Urdu (Pakistan)', dateLocale: uk, dir: 'rtl' },
2021-11-22 07:38:11 +01:00
'vi-VN': { label: 'Tiếng Việt', dateLocale: vi },
'zh-CN': { label: '中文', dateLocale: zhCN },
'zh-TW': { label: '中文(繁體)', dateLocale: zhTW },
2020-09-08 04:48:40 +02:00
};
2021-11-21 02:18:25 +01:00
export function getDateLocale(locale) {
return languages[locale]?.dateLocale || enUS;
}
export function getTextDirection(locale) {
return languages[locale]?.dir || 'ltr';
}