feat(i18n): add English and Chinese translation for app search path settings

This commit is contained in:
Huakun Shen 2025-03-01 10:11:21 -05:00
parent 9c61c43eaf
commit 0da5ef3bcd
No known key found for this signature in database
4 changed files with 31 additions and 11 deletions

View File

@ -24,6 +24,7 @@
"settings_menu_settings": "Settings", "settings_menu_settings": "Settings",
"settings_menu_general": "General", "settings_menu_general": "General",
"settings_menu_app_search_paths": "App Search Paths",
"settings_menu_developer": "Developer", "settings_menu_developer": "Developer",
"settings_menu_extensions": "Extensions", "settings_menu_extensions": "Extensions",
"settings_menu_set_dev_ext": "Set Dev Extension", "settings_menu_set_dev_ext": "Set Dev Extension",
@ -40,6 +41,12 @@
"settings_general_developer_mode": "Developer Mode", "settings_general_developer_mode": "Developer Mode",
"settings_general_language": "Language", "settings_general_language": "Language",
"settings_app_search_paths_title": "Extra App Search Paths",
"settings_app_search_paths_add_app_search_path": "Add App Search Path",
"settings_app_search_paths_table_col_search_path": "Search Path",
"settings_app_search_paths_table_col_depth": "Depth",
"settings_app_search_paths_table_col_actions": "Actions",
"settings_about_version": "Version", "settings_about_version": "Version",
"settings_about_author": "Author", "settings_about_author": "Author",
"settings_about_source_code": "Source Code", "settings_about_source_code": "Source Code",

View File

@ -24,6 +24,7 @@
"settings_menu_settings": "设置", "settings_menu_settings": "设置",
"settings_menu_general": "通用", "settings_menu_general": "通用",
"settings_menu_app_search_paths": "应用搜索路径",
"settings_menu_developer": "开发者", "settings_menu_developer": "开发者",
"settings_menu_extensions": "插件", "settings_menu_extensions": "插件",
"settings_menu_set_dev_ext": "设置开发插件", "settings_menu_set_dev_ext": "设置开发插件",
@ -40,6 +41,12 @@
"settings_general_developer_mode": "开发者模式", "settings_general_developer_mode": "开发者模式",
"settings_general_language": "语言", "settings_general_language": "语言",
"settings_app_search_paths_title": "额外应用搜索路径",
"settings_app_search_paths_add_app_search_path": "添加应用搜索路径",
"settings_app_search_paths_table_col_search_path": "搜索路径",
"settings_app_search_paths_table_col_depth": "深度",
"settings_app_search_paths_table_col_actions": "操作",
"settings_about_version": "版本", "settings_about_version": "版本",
"settings_about_author": "作者", "settings_about_author": "作者",
"settings_about_source_code": "源代码", "settings_about_source_code": "源代码",

View File

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import * as m from "@/paraglide/messages"
import { appsLoader } from "@/stores" import { appsLoader } from "@/stores"
import { SearchPath } from "@kksh/api/models" import { SearchPath } from "@kksh/api/models"
import { Button, Input, Table } from "@kksh/svelte5" import { Button, Input, Table } from "@kksh/svelte5"
@ -48,7 +49,7 @@
</script> </script>
<main class="container flex flex-col space-y-2"> <main class="container flex flex-col space-y-2">
<h1 class="text-2xl font-bold">Extra App Search Paths</h1> <h1 class="text-2xl font-bold">{m.settings_app_search_paths_title()}</h1>
{#if $appConfig.developerMode} {#if $appConfig.developerMode}
<Inspect name="Extra App Search Paths" value={$appConfig.appSearchPaths} /> <Inspect name="Extra App Search Paths" value={$appConfig.appSearchPaths} />
{/if} {/if}
@ -56,9 +57,9 @@
<Form.Field {form} name="path"> <Form.Field {form} name="path">
<Form.Control> <Form.Control>
{#snippet children({ props })} {#snippet children({ props })}
<Form.Label>Path</Form.Label> <Form.Label>{m.settings_app_search_paths_table_col_search_path()}</Form.Label>
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<Input {...props} disabled bind:value={$formData.path} placeholder="Search Path" /> <Input {...props} disabled bind:value={$formData.path} placeholder={m.settings_app_search_paths_table_col_search_path()} />
<Form.Button class="my-1" onclick={pickSearchPath}>Pick</Form.Button> <Form.Button class="my-1" onclick={pickSearchPath}>Pick</Form.Button>
</div> </div>
{/snippet} {/snippet}
@ -68,13 +69,15 @@
<Form.Field {form} name="depth"> <Form.Field {form} name="depth">
<Form.Control> <Form.Control>
{#snippet children({ props })} {#snippet children({ props })}
<Form.Label>Search Depth</Form.Label> <Form.Label>{m.settings_app_search_paths_table_col_depth()}</Form.Label>
<Input {...props} type="number" bind:value={$formData.depth} placeholder="Depth" /> <Input {...props} type="number" bind:value={$formData.depth} placeholder={m.settings_app_search_paths_table_col_depth()} />
{/snippet} {/snippet}
</Form.Control> </Form.Control>
<Form.FieldErrors /> <Form.FieldErrors />
</Form.Field> </Form.Field>
<Button class="w-full" type="submit">Add App Search Path</Button> <Button class="w-full" type="submit">
{m.settings_app_search_paths_add_app_search_path()}
</Button>
</form> </form>
{#if $appConfig.developerMode} {#if $appConfig.developerMode}
@ -82,12 +85,15 @@
{/if} {/if}
<Table.Root> <Table.Root>
<Table.Caption>Your App Search Paths</Table.Caption>
<Table.Header> <Table.Header>
<Table.Row> <Table.Row>
<Table.Head>Search Path</Table.Head> <Table.Head>{m.settings_app_search_paths_table_col_search_path()}</Table.Head>
<Table.Head class="text-center">Depth</Table.Head> <Table.Head class="text-center">
<Table.Head class="text-center">Actions</Table.Head> {m.settings_app_search_paths_table_col_depth()}
</Table.Head>
<Table.Head class="text-center">
{m.settings_app_search_paths_table_col_actions()}
</Table.Head>
</Table.Row> </Table.Row>
</Table.Header> </Table.Header>
<Table.Body> <Table.Body>

View File

@ -19,7 +19,7 @@
icon: Cog icon: Cog
}, },
{ {
title: "App Search Paths", title: m.settings_menu_app_search_paths(),
url: i18n.resolveRoute("/app/settings/app-search-paths"), url: i18n.resolveRoute("/app/settings/app-search-paths"),
icon: FolderSearch icon: FolderSearch
}, },