Skip to content

Commit

Permalink
feat: add option to disable translate individually (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: Shigma <[email protected]>
  • Loading branch information
MaikoTan and shigma authored Nov 21, 2022
1 parent 8eb89dc commit 55dd63f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export function apply(ctx: Context, config: Config) {
.option('noise', '-n <noise:number>', { hidden: restricted })
.option('strength', '-N <strength:number>', { hidden: restricted })
.option('undesired', '-u <undesired>')
.option('noTranslator', '-T', { hidden: () => !ctx.translator || !config.translator })
.action(async ({ session, options }, input) => {
if (!input?.trim()) return session.execute('help novelai')

Expand All @@ -125,7 +126,7 @@ export function apply(ctx: Context, config: Config) {
delete options.steps
}

if (config.translator && ctx.translator) {
if (config.translator && ctx.translator && !options.noTranslator) {
try {
input = await ctx.translator.translate({ input, target: 'en' })
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ commands:
strength: 图片修改幅度
noise: 图片噪声强度
undesired: 排除标签
noTranslator: 禁用自动翻译

messages:
expect-prompt: 请输入标签。
Expand Down

0 comments on commit 55dd63f

Please sign in to comment.