Skip to content

Commit

Permalink
Update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Oct 24, 2024
1 parent 3891a0b commit c3d51c7
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 271 deletions.
53 changes: 18 additions & 35 deletions components/LocaleSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,34 @@ import '@formatjs/intl-displaynames/polyfill'
import '@formatjs/intl-displaynames/locale-data/ar'
import '@formatjs/intl-displaynames/locale-data/de'
import '@formatjs/intl-displaynames/locale-data/en'
import '@formatjs/intl-displaynames/locale-data/es'
import '@formatjs/intl-displaynames/locale-data/fa'
import '@formatjs/intl-displaynames/locale-data/fr'
import '@formatjs/intl-displaynames/locale-data/my'
import '@formatjs/intl-displaynames/locale-data/pt'
import '@formatjs/intl-displaynames/locale-data/id'
// import '@formatjs/intl-displaynames/locale-data/es'
// import '@formatjs/intl-displaynames/locale-data/fa'
// import '@formatjs/intl-displaynames/locale-data/fr'
import '@formatjs/intl-displaynames/locale-data/km'
// import '@formatjs/intl-displaynames/locale-data/my'
// import '@formatjs/intl-displaynames/locale-data/pt'
import '@formatjs/intl-displaynames/locale-data/ru'
import '@formatjs/intl-displaynames/locale-data/sw'
import '@formatjs/intl-displaynames/locale-data/th'
// import '@formatjs/intl-displaynames/locale-data/sw'
// import '@formatjs/intl-displaynames/locale-data/th'
import '@formatjs/intl-displaynames/locale-data/tr'
import '@formatjs/intl-displaynames/locale-data/vi'
// import '@formatjs/intl-displaynames/locale-data/vi'
import '@formatjs/intl-displaynames/locale-data/zh-Hans'
import '@formatjs/intl-displaynames/locale-data/zh-Hant'


const getLocale = (locale: string) => {
if (locale === 'zh-cn') return 'zh-Hans'
// if (locale === 'pt-BR') return 'pt'
return locale
}

export const getLocalisedLanguageName = (
regionCode: string,
locale: string,
) => {
try {
return new Intl.DisplayNames([locale], { type: 'language' }).of(
return new Intl.DisplayNames([getLocale(locale)], { type: 'language' }).of(
String(regionCode),
)
} catch (e) {
Expand Down Expand Up @@ -69,32 +78,6 @@ const LanguageSelect = (props: LanguageSelectProps) => (
</div>
)

// const LanguageSelect = styled.select`
// color: ${(props) => props.theme.colors.white};
// background: none;
// border: none;
// text-transform: capitalize;
// cursor: pointer;
// font-family: inherit;
// font-size: inherit;
// padding: 0;
// padding-bottom: 6px;
// padding-right: 10px;
// outline: none;
// appearance: none;
// -webkit-appearance: none;
// -moz-appearance: none;
// -ms-appearance: none;
// -o-appearance: none;
// background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23FFFFFF%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E");
// background-size: .6em;
// background-position: 100% 0.2rem;
// background-repeat: no-repeat;
// html[dir="rtl"] &, body[dir="rtl"] &: {
// background-position: 0, 0.2rem;
// },
// `

const LocaleSwitcher = () => {
const router = useRouter()
const { pathname, asPath, query } = router
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.2",
"react-icons": "^5.3.0",
"react-intl": "^6.6.8",
"react-intl": "^6.8.2",
"react-outside-click-handler": "^1.3.0",
"swr": "^2.2.5",
"tailwind-merge": "^2.5.2",
Expand Down
25 changes: 0 additions & 25 deletions public/static/lang/es.json

This file was deleted.

25 changes: 0 additions & 25 deletions public/static/lang/fa.json

This file was deleted.

27 changes: 0 additions & 27 deletions public/static/lang/pt-br.json

This file was deleted.

25 changes: 0 additions & 25 deletions public/static/lang/th.json

This file was deleted.

27 changes: 0 additions & 27 deletions public/static/lang/vi.json

This file was deleted.

25 changes: 0 additions & 25 deletions public/static/lang/zh-TW.json

This file was deleted.

Loading

0 comments on commit c3d51c7

Please sign in to comment.