Skip to content

Commit 18fc824

Browse files
committed
fix
1 parent dd059d0 commit 18fc824

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

website/src/App.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,16 @@
149149
}
150150
151151
async function copyCommand(command) {
152-
copiedCommand = command
153152
copyFallbackCommand = undefined
154153
155154
try {
156155
await navigator.clipboard.writeText(command)
156+
copiedCommand = command
157157
window.setTimeout(() => {
158158
if (copiedCommand === command) copiedCommand = undefined
159159
}, 1800)
160160
} catch {
161+
copiedCommand = undefined
161162
copyFallbackCommand = command
162163
window.prompt($LL.download.copyPrompt(), command)
163164
}

website/src/lib/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { baseLocale, locales as generatedLocales } from '../i18n/i18n-util'
1+
import { baseLocale, isLocale, locales as generatedLocales } from '../i18n/i18n-util'
22
import type { Locales } from '../i18n/i18n-types'
33

44
type LocaleOption = {
@@ -22,7 +22,7 @@ export const localeStorageKey = 'serverbox.website.locale'
2222

2323
export function normalizeLocale(locale: string | null | undefined): Locales {
2424
if (!locale) return defaultLocale
25-
if (generatedLocales.includes(locale as Locales)) return locale as Locales
25+
if (isLocale(locale)) return locale
2626

2727
const lowerLocale = locale.toLowerCase()
2828
if (lowerLocale.startsWith('zh')) return 'zh-CN'

0 commit comments

Comments
 (0)