Skip to content

Commit 7f10dc5

Browse files
committed
i18n interpolation
1 parent 60d8d93 commit 7f10dc5

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v5
1515

16-
- uses: actions/setup-node@v4
16+
- uses: actions/setup-node@v5
1717
with:
1818
node-version: 24.x
1919

src/PluginManager.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function onUpload(files: UploadFileInfo[]) {
3131
}
3232
window.fcitx.updateInputMethods()
3333
installedPlugins.value = getInstalledPlugins()
34-
message.success(`Installed ${name}`)
34+
message.success(t('Installed {plugin}', { plugin: name }))
3535
}
3636
}
3737
</script>

src/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ const i18n = createI18n({
2525
messages,
2626
})
2727

28-
export function t(key: string) {
29-
return i18n.global.t(key)
28+
export function t(key: string, options: Record<string, unknown> = {}) {
29+
return i18n.global.t(key, options)
3030
}

src/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"Close": "关闭",
66
"Download and drag zip to this area": "下载并拖拽 zip 到此区域",
77
"Installed": "已安装",
8+
"Installed {plugin}": "已安装 {plugin}",
89
"Mozc doesn't work on Chrome unless start the process with": "Mozc 在 Chrome 下不工作,除非用如下参数启动进程",
910
"Only show current language": "只显示当前语言",
1011
"Redo": "重做",

0 commit comments

Comments
 (0)