Skip to content

Commit 6d2da82

Browse files
authored
fix: some version of koishi failed to resolve scope of i18n text (#228)
1 parent 58b363a commit 6d2da82

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/core/src/command.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function apply(ctx: Context, config: Config) {
6868

6969
const filtered = images?.filter((image) => config.nsfw || !image.nsfw)
7070

71-
if (!filtered?.length) return session?.text('.no-result')
71+
if (!filtered?.length) return session?.text('commands.booru.messages.no-result')
7272

7373
const output: Element[][] = []
7474

@@ -86,13 +86,13 @@ export function apply(ctx: Context, config: Config) {
8686
if (config.asset && ctx.assets) {
8787
url = await ctx.booru.imgUrlToAssetUrl(url)
8888
if (!url) {
89-
children.unshift(<i18n path='.no-image'></i18n>)
89+
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
9090
continue
9191
}
9292
} else if (config.base64) {
9393
url = await ctx.booru.imgUrlToBase64(url)
9494
if (!url) {
95-
children.unshift(<i18n path='.no-image'></i18n>)
95+
children.unshift(<i18n path='commands.booru.messages.no-image'></i18n>)
9696
continue
9797
}
9898
}
@@ -101,10 +101,10 @@ export function apply(ctx: Context, config: Config) {
101101
if (image.tags) {
102102
children.unshift(
103103
<p>
104-
<i18n path='.output.source'>{[source]}</i18n>
104+
<i18n path='commands.booru.messages.output.source'>{[source]}</i18n>
105105
</p>,
106106
<p>
107-
<i18n path='.output.tags'>{[image.tags.join(', ')]}</i18n>
107+
<i18n path='commands.booru.messages.output.tags'>{[image.tags.join(', ')]}</i18n>
108108
</p>,
109109
)
110110
}
@@ -122,14 +122,14 @@ export function apply(ctx: Context, config: Config) {
122122
<p>
123123
{config.output >= OutputType.ImageAndLink && image.authorUrl ? (
124124
<a href={image.authorUrl}>
125-
<i18n path='.output.author'>{[image.author]}</i18n>
125+
<i18n path='commands.booru.messages.output.author'>{[image.author]}</i18n>
126126
</a>
127127
) : (
128-
<i18n path='.output.author'>{[image.author]}</i18n>
128+
<i18n path='commands.booru.messages.output.author'>{[image.author]}</i18n>
129129
)}
130130
</p>,
131131
<p>
132-
<i18n path='.output.desc'>{[image.desc]}</i18n>
132+
<i18n path='commands.booru.messages.output.desc'>{[image.desc]}</i18n>
133133
</p>,
134134
)
135135
}
@@ -164,7 +164,7 @@ export function apply(ctx: Context, config: Config) {
164164
const tip = Random.pick(tips)
165165
output.push(
166166
<p>
167-
<i18n path='.tips'></i18n>
167+
<i18n path='commands.booru.messages.tips'></i18n>
168168
<i18n path={tip}>{[command.displayName]}</i18n>
169169
</p>,
170170
)

0 commit comments

Comments
 (0)