更改默认语言和时区

This commit is contained in:
admin8800
2026-05-10 16:12:39 +08:00
parent 8126c2b663
commit f63ec0db18
7 changed files with 52 additions and 54 deletions
+4 -5
View File
@@ -38,11 +38,10 @@ RUN if [ "$TARGETARCH" = "arm" ]; then export GOARM=7; [ "$TARGETVARIANT" = "v6"
-tags "with_quic,with_grpc,with_utls,with_acme,with_gvisor,with_naive_outbound,with_purego,with_tailscale" \ -tags "with_quic,with_grpc,with_utls,with_acme,with_gvisor,with_naive_outbound,with_purego,with_tailscale" \
-o sui main.go -o sui main.go
FROM alpine FROM alpine
LABEL org.opencontainers.image.authors="alireza7@gmail.com" ENV TZ=Asia/Shanghai
ENV TZ=Asia/Tehran WORKDIR /app
WORKDIR /app
RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables
COPY --from=backend-builder /app/sui /app/libcronet.so /app/ COPY --from=backend-builder /app/sui /app/libcronet.so /app/
COPY entrypoint.sh /app/ COPY entrypoint.sh /app/
ENTRYPOINT [ "./entrypoint.sh" ] ENTRYPOINT [ "./entrypoint.sh" ]
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
+42 -42
View File
@@ -1,42 +1,42 @@
import { createI18n } from 'vue-i18n' import { createI18n } from 'vue-i18n'
import en from './en' import en from './en'
import fa from './fa' import fa from './fa'
import vi from './vi' import vi from './vi'
import zhcn from './zhcn' import zhcn from './zhcn'
import zhtw from './zhtw' import zhtw from './zhtw'
import ru from './ru' import ru from './ru'
export const i18n = createI18n({ export const i18n = createI18n({
legacy: false, legacy: false,
locale: localStorage.getItem("locale") ?? 'en', locale: localStorage.getItem("locale") ?? 'zhHans',
fallbackLocale: 'en', fallbackLocale: 'zhHans',
messages: { messages: {
en: en, en: en,
fa: fa, fa: fa,
vi: vi, vi: vi,
zhHans: zhcn, zhHans: zhcn,
zhHant: zhtw, zhHant: zhtw,
ru: ru ru: ru
}, },
}) })
export const locale = (() => { export const locale = (() => {
const l = i18n.global.locale.value const l = i18n.global.locale.value
switch (l) { switch (l) {
case "zhHans": case "zhHans":
return "zh-cn" return "zh-cn"
case "zhHant": case "zhHant":
return "zh-tw" return "zh-tw"
default: default:
return l return l
} }
})() })()
export const languages = [ export const languages = [
{ title: 'English', value: 'en' }, { title: 'English', value: 'en' },
{ title: 'فارسی', value: 'fa' }, { title: 'فارسی', value: 'fa' },
{ title: 'Tiếng Việt', value: 'vi' }, { title: 'Tiếng Việt', value: 'vi' },
{ title: '简体中文', value: 'zhHans' }, { title: '简体中文', value: 'zhHans' },
{ title: '繁體中文', value: 'zhHant' }, { title: '繁體中文', value: 'zhHant' },
{ title: 'Русский', value: 'ru' }, { title: 'Русский', value: 'ru' },
] ]
+2 -2
View File
@@ -49,8 +49,8 @@ export default createVuetify({
}, },
}, },
locale: { locale: {
locale: localStorage.getItem("locale") ?? 'en', locale: localStorage.getItem("locale") ?? 'zhHans',
fallback: 'en', fallback: 'zhHans',
messages: { en, fa, vi, zhHans, zhHant, ru }, messages: { en, fa, vi, zhHans, zhHant, ru },
}, },
}) })
+1 -2
View File
@@ -96,7 +96,7 @@ const login = async () => {
} }
} }
const changeLocale = (l: any) => { const changeLocale = (l: any) => {
locale.current.value = l ?? 'en' locale.current.value = l ?? 'zhHans'
localStorage.setItem('locale', locale.current.value) localStorage.setItem('locale', locale.current.value)
} }
const changeTheme = (th: string) => { const changeTheme = (th: string) => {
@@ -108,4 +108,3 @@ const isActiveTheme = (th: string) => {
return current == th return current == th
} }
</script> </script>
+1 -1
View File
@@ -162,7 +162,7 @@ const settings = ref({
webURI: "", webURI: "",
sessionMaxAge: "0", sessionMaxAge: "0",
trafficAge: "30", trafficAge: "30",
timeLocation: "Asia/Tehran", timeLocation: "Asia/Shanghai",
subListen: "", subListen: "",
subPort: "2096", subPort: "2096",
subPath: "/sub/", subPath: "/sub/",
+1 -1
View File
@@ -52,7 +52,7 @@ var defaultValueMap = map[string]string{
"webURI": "", "webURI": "",
"sessionMaxAge": "0", "sessionMaxAge": "0",
"trafficAge": "30", "trafficAge": "30",
"timeLocation": "Asia/Tehran", "timeLocation": "Asia/Shanghai",
"subListen": "", "subListen": "",
"subPort": "2096", "subPort": "2096",
"subPath": "/sub/", "subPath": "/sub/",