From 815e29dddfbef6d4887bbf54e85de272a7c4bbc1 Mon Sep 17 00:00:00 2001 From: uetchy Date: Thu, 30 Jul 2020 23:14:02 +0900 Subject: [PATCH] feat: add zh-Hans (#119) --- public/locales/en/translation.json | 4 +-- public/locales/ja/translation.json | 4 +-- public/locales/zh-Hans/translation.json | 46 +++++++++++++++++++++++++ src/components/Footer.tsx | 38 ++++++++++++-------- src/util/i18n.ts | 8 +++-- 5 files changed, 80 insertions(+), 20 deletions(-) create mode 100644 public/locales/zh-Hans/translation.json diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 9eecdff..c24028c 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -4,7 +4,7 @@ "placeholder": "search", "providers": { "domains": "Domains", - "github": "Github Organization", + "github": "GitHub Organization", "gitlab": "GitLab", "npm": "npm", "pypi": "PyPI", @@ -17,7 +17,7 @@ "slack": "Slack", "s3": "AWS S3", "jsorg": "js.org", - "githubSearch": "Github Repository", + "githubSearch": "GitHub Repository", "appStore": "App Store", "google": "Google Search", "spectrum": "Spectrum", diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index 2048e7f..01457f7 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -4,7 +4,7 @@ "placeholder": "調べる", "providers": { "domains": "ドメイン", - "github": "Github Organization", + "github": "GitHub Organization", "gitlab": "GitLab", "npm": "npm", "pypi": "PyPI", @@ -17,7 +17,7 @@ "slack": "Slack", "s3": "AWS S3", "jsorg": "js.org", - "githubSearch": "Github リポジトリ", + "githubSearch": "GitHub リポジトリ", "appStore": "App Store", "google": "Google 検索", "spectrum": "Spectrum", diff --git a/public/locales/zh-Hans/translation.json b/public/locales/zh-Hans/translation.json new file mode 100644 index 0000000..d76728a --- /dev/null +++ b/public/locales/zh-Hans/translation.json @@ -0,0 +1,46 @@ +{ + "title": "为您的新应用取个好听的名字", + "description": "namae可让您给您的应用程序、Web服务或组织起一个好名字。", + "placeholder": "检验", + "providers": { + "domains": "域名", + "github": "GitHub 组织", + "gitlab": "GitLab", + "npm": "npm", + "pypi": "PyPI", + "rubygems": "RubyGems", + "rust": "Rust", + "homebrew": "Homebrew", + "linux": "Linux", + "instagram": "Instagram", + "twitter": "推特", + "slack": "Slack", + "s3": "AWS S3", + "jsorg": "js.org", + "githubSearch": "GitHub 仓库", + "appStore": "App Store", + "google": "谷歌", + "spectrum": "Spectrum", + "heroku": "Heroku", + "now": "Vercel", + "netlify": "Netlify", + "nta": "在日本的公司", + "ocaml": "OCaml", + "firebase": "Firebase" + }, + "uniqueness": { + "high": "超级独特", + "moderate": "有点独特", + "low": "普通", + "description": "UNIQ表示名称的独特性(0-100)" + }, + "countryCode": "jp", + "try": "这个呢?", + "showMore": "更多", + "noResult": "无结果", + "gettingStarted": "起步", + "gettingStartedWithExample": "试试 namae", + "pressEnterToSearch": "按Enter键搜索", + "available": "可获得", + "unavailable": "买不到" +} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 219e742..56e9883 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -5,7 +5,7 @@ import { FaGithub, FaProductHunt, FaTwitter } from 'react-icons/fa'; import { GoHeart } from 'react-icons/go'; import styled from 'styled-components'; import { Section } from '../theme'; -import { mobile, tablet } from '../util/css'; +import { tablet } from '../util/css'; import Contributors from '../components/Contributors'; const Footer: React.FC = () => { @@ -27,6 +27,11 @@ const Footer: React.FC = () => { 🇯🇵 + + + 🇨🇳 + + @@ -183,19 +188,6 @@ const Subtitle = styled.h4` margin-bottom: 12px; `; -const LangBox = styled.div` - line-height: 1em; - font-size: 2rem; -`; - -const ShareBox = styled.div` - margin-top: 15px; - line-height: 1em; - font-size: 1.5rem; - display: flex; - align-items: center; -`; - const Links = styled.div` display: flex; align-items: center; @@ -205,6 +197,24 @@ const Links = styled.div` } `; +const LangBox = styled.div` + line-height: 1em; + font-size: 2rem; + + ${Links} { + a { + margin-right: 5px; + } + } +`; + +const ShareBox = styled.div` + margin-top: 15px; + line-height: 1em; + font-size: 1.5rem; + display: flex; + align-items: center; +`; const Bold = styled.span` font-weight: bold; `; diff --git a/src/util/i18n.ts b/src/util/i18n.ts index 7c1883b..71ac783 100644 --- a/src/util/i18n.ts +++ b/src/util/i18n.ts @@ -5,7 +5,7 @@ import XHR from 'i18next-xhr-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; import { initReactI18next } from 'react-i18next'; -const TRANSLATION_VERSION = '1.18'; +const TRANSLATION_VERSION = '1.19'; i18n .use(Backend) @@ -16,7 +16,11 @@ i18n backends: [LocalStorageBackend, XHR], backendOptions: [ { - versions: { en: TRANSLATION_VERSION, ja: TRANSLATION_VERSION }, + versions: { + en: TRANSLATION_VERSION, + ja: TRANSLATION_VERSION, + 'zh-Hans': TRANSLATION_VERSION, + }, }, ], },