mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-16 15:17:14 +00:00
fix(frontend): isolate subscription language preference (#6394)
* fix(frontend): isolate subscription language preference * fix(frontend): defer date locale resolution
This commit is contained in:
@@ -93,11 +93,11 @@ export default function SubPage() {
|
||||
setMessageInstance(messageApi);
|
||||
}, [messageApi]);
|
||||
const { isMobile } = useMediaQuery(576);
|
||||
const [lang, setLang] = useState<string>(() => LanguageManager.getLanguage());
|
||||
const [lang, setLang] = useState<string>(() => LanguageManager.getLanguage('subscription'));
|
||||
|
||||
const onLangChange = useCallback((next: string) => {
|
||||
setLang(next);
|
||||
LanguageManager.setLanguage(next);
|
||||
LanguageManager.setLanguage(next, 'subscription');
|
||||
}, []);
|
||||
|
||||
const cycleTheme = useCallback(() => {
|
||||
@@ -186,16 +186,18 @@ export default function SubPage() {
|
||||
items.push({
|
||||
key: 'lastOnline',
|
||||
label: t('lastOnline'),
|
||||
children: lastOnlineMs > 0 ? IntlUtil.formatDate(lastOnlineMs, datepicker) : '-',
|
||||
children: lastOnlineMs > 0 ? IntlUtil.formatDate(lastOnlineMs, datepicker, lang) : '-',
|
||||
});
|
||||
items.push({
|
||||
key: 'expiry',
|
||||
label: t('subscription.expiry'),
|
||||
children:
|
||||
expireMs === 0 ? t('subscription.noExpiry') : IntlUtil.formatDate(expireMs, datepicker),
|
||||
expireMs === 0
|
||||
? t('subscription.noExpiry')
|
||||
: IntlUtil.formatDate(expireMs, datepicker, lang),
|
||||
});
|
||||
return items;
|
||||
}, [t]);
|
||||
}, [t, lang]);
|
||||
|
||||
const androidMenuItems = useMemo(
|
||||
() => [
|
||||
|
||||
Reference in New Issue
Block a user