Skip to content

Commit

Permalink
Enable Chinese language in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Jan 2, 2025
1 parent 0043087 commit 9c7ab62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { formatter } from '@lingui/format-po';

export default defineConfig({
sourceLocale: 'en-US',
locales: ['en-US', 'de-DE'],
locales: ['en-US', 'de-DE', 'zh-CN'],
format: formatter({ printPlaceholdersInComments: false }),

catalogs: [
Expand Down
4 changes: 2 additions & 2 deletions src/contexts/LanguageContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { loadCatalog } from '@/i18n';
import { createContext, useContext, useState, ReactNode } from 'react';
import { createContext, ReactNode, useContext } from 'react';

const SUPPORTED_LANGUAGES = ['en-US', 'de-DE'] as const;
const SUPPORTED_LANGUAGES = ['en-US', 'de-DE', 'zh-CN'] as const;
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number];
export interface LanguageContextType {
locale: SupportedLanguage;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ import {
SelectValue,
} from '@/components/ui/select';
import { Switch } from '@/components/ui/switch';
import { useLanguage } from '@/contexts/LanguageContext';
import { useErrors } from '@/hooks/useErrors';
import useInitialization from '@/hooks/useInitialization';
import { useWallet } from '@/hooks/useWallet';
import { useWalletConnect } from '@/hooks/useWalletConnect';
import { clearState, fetchState } from '@/state';
import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { useContext, useEffect, useState } from 'react';
import { DarkModeContext } from '../App';
import {
Expand All @@ -28,10 +31,6 @@ import {
WalletConfig,
} from '../bindings';
import { isValidU32 } from '../validation';
import { Trans } from '@lingui/react/macro';
import { t } from '@lingui/core/macro';
import { loadCatalog } from '@/i18n';
import { useLanguage } from '@/contexts/LanguageContext';

export default function Settings() {
const initialized = useInitialization();
Expand Down Expand Up @@ -87,6 +86,7 @@ function GlobalSettings() {
<SelectContent>
<SelectItem value='en-US'>English</SelectItem>
<SelectItem value='de-DE'>Deutsch</SelectItem>
<SelectItem value='zh-CN'>Chinese</SelectItem>
</SelectContent>
</Select>
</div>
Expand Down

0 comments on commit 9c7ab62

Please sign in to comment.