diff --git a/components/CharacterUnit/index.tsx b/components/CharacterUnit/index.tsx index 59e7c681..02d5bc24 100644 --- a/components/CharacterUnit/index.tsx +++ b/components/CharacterUnit/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' +import { useTranslation } from 'next-i18next' import classnames from 'classnames' import SearchModal from '~components/SearchModal' @@ -19,6 +20,8 @@ interface Props { } const CharacterUnit = (props: Props) => { + const { t } = useTranslation('common') + const router = useRouter() const locale = (router.locale && ['en', 'ja'].includes(router.locale)) ? router.locale : 'en' @@ -72,7 +75,7 @@ const CharacterUnit = (props: Props) => { const editableImage = ( diff --git a/components/SummonUnit/index.tsx b/components/SummonUnit/index.tsx index adaa809c..ffdc73a4 100644 --- a/components/SummonUnit/index.tsx +++ b/components/SummonUnit/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' +import { useTranslation } from 'next-i18next' import classnames from 'classnames' import SearchModal from '~components/SearchModal' @@ -19,6 +20,8 @@ interface Props { } const SummonUnit = (props: Props) => { + const { t } = useTranslation('common') + const [imageUrl, setImageUrl] = useState('') const router = useRouter() @@ -80,7 +83,7 @@ const SummonUnit = (props: Props) => { const editableImage = ( diff --git a/components/WeaponUnit/index.tsx b/components/WeaponUnit/index.tsx index 9e8909dd..815a0d38 100644 --- a/components/WeaponUnit/index.tsx +++ b/components/WeaponUnit/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' -import Router, { useRouter } from 'next/router' +import { useRouter } from 'next/router' +import { useTranslation } from 'next-i18next' import classnames from 'classnames' import SearchModal from '~components/SearchModal' @@ -23,6 +24,8 @@ interface Props { } const WeaponUnit = (props: Props) => { + const { t } = useTranslation('common') + const [imageUrl, setImageUrl] = useState('') const router = useRouter() @@ -85,7 +88,7 @@ const WeaponUnit = (props: Props) => { const editableImage = ( diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 1b4c632b..f6437472 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -157,6 +157,18 @@ "loading": "Loading saved teams...", "not_found": "You haven't saved any teams" }, + "search": { + "errors": { + "start_typing": "Start typing the name of a {{object}}", + "min_length": "Type at least 3 characters", + "no_results": "No results found for '{{query}}'" + }, + "placeholders": { + "weapon": "Search for a weapon...", + "summon": "Search for a summon...", + "character": "Search for a weapon..." + } + }, "teams": { "title": "Discover Teams", "loading": "Loading teams...", diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index eee473e1..c2711360 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -158,6 +158,18 @@ "loading": "ロード中...", "not_found": "編成はまだ保存していません" }, + "search": { + "errors": { + "start_typing": "{{object}}名を入力してください", + "min_length": "3文字以上を入力してください", + "no_results": "'{{query}}'の検索結果が見つかりませんでした" + }, + "placeholders": { + "weapon": "武器を検索...", + "summon": "召喚石を検索...", + "character": "キャラを検索..." + } + }, "teams": { "title": "編成一覧", "loading": "ロード中...",