fix: add missing i18n for `Search` (#102)

* feat(i18n): add missing `Search` key

* fix: update i18n text

---------

Co-authored-by: saicaca <zephyird@gmail.com>
This commit is contained in:
baka-gourd 2024-06-21 19:39:13 +08:00 committed by GitHub
parent 5cfc78ef65
commit 815692899d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,8 @@
<script lang="ts"> <script lang="ts">
import { onMount } from 'svelte' import { onMount } from 'svelte'
import {url} from "@utils/url-utils.ts" import {url} from "@utils/url-utils.ts"
import { i18n } from '@i18n/translation';
import I18nKey from '@i18n/i18nKey';
let keywordDesktop = '' let keywordDesktop = ''
let keywordMobile = '' let keywordMobile = ''
let result = [] let result = []
@ -70,7 +72,7 @@ $: search(keywordMobile, false)
dark:bg-white/5 dark:hover:bg-white/10 dark:focus-within:bg-white/10 dark:bg-white/5 dark:hover:bg-white/10 dark:focus-within:bg-white/10
"> ">
<slot name="search-icon"></slot> <slot name="search-icon"></slot>
<input placeholder="Search" bind:value={keywordDesktop} on:focus={() => search(keywordDesktop, true)} <input placeholder="{i18n(I18nKey.search)}" bind:value={keywordDesktop} on:focus={() => search(keywordDesktop, true)}
class="transition-all pl-10 text-sm bg-transparent outline-0 class="transition-all pl-10 text-sm bg-transparent outline-0
h-full w-40 active:w-60 focus:w-60 text-black/50 dark:text-white/50" h-full w-40 active:w-60 focus:w-60 text-black/50 dark:text-white/50"
> >

View File

@ -2,6 +2,7 @@ enum I18nKey {
home = 'home', home = 'home',
about = 'about', about = 'about',
archive = 'archive', archive = 'archive',
search = 'search',
tags = 'tags', tags = 'tags',
categories = 'categories', categories = 'categories',

View File

@ -5,6 +5,7 @@ export const en: Translation = {
[Key.home]: 'Home', [Key.home]: 'Home',
[Key.about]: 'About', [Key.about]: 'About',
[Key.archive]: 'Archive', [Key.archive]: 'Archive',
[Key.search]: 'Search',
[Key.tags]: 'Tags', [Key.tags]: 'Tags',
[Key.categories]: 'Categories', [Key.categories]: 'Categories',

View File

@ -5,6 +5,7 @@ export const ja: Translation = {
[Key.home]: 'Home', [Key.home]: 'Home',
[Key.about]: 'About', [Key.about]: 'About',
[Key.archive]: 'Archive', [Key.archive]: 'Archive',
[Key.search]: '検索',
[Key.tags]: 'タグ', [Key.tags]: 'タグ',
[Key.categories]: 'カテゴリ', [Key.categories]: 'カテゴリ',

View File

@ -5,6 +5,7 @@ export const zh_CN: Translation = {
[Key.home]: '主页', [Key.home]: '主页',
[Key.about]: '关于', [Key.about]: '关于',
[Key.archive]: '归档', [Key.archive]: '归档',
[Key.search]: '搜索',
[Key.tags]: '标签', [Key.tags]: '标签',
[Key.categories]: '分类', [Key.categories]: '分类',

View File

@ -5,6 +5,7 @@ export const zh_TW: Translation = {
[Key.home]: '首頁', [Key.home]: '首頁',
[Key.about]: '關於', [Key.about]: '關於',
[Key.archive]: '彙整', [Key.archive]: '彙整',
[Key.search]: '搜尋',
[Key.tags]: '標籤', [Key.tags]: '標籤',
[Key.categories]: '分類', [Key.categories]: '分類',