mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 14:08:55 +08:00
update i18n
This commit is contained in:
@@ -12,8 +12,8 @@ import { useSettings } from './use-settings';
|
||||
|
||||
export const SettingsList = () => {
|
||||
const settings = useSettings();
|
||||
const { t, i18n } = useTranslation();
|
||||
const changeLanguage = (event: any) => {
|
||||
const { i18n } = useTranslation();
|
||||
const changeLanguage = event => {
|
||||
i18n.changeLanguage(event);
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ export const SettingsList = () => {
|
||||
|
||||
return (
|
||||
<ListItem key={item.name} onClick={() => item.onClick()}>
|
||||
{t(`stetting.Settings.${item.name}`)}
|
||||
{item.name}
|
||||
{item.name === 'Language' ? (
|
||||
<div style={{ marginLeft: '12em' }}>
|
||||
<Select
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { message } from '@toeverything/components/ui';
|
||||
import { copyToClipboard } from '@toeverything/utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useSettingFlags, type SettingFlags } from './use-setting-flags';
|
||||
|
||||
import {
|
||||
// useReadingMode,
|
||||
clearWorkspace,
|
||||
duplicatePage,
|
||||
exportHtml,
|
||||
@@ -64,6 +65,7 @@ export const useSettings = (): SettingItem[] => {
|
||||
const { workspaceId, pageId } = useWorkspaceAndPageId();
|
||||
const navigate = useNavigate();
|
||||
const settingFlags = useSettingFlags();
|
||||
const { t } = useTranslation();
|
||||
// const { toggleReadingMode, readingMode } = useReadingMode();
|
||||
|
||||
const settings: SettingItem[] = [
|
||||
@@ -80,7 +82,7 @@ export const useSettings = (): SettingItem[] => {
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
name: 'Duplicate Page',
|
||||
name: t('Setting.Settings.Duplicate Page'),
|
||||
onClick: async () => {
|
||||
const newPageInfo = await duplicatePage({
|
||||
workspaceId,
|
||||
@@ -91,7 +93,7 @@ export const useSettings = (): SettingItem[] => {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: 'Copy Page Link',
|
||||
name: t('Setting.Settings.Copy Page Link'),
|
||||
onClick: () => {
|
||||
copyToClipboard(window.location.href);
|
||||
message.success('Page link copied successfully');
|
||||
@@ -99,9 +101,9 @@ export const useSettings = (): SettingItem[] => {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: 'Language',
|
||||
name: t('Setting.Settings.Language'),
|
||||
onClick: () => {
|
||||
console.log('Language is change');
|
||||
//Do noting
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -148,7 +150,7 @@ export const useSettings = (): SettingItem[] => {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
name: 'Clear Workspace',
|
||||
name: t('Setting.Settings.Clear Workspace'),
|
||||
onClick: () => clearWorkspace(workspaceId),
|
||||
flag: 'booleanClearWorkspace',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user