Skip to content

Commit

Permalink
Merge pull request #1100 from alephium/bump
Browse files Browse the repository at this point in the history
Fix language switch and bump explorer version to 1.10.11
  • Loading branch information
nop33 authored Jan 10, 2025
2 parents bd8c060 + 66569f5 commit ca805e8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .changeset/famous-crews-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-wasps-compete.md

This file was deleted.

7 changes: 7 additions & 0 deletions apps/explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @alephium/explorer

## 1.10.11

### Patch Changes

- 49b18da: Enable Portuguese translations
- 8c8caaf: Enable Thai translations

## 1.10.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alephium/explorer",
"description": "The Alephium explorer frontend",
"version": "1.10.10",
"version": "1.10.11",
"private": true,
"scripts": {
"start": "turbo start:app",
Expand Down
1 change: 1 addition & 0 deletions apps/explorer/src/features/localization/LanguageSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ export default styled(LanguageSwitch)`
border-radius: 8px;
background-color: ${({ theme }) => theme.bg.primary};
border: 1px solid ${({ theme }) => theme.border.primary};
min-width: 150px;
`
10 changes: 8 additions & 2 deletions apps/explorer/src/features/localization/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import i18next from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'

import { supportedLanguages } from '@/features/localization/languages'

import de from '../../../locales/de-DE/translation.json'
import el from '../../../locales/el-GR/translation.json'
import en from '../../../locales/en-US/translation.json'
import fr from '../../../locales/fr-FR/translation.json'
import id from '../../../locales/id-ID/translation.json'
import it from '../../../locales/it-IT/translation.json'
import pt from '../../../locales/pt-PT/translation.json'
import th from '../../../locales/th-TH/translation.json'
import vi from '../../../locales/vi-VN/translation.json'
import zh from '../../../locales/zh-CN/translation.json'

Expand All @@ -23,9 +27,11 @@ i18next
de: { translation: de },
vi: { translation: vi },
zh: { translation: zh },
it: { translation: it }
it: { translation: it },
pt: { translation: pt },
th: { translation: th }
},
supportedLngs: ['en', 'fr', 'id', 'el', 'de', 'vi', 'zh', 'it'],
supportedLngs: supportedLanguages,
fallbackLng: 'en',
detection: {
lookupLocalStorage: 'language'
Expand Down
4 changes: 3 additions & 1 deletion apps/explorer/src/features/localization/languages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type Language = 'en' | 'fr' | 'id' | 'el' | 'de' | 'vi' | 'zh' | 'it' | 'pt' | 'th'
export const supportedLanguages = ['en', 'fr', 'id', 'el', 'de', 'vi', 'zh', 'it', 'pt', 'th']

export type Language = (typeof supportedLanguages)[number]

export const languageOptions: Array<{ label: string; value: Language }> = [
{ label: 'English', value: 'en' },
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './fonts/index.css'
import '@/i18n'
import '@/features/localization/i18n'

import isPropValid from '@emotion/is-prop-valid'
import { StrictMode } from 'react'
Expand Down

0 comments on commit ca805e8

Please sign in to comment.