Просмотр исходного кода

fix(page-create-modal): switch template help link language based on user locale

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VANELLOPE\tomoyuki-t 1 неделя назад
Родитель
Сommit
0cd82336c3
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      apps/app/src/client/components/PageCreateModal.tsx

+ 4 - 3
apps/app/src/client/components/PageCreateModal.tsx

@@ -35,7 +35,7 @@ import styles from './PageCreateModal.module.scss';
 const { isCreatablePage, isUsersHomepage } = pagePathUtils;
 
 const PageCreateModal: React.FC = () => {
-  const { t } = useTranslation();
+  const { t, i18n } = useTranslation();
 
   const currentUser = useCurrentUser();
   const growiCloudUri = useGrowiCloudUri();
@@ -72,10 +72,11 @@ const PageCreateModal: React.FC = () => {
     [userHomepagePath, t, now],
   );
 
+  const templateHelpLang = i18n.language === 'ja' ? 'ja' : 'en';
   const templateHelpUrl =
     growiCloudUri != null
-      ? 'https://growi.cloud/help/ja/guide/features/template.html'
-      : 'https://docs.growi.org/ja/guide/features/template.html';
+      ? `https://growi.cloud/help/${templateHelpLang}/guide/features/template.html`
+      : `https://docs.growi.org/${templateHelpLang}/guide/features/template.html`;
 
   const [todayInput, setTodayInput] = useState('');
   const [pageNameInput, setPageNameInput] = useState(pageNameInputInitialValue);