fix: address language review feedback

This commit is contained in:
Chebotov Nickolay
2026-02-06 15:08:53 +03:00
parent d5ccef8b24
commit 0bb8090686
5 changed files with 26 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import { Input } from '@/components/ui/Input';
import { IconEye, IconEyeOff } from '@/components/ui/icons';
import { useAuthStore, useLanguageStore, useNotificationStore } from '@/stores';
import { detectApiBaseFromLocation, normalizeApiBase } from '@/utils/connection';
import { LANGUAGE_LABEL_KEYS, LANGUAGE_ORDER } from '@/utils/constants';
import { INLINE_LOGO_JPEG } from '@/assets/logoInline';
import type { ApiError, Language } from '@/types';
import styles from './LoginPage.module.scss';
@@ -78,14 +79,9 @@ export function LoginPage() {
const [error, setError] = useState('');
const detectedBase = useMemo(() => detectApiBaseFromLocation(), []);
const nextLanguage: Language = language === 'zh-CN' ? 'en' : language === 'en' ? 'ru' : 'zh-CN';
const nextLanguageLabel = t(
nextLanguage === 'zh-CN'
? 'language.chinese'
: nextLanguage === 'en'
? 'language.english'
: 'language.russian'
);
const nextLanguageIndex = LANGUAGE_ORDER.indexOf(language);
const nextLanguage: Language = LANGUAGE_ORDER[(nextLanguageIndex + 1) % LANGUAGE_ORDER.length];
const nextLanguageLabel = t(LANGUAGE_LABEL_KEYS[nextLanguage]);
useEffect(() => {
const init = async () => {