diff --git a/locales/en/minecraft.json b/locales/en/minecraft.json index e42b200..9e984d1 100644 --- a/locales/en/minecraft.json +++ b/locales/en/minecraft.json @@ -3,5 +3,6 @@ "playing": "{{count}} player(s) online.", "no_one": "No one is playing.", "offline": "Server is down.", - "address": "Server address" + "address": "Server address", + "fail": "Failed to retrieve server status." } \ No newline at end of file diff --git a/locales/ja/minecraft.json b/locales/ja/minecraft.json index 5a66b40..a6e4dee 100644 --- a/locales/ja/minecraft.json +++ b/locales/ja/minecraft.json @@ -3,5 +3,6 @@ "playing": "{{count}} 人がプレイしています。", "no_one": "現在、誰もログインしていません。", "offline": "サーバーがオフラインのようです。", - "address": "サーバー アドレス" + "address": "サーバー アドレス", + "fail": "サーバーの状態を取得できませんでした。" } \ No newline at end of file diff --git a/pages/components/Minecraft.js b/pages/components/Minecraft.js index 8af3c54..36a0353 100644 --- a/pages/components/Minecraft.js +++ b/pages/components/Minecraft.js @@ -10,7 +10,7 @@ export default function Minecraft(props) { const [dataMinecraft, setDataMinecraft] = useState({ hits: [] }); const [data, setData] = useState({ hits: [] }); - + const fail = t('minecraft:fail') useEffect(() => { const fetchData = async () => { const result = await axios( @@ -23,12 +23,10 @@ export default function Minecraft(props) { if (data === undefined){ console.log("[Minecraft Query] データの取得に失敗しました。 / Failed to retrieve data.") - console.log(data) return ( -

Failed to retrieve data

+

{fail}

) }else{ - console.log(data) const status = data.online const player = data.players && data.players.online const playing = t('minecraft:playing', {count: player})