feat(lang): add Catalan to language picker (#1309)

pull/1325/head
TheCatLady 4 years ago committed by GitHub
parent 72931f3035
commit 77911c03e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,11 +1,11 @@
import React, { useState, useRef, useContext } from 'react';
import Transition from '../../Transition';
import useClickOutside from '../../../hooks/useClickOutside';
import React, { useContext, useRef, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import {
LanguageContext,
AvailableLocales,
LanguageContext,
} from '../../../context/LanguageContext';
import { useIntl, defineMessages } from 'react-intl';
import useClickOutside from '../../../hooks/useClickOutside';
import Transition from '../../Transition';
const messages = defineMessages({
changelanguage: 'Change Language',
@ -17,6 +17,10 @@ type AvailableLanguageObject = Record<
>;
const availableLanguages: AvailableLanguageObject = {
ca: {
code: 'ca',
display: 'Català',
},
de: {
code: 'de',
display: 'Deutsch',

@ -1,6 +1,7 @@
import React, { ReactNode } from 'react';
export type AvailableLocales =
| 'ca'
| 'de'
| 'en'
| 'es'

@ -21,6 +21,8 @@ import '../styles/globals.css';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const loadLocaleData = (locale: AvailableLocales): Promise<any> => {
switch (locale) {
case 'ca':
return import('../i18n/locale/ca.json');
case 'de':
return import('../i18n/locale/de.json');
case 'es':

Loading…
Cancel
Save