|
@@ -2,6 +2,7 @@ import {
|
|
|
FormEventHandler, memo, useCallback, useState,
|
|
FormEventHandler, memo, useCallback, useState,
|
|
|
} from 'react';
|
|
} from 'react';
|
|
|
|
|
|
|
|
|
|
+import { Lang, AllLang } from '@growi/core';
|
|
|
import { useTranslation } from 'next-i18next';
|
|
import { useTranslation } from 'next-i18next';
|
|
|
import { useRouter } from 'next/router';
|
|
import { useRouter } from 'next/router';
|
|
|
|
|
|
|
@@ -15,9 +16,11 @@ const InstallerForm = memo((): JSX.Element => {
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
+ const isSupportedLang = AllLang.includes(i18n.language as Lang);
|
|
|
|
|
+
|
|
|
const [isValidUserName, setValidUserName] = useState(true);
|
|
const [isValidUserName, setValidUserName] = useState(true);
|
|
|
const [isSubmittingDisabled, setSubmittingDisabled] = useState(false);
|
|
const [isSubmittingDisabled, setSubmittingDisabled] = useState(false);
|
|
|
- const [currentLocale, setCurrentLocale] = useState('en_US');
|
|
|
|
|
|
|
+ const [currentLocale, setCurrentLocale] = useState(isSupportedLang ? i18n.language : Lang.en_US);
|
|
|
|
|
|
|
|
const checkUserName = useCallback(async(event) => {
|
|
const checkUserName = useCallback(async(event) => {
|
|
|
const axios = require('axios').create({
|
|
const axios = require('axios').create({
|