Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: i18n template would fail to render when command renamed with @koishijs/plugin-commands #574

Closed
purerosefallen opened this issue Mar 10, 2022 · 0 comments
Labels
bug BUG

Comments

@purerosefallen
Copy link
Member

Describe the bug

When a command got renamed by @koishijs/plugin-commands, the template would stop working for that command.

Steps to reproduce

import { App } from 'koishi';
import ConsolePlugin from '@koishijs/plugin-console';
import SandboxPlugin from '@koishijs/plugin-sandbox';
import * as CommandPlugin from '@koishijs/plugin-commands';

const app = new App({
  port: 14514,
  host: 'localhost',
  prefix: '.',
  locale: 'en',
});

app.plugin(SandboxPlugin);
app.plugin(ConsolePlugin, {
  open: false,
});

app.i18n.define('zh', 'commands.test.messages.msg', '中文');
app.i18n.define('en', 'commands.test.messages.msg', 'English');

app.command('test').action((argv) => argv.session.text('.msg'));
app.command('test1').action((argv) => argv.session.text('.msg'));

app.plugin(CommandPlugin, {
  test1: { name: 'test2' },
});

app.start();

Then test would work while test1 wouldn't.

Expected behavior

Its template should work as usual.

Screenshots

图片

Versions

  • OS: Ubuntu 20.04.3 LTS
  • Platform: Sandbox
  • Node version: v16.13.2
  • Koishi version: 4.4.1

Additional context

No response

@purerosefallen purerosefallen added the bug BUG label Mar 10, 2022
@shigma shigma closed this as completed in 2c5d54b Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug BUG
Projects
None yet
Development

No branches or pull requests

1 participant