Skip to content

Commit

Permalink
fix: missing translation
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrkafuu committed Mar 17, 2022
1 parent 5895afd commit 3e5a8d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/views/SettingsTransfer.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import { useCallback, useState } from 'react';
import clsx from 'clsx';
import { useStore, useLongPress } from '../hooks';
import { useStore, useLongPress, useTranslation } from '../hooks';
import { IDownload, IUpload, IRefresh } from '../assets/icons';

function SettingsTransfer() {
const { settings } = useStore();
const t = useTranslation();

const handleExport = useCallback(() => {
const data = settings.exportSettings();
if (data) {
prompt('Copy to clipboard using Ctrl+C', data);
prompt(t('Copy to clipboard using Ctrl+C'), data);
}
}, [settings]);
}, [settings, t]);

const handleImport = useCallback(() => {
const data = (prompt('Please enter settings data') || '').trim();
const data = (prompt(t('Please enter settings data')) || '').trim();
if (!data) {
return;
}
const res = settings.importSettings(data);
if (res) {
location.reload();
} else {
alert('Invalid settings data');
alert(t('Invalid settings data'));
}
}, [settings]);
}, [settings, t]);

const handleClear = useCallback(() => {
settings.clearSettings();
Expand Down

0 comments on commit 3e5a8d5

Please sign in to comment.