diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 03afcd2..9eecdff 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -39,6 +39,7 @@ "showMore": "show more", "noResult": "No Result", "gettingStarted": "Getting Started", + "gettingStartedWithExample": "Try with namae", "pressEnterToSearch": "Press Enter to search", "available": "Available", "unavailable": "Unavailable" diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index 878012e..2048e7f 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -1,6 +1,6 @@ { "title": "唯一無二の名前を見つける", - "description": "namae はあなたのアプリやライブラリに素敵な名前をつけるお手伝いをします。", + "description": "namae はあなたのアプリ、ライブラリ、組織に素敵な名前をつけるお手伝いをします。", "placeholder": "調べる", "providers": { "domains": "ドメイン", @@ -39,6 +39,7 @@ "showMore": "さらに表示", "noResult": "該当なし", "gettingStarted": "はじめる", + "gettingStartedWithExample": "namae を調べる", "pressEnterToSearch": "エンターキーで検索", "available": "取得できます", "unavailable": "取得できません" diff --git a/src/components/Welcome.tsx b/src/components/Welcome.tsx index fb5f425..884f5d5 100644 --- a/src/components/Welcome.tsx +++ b/src/components/Welcome.tsx @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'styled-components'; -import {useTranslation} from 'react-i18next'; -import {Link} from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; +import { Link } from 'react-router-dom'; import { FaMapSigns, @@ -19,12 +19,12 @@ import { FaJsSquare, FaBuilding, } from 'react-icons/fa'; -import {IoIosBeer} from 'react-icons/io'; -import {DiRust, DiHeroku, DiFirebase} from 'react-icons/di'; +import { IoIosBeer } from 'react-icons/io'; +import { DiRust, DiHeroku, DiFirebase } from 'react-icons/di'; -import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons'; -import {mobile} from '../util/css'; -import {sendGettingStartedEvent} from '../util/analytics'; +import { SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon } from './Icons'; +import { mobile } from '../util/css'; +import { sendGettingStartedEvent } from '../util/analytics'; const supportedProviders: Record = { domains: , @@ -53,7 +53,7 @@ const supportedProviders: Record = { }; const Welcome: React.FC = () => { - const {t} = useTranslation(); + const { t } = useTranslation(); return ( @@ -63,8 +63,8 @@ const Welcome: React.FC = () => { - sendGettingStartedEvent()}> - {t('gettingStarted')} + sendGettingStartedEvent()}> + {t('gettingStartedWithExample')} diff --git a/src/index.tsx b/src/index.tsx index 8b50aa4..4adb912 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,14 +4,14 @@ import 'rc-tooltip/assets/bootstrap.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { Router } from 'react-router-dom'; -import { ToastContainer } from 'react-toastify'; +import { toast, ToastContainer } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; import { store, wrapHistoryWithStoreHandler } from './store'; import { initSentry, wrapHistoryWithGA } from './util/analytics'; import { compose } from './util/array'; -import { initCrisp } from './util/crip'; +import { initCrisp } from './util/crisp'; import './util/i18n'; import { FullScreenSuspense } from './util/suspense'; @@ -36,23 +36,22 @@ ReactDOM.render( document.getElementById('root'), ); -serviceWorker.unregister(); -// TODO: gracefully update service worker -// serviceWorker.register({ -// onUpdate: (registration) => { -// console.log('Update available'); +serviceWorker.register({ + onUpdate: (registration) => { + console.log('Update available'); -// toast.dark('New version available! Click here to update.', { -// onClose: () => { -// window.location.reload(); -// }, -// position: 'top-right', -// autoClose: false, -// closeButton: false, -// closeOnClick: true, -// }); -// if (registration && registration.waiting) { -// registration.waiting.postMessage({ type: 'SKIP_WAITING' }); -// } -// }, -// }); + toast.dark('New version available! Click here to update.', { + onClose: () => { + window.location.reload(); + }, + position: 'top-right', + autoClose: false, + closeButton: false, + closeOnClick: true, + }); + + if (registration && registration.waiting) { + registration.waiting.postMessage({ type: 'SKIP_WAITING' }); + } + }, +}); diff --git a/src/util/crip.ts b/src/util/crisp.ts similarity index 100% rename from src/util/crip.ts rename to src/util/crisp.ts diff --git a/src/util/i18n.ts b/src/util/i18n.ts index 666a20a..7c1883b 100644 --- a/src/util/i18n.ts +++ b/src/util/i18n.ts @@ -3,9 +3,9 @@ import Backend from 'i18next-chained-backend'; import LocalStorageBackend from 'i18next-localstorage-backend'; import XHR from 'i18next-xhr-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; -import {initReactI18next} from 'react-i18next'; +import { initReactI18next } from 'react-i18next'; -const TRANSLATION_VERSION = '1.17'; +const TRANSLATION_VERSION = '1.18'; i18n .use(Backend) @@ -16,7 +16,7 @@ i18n backends: [LocalStorageBackend, XHR], backendOptions: [ { - versions: {en: TRANSLATION_VERSION, ja: TRANSLATION_VERSION}, + versions: { en: TRANSLATION_VERSION, ja: TRANSLATION_VERSION }, }, ], }, diff --git a/yarn.lock b/yarn.lock index 32e5552..c030589 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9607,11 +9607,6 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -prettier-plugin-organize-imports@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-1.1.1.tgz#7f1ac1a13d4d1752dc16881894dde1c10ccbf3c0" - integrity sha512-rFA1lnek1FYkMGthm4xBKME41qUKItTovuo24bCGZu/Vu1n3gW71UPLAkIdwewwkZCe29gRVweSOPXvAdckFuw== - prettier@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"