feat: migrate to _ locales handler

This commit is contained in:
divocat
2025-10-07 16:55:50 +03:00
parent e0874c3775
commit 9a72785fa7
25 changed files with 213 additions and 212 deletions

View File

@@ -1,29 +0,0 @@
interface CopyToClipboardResponse {
success: boolean;
message: string;
}
export function copyToClipboard(text: string): CopyToClipboardResponse {
const textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand('copy');
return {
success: true,
message: 'Copied!',
};
} catch (err) {
const error = err as Error;
return {
success: false,
message: `Failed to copy: ${error.message}`,
};
} finally {
document.body.removeChild(textarea);
}
}

View File

@@ -3,7 +3,6 @@ export * from './parseValueList';
export * from './injectGlobalStyles';
export * from './withTimeout';
export * from './executeShellCommand';
export * from './copyToClipboard';
export * from './maskIP';
export * from './getProxyUrlName';
export * from './onMount';

View File

@@ -2,7 +2,7 @@ export async function withTimeout<T>(
promise: Promise<T>,
timeoutMs: number,
operationName: string,
timeoutMessage = 'Operation timed out',
timeoutMessage = _('Operation timed out'),
): Promise<T> {
let timeoutId;
const start = performance.now();