Skip to content

Commit

Permalink
feat(lang): add support for Italian, Portuguese (Brazil) and Serbian
Browse files Browse the repository at this point in the history
  • Loading branch information
sct committed Dec 19, 2020
1 parent 6f2de85 commit 108dfc4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/components/Layout/LanguagePicker/index.tsx
Expand Up @@ -49,6 +49,18 @@ const availableLanguages: AvailableLanguageObject = {
code: 'es',
display: 'Spanish',
},
it: {
code: 'it',
display: 'Italian',
},
'pt-BR': {
code: 'pt-BR',
display: 'Portuguese (Brazil)',
},
sr: {
code: 'sr',
display: 'Serbian',
},
};

const LanguagePicker: React.FC = () => {
Expand Down
5 changes: 4 additions & 1 deletion src/context/LanguageContext.tsx
Expand Up @@ -8,7 +8,10 @@ export type AvailableLocales =
| 'de'
| 'ru'
| 'nl'
| 'es';
| 'es'
| 'it'
| 'pt-BR'
| 'sr';

interface LanguageContextProps {
locale: AvailableLocales;
Expand Down
6 changes: 6 additions & 0 deletions src/pages/_app.tsx
Expand Up @@ -31,6 +31,12 @@ const loadLocaleData = (locale: string): Promise<any> => {
return import('../i18n/locale/nl.json');
case 'es':
return import('../i18n/locale/es.json');
case 'it':
return import('../i18n/locale/it.json');
case 'pt-BR':
return import('../i18n/locale/pt_BR.json');
case 'sr':
return import('../i18n/locale/sr.json');
default:
return import('../i18n/locale/en.json');
}
Expand Down

0 comments on commit 108dfc4

Please sign in to comment.