Skip to content

Commit

Permalink
mod locales constant and set paths correctly (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
W3stside authored Apr 27, 2022
1 parent c8d8ce2 commit 4c2e2c6
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/SwitchLocaleLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useLocationLinkProps } from 'hooks/useLocationLinkProps'
import { useMemo } from 'react'
import styled from 'styled-components/macro'

import { DEFAULT_LOCALE, LOCALE_LABEL, SupportedLocale } from '../../constants/locales'
import { DEFAULT_LOCALE, LOCALE_LABEL, SupportedLocale } from 'constants/locales'
import { navigatorLocale, useActiveLocale } from '../../hooks/useActiveLocale'
import { StyledInternalLink, ThemedText } from '../../theme'

Expand Down
1 change: 1 addition & 0 deletions src/custom/constants/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './localesMod'
77 changes: 77 additions & 0 deletions src/custom/constants/locales/localesMod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
export const SUPPORTED_LOCALES = [
// order as they appear in the language dropdown
'en-US',
/* 'af-ZA',
'ar-SA',
'ca-ES',
'cs-CZ',
'da-DK',
'de-DE',
'el-GR',
'es-ES',
'fi-FI',
'fr-FR',
'he-IL',
'hu-HU',
'id-ID',
'it-IT',
'ja-JP',
'ko-KR',
'nl-NL',
'no-NO',
'pl-PL',
'pt-BR',
'pt-PT',
'ro-RO',
'ru-RU',
'sr-SP',
'sv-SE',
'sw-TZ',
'tr-TR',
'uk-UA',
'vi-VN',
'zh-CN',
'zh-TW', */
]
export type SupportedLocale = typeof SUPPORTED_LOCALES[number] | 'pseudo'

// eslint-disable-next-line import/first
import * as enUS from 'locales/en-US'
export const DEFAULT_LOCALE: SupportedLocale = 'en-US'
export const DEFAULT_CATALOG = enUS

export const LOCALE_LABEL: { [locale in SupportedLocale]: string } = {
/* 'af-ZA': 'Afrikaans',
'ar-SA': 'العربية',
'ca-ES': 'Català',
'cs-CZ': 'čeština',
'da-DK': 'dansk',
'de-DE': 'Deutsch',
'el-GR': 'ελληνικά', */
'en-US': 'English',
/* 'es-ES': 'Español',
'fi-FI': 'suomi',
'fr-FR': 'français',
'he-IL': 'עִברִית',
'hu-HU': 'Magyar',
'id-ID': 'bahasa Indonesia',
'it-IT': 'Italiano',
'ja-JP': '日本語',
'ko-KR': '한국어',
'nl-NL': 'Nederlands',
'no-NO': 'norsk',
'pl-PL': 'Polskie',
'pt-BR': 'português',
'pt-PT': 'português',
'ro-RO': 'Română',
'ru-RU': 'русский',
'sr-SP': 'Српски',
'sv-SE': 'svenska',
'sw-TZ': 'Kiswahili',
'tr-TR': 'Türkçe',
'uk-UA': 'Український',
'vi-VN': 'Tiếng Việt',
'zh-CN': '简体中文',
'zh-TW': '繁体中文', */
pseudo: 'ƥƨèúδô',
}
2 changes: 1 addition & 1 deletion src/state/user/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Percent, Token } from '@uniswap/sdk-core'
import { computePairAddress, Pair } from '@uniswap/v2-sdk'
import { L2_CHAIN_IDS } from '@src/constants/chains'
import { SupportedLocale } from '@src/constants/locales'
import { SupportedLocale } from 'constants/locales'
import { L2_DEADLINE_FROM_NOW } from 'constants/misc'
import useActiveWeb3React from 'hooks/useActiveWeb3React'
import JSBI from 'jsbi'
Expand Down

0 comments on commit 4c2e2c6

Please sign in to comment.