Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[450 - Fix locales breakybreaky] mod locales constant and set paths correctly #464

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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