diff --git a/.env b/.env new file mode 100644 index 0000000..9d26a4d --- /dev/null +++ b/.env @@ -0,0 +1 @@ +test=TESTTTT \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index f046963..fc5a8fd 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -52,11 +52,13 @@ }, "bare": { "title": "Bare Server", - "subtitle": "Enter the URL of your bare server" + "subtitle": "Enter the URL of your bare server", + "select": "Select" }, "theme": { "title": "Theme", - "subtitle": "Choose a theme so your eyes don't hate us" + "subtitle": "Choose a theme so your eyes don't hate us", + "select": "Select" } }, "titles": { diff --git a/src/locales/es.json b/src/locales/es.json index a50f39a..98b59e9 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -50,6 +50,11 @@ "title": "Buscador", "subtitle": "Elige tu motor de búsqueda." }, + "bare": { + "title": "Bare Server", + "subtitle": "Pon tu url de tu bare server", + "select": "Seleccionar" + }, "theme": { "title": "Mirar", "subtitle": "Elige una mirada para que tus ojos no nos odienn" diff --git a/src/locales/ja.json b/src/locales/ja.json index 8e286e5..e78bf48 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -50,6 +50,11 @@ "title": "検索エンジン", "subtitle": "ネビュラの検索エンジンを選択してください" }, + "bare": { + "title": "Bare サーバー", + "subtitle": "Bare サーバー URL を入力してください", + "select": "選択する" + }, "theme": { "title": "テーマ", "subtitle": "目が嫌いにならないようにテーマを選んでください" diff --git a/src/pages/Settings/BareInput.tsx b/src/pages/Settings/BareInput.tsx index c25ed8d..4a46769 100644 --- a/src/pages/Settings/BareInput.tsx +++ b/src/pages/Settings/BareInput.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from "preact/hooks"; import { set } from "../../util/IDB"; import { uninstallServiceWorkers } from "../../util/SWHelper"; +import { useTranslation } from "react-i18next"; interface BareInputProps { placeholder: string; @@ -8,6 +9,7 @@ interface BareInputProps { } function BareInput(props: BareInputProps) { + const { t } = useTranslation(); const value = localStorage.getItem(props.storageKey) || "/bare/"; const [inputValue, setInputValue] = useState(value); function validateUrl(url: string) { @@ -28,22 +30,29 @@ function BareInput(props: BareInputProps) { } return finalUrl; } - function handleChange(event: any) { - const url = validateUrl(event.target.value); - setInputValue(event.target.value); + function handleChange() { + const url = validateUrl((document.getElementById("input") as HTMLInputElement).value); + setInputValue((document.getElementById("input") as HTMLInputElement).value); set(props.storageKey, url); localStorage.setItem(props.storageKey, url); uninstallServiceWorkers(); window.location.reload(); } return ( - +