Skip to content

Commit

Permalink
add support for Hungarian
Browse files Browse the repository at this point in the history
  • Loading branch information
v-almonacid committed Jun 11, 2021
1 parent 74ac81d commit 9fce6ae
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 0 deletions.
Binary file added src/assets/img/flags/hungarian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/flags/hungarian@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/flags/hungarian@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/components/Common/LanguagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import frenchFlagIcon from '../../assets/img/flags/french.png'
import italianFlagIcon from '../../assets/img/flags/italian.png'
import dutchFlagIcon from '../../assets/img/flags/dutch.png'
import czechFlagIcon from '../../assets/img/flags/czech.png'
import hungarianFlagIcon from '../../assets/img/flags/hungarian.png'
import LanguageListItem from './LanguageListItem'
import {LANGUAGES} from '../../i18n/languages'
import {Button, StatusBar} from '../UiKit'
Expand Down Expand Up @@ -88,6 +89,11 @@ const messages = defineMessages({
defaultMessage: 'Čeština',
description: 'some desc',
},
hungarian: {
id: 'components.common.languagepicker.hungarian',
defaultMessage: 'Magyar',
description: 'some desc',
},
continueButton: {
id: 'components.common.languagepicker.continueButton',
defaultMessage: '!!!Choose language',
Expand Down Expand Up @@ -174,6 +180,11 @@ const supportedLanguages = (intl) => {
code: LANGUAGES.CZECH,
icon: czechFlagIcon,
},
{
label: intl.formatMessage(messages.hungarian),
code: LANGUAGES.HUNGARIAN,
icon: hungarianFlagIcon,
},
// TODO: Add back when chinese traditional is available
// {
// label: languages.chineseTraditional,
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/appSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import FR_FR_TOS from '../i18n/locales/terms-of-use/ada/fr-FR.md'
import IT_IT_TOS from '../i18n/locales/terms-of-use/ada/it-IT.md'
import NL_NL_TOS from '../i18n/locales/terms-of-use/ada/nl-NL.md'
import CS_CZ_TOS from '../i18n/locales/terms-of-use/ada/cs-CZ.md'
import HU_HU_TOS from '../i18n/locales/terms-of-use/ada/hu-HU.md'

const tosByCode = {
'en-US': EN_US_TOS,
Expand All @@ -33,6 +34,7 @@ const tosByCode = {
'it-IT': IT_IT_TOS,
'nl-NL': NL_NL_TOS,
'cs-CZ': CS_CZ_TOS,
'hu-HU': HU_HU_TOS,
}

// Note(ppershing): following values have to be in sync with
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'moment/locale/fr'
import 'moment/locale/it'
import 'moment/locale/nl'
import 'moment/locale/cs'
import 'moment/locale/hu'

import assert from '../utils/assert'
import {LANGUAGES} from './languages'
Expand All @@ -37,6 +38,7 @@ const momentLocales = {
[LANGUAGES.ITALIAN]: 'it',
[LANGUAGES.DUTCH]: 'nl',
[LANGUAGES.CZECH]: 'cs',
[LANGUAGES.HUNGARIAN]: 'hu',
}

// Add default custom formatting functions
Expand Down Expand Up @@ -104,6 +106,7 @@ const numberLocales = {
[LANGUAGES.ITALIAN]: defaultCommaDecimalSeparatorFmt,
[LANGUAGES.DUTCH]: defaultNumberFmt,
[LANGUAGES.CZECH]: defaultCommaDecimalSeparatorFmt,
[LANGUAGES.HUNGARIAN]: defaultCommaDecimalSeparatorFmt,
}

export const setLanguage = (code: string) => {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export const LANGUAGES = {
ITALIAN: 'it-IT',
DUTCH: 'nl-NL',
CZECH: 'cs-CZ',
HUNGARIAN: 'hu-HU',
}
1 change: 1 addition & 0 deletions src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"components.common.languagepicker.english": "English",
"components.common.languagepicker.french": "Français",
"components.common.languagepicker.german": "Deutsch",
"components.common.languagepicker.hungarian": "Magyar",
"components.common.languagepicker.indonesian": "Bahasa Indonesia",
"components.common.languagepicker.italian": "Italiano",
"components.common.languagepicker.japanese": "日本語",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import frFR from './locales/fr-FR'
import itIT from './locales/it-IT'
import nlNL from './locales/nl-NL'
import csCZ from './locales/cs-CZ'
import huHU from './locales/hu-HU'
// TODO: Add when chinese traditional is available
// import zhHant from './locales/zh-Hant'

Expand Down Expand Up @@ -43,5 +44,6 @@ translations[LANGUAGES.FRENCH] = Object.assign({}, defaultLocale, frFR)
translations[LANGUAGES.ITALIAN] = Object.assign({}, defaultLocale, itIT)
translations[LANGUAGES.DUTCH] = Object.assign({}, defaultLocale, nlNL)
translations[LANGUAGES.CZECH] = Object.assign({}, defaultLocale, csCZ)
translations[LANGUAGES.HUNGARIAN] = Object.assign({}, defaultLocale, huHU)

export default translations
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import fr from 'react-intl/locale-data/fr'
import it from 'react-intl/locale-data/it'
import nl from 'react-intl/locale-data/nl'
import cs from 'react-intl/locale-data/cs'
import hu from 'react-intl/locale-data/hu'

import {connect, Provider} from 'react-redux'

Expand Down Expand Up @@ -51,6 +52,7 @@ addLocaleData([
...it,
...nl,
...cs,
...hu,
])

/*
Expand Down

0 comments on commit 9fce6ae

Please sign in to comment.