@zhin.js/plugin-ledger 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/commands/ledger-add/index.js +6 -4
- package/commands/ledger-add/index.ts +6 -4
- package/commands/ledger-delete/index.js +6 -4
- package/commands/ledger-delete/index.ts +6 -4
- package/commands/ledger-list/index.js +8 -6
- package/commands/ledger-list/index.ts +8 -6
- package/commands/ledger-month/index.js +5 -3
- package/commands/ledger-month/index.ts +5 -3
- package/commands/ledger-report/index.js +11 -11
- package/commands/ledger-report/index.ts +10 -12
- package/commands/ledger-stats/index.js +8 -6
- package/commands/ledger-stats/index.ts +8 -6
- package/commands/ledger-today/index.js +5 -3
- package/commands/ledger-today/index.ts +5 -3
- package/commands/ledger-week/index.js +5 -3
- package/commands/ledger-week/index.ts +5 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/entry-input.d.ts +3 -2
- package/lib/entry-input.d.ts.map +1 -1
- package/lib/entry-input.js +11 -9
- package/lib/entry-input.js.map +1 -1
- package/lib/i18n.d.ts +2 -0
- package/lib/i18n.d.ts.map +1 -0
- package/lib/i18n.js +200 -0
- package/lib/i18n.js.map +1 -0
- package/lib/identity.d.ts +3 -1
- package/lib/identity.d.ts.map +1 -1
- package/lib/identity.js +5 -2
- package/lib/identity.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/money.d.ts +2 -1
- package/lib/money.d.ts.map +1 -1
- package/lib/money.js +6 -5
- package/lib/money.js.map +1 -1
- package/lib/period.d.ts +4 -3
- package/lib/period.d.ts.map +1 -1
- package/lib/period.js +8 -16
- package/lib/period.js.map +1 -1
- package/lib/report-format.d.ts +5 -4
- package/lib/report-format.d.ts.map +1 -1
- package/lib/report-format.js +25 -24
- package/lib/report-format.js.map +1 -1
- package/lib/service.d.ts +1 -1
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +59 -25
- package/lib/service.js.map +1 -1
- package/lib/store.d.ts +9 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +32 -3
- package/lib/store.js.map +1 -1
- package/package.json +7 -7
- package/schema.json +15 -0
- package/src/config.ts +3 -3
- package/src/entry-input.ts +12 -9
- package/src/i18n.ts +200 -0
- package/src/identity.ts +6 -2
- package/src/index.ts +1 -1
- package/src/money.ts +7 -5
- package/src/period.ts +7 -13
- package/src/report-format.ts +26 -24
- package/src/service.ts +59 -26
- package/src/store.ts +33 -3
package/README.md
CHANGED
|
@@ -82,3 +82,9 @@ pnpm --filter @zhin.js/plugin-ledger test
|
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
测试使用 `@zhin.js/testing` 的 `FakePlugin` 与 `FakeClock`,覆盖金额与输入解析、用户隔离、群聊隐私、删除权限、时区下的日/周/月边界和日报调度。
|
|
85
|
+
|
|
86
|
+
## 语言
|
|
87
|
+
|
|
88
|
+
指令反馈跟随当前发送者语言;英文环境的时间范围为 `today / week / month / all`,日报操作为 `on / off / status`,中文环境仍使用对应中文输入。命令路径与已有别名保持不变,提示中的调用头由当前 Endpoint 的实际前缀及插件命名空间生成。
|
|
89
|
+
|
|
90
|
+
每日日报在开启时固定语言,之后修改个人偏好不改变已开启日报。旧数据库的日报仍按中文发送,启动时仅增补声明的可空语言列。语言不改变配置时区、人民币金额格式或群聊金额隐私。
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '记一笔消费:记 <类别> <金额> [备注]',
|
|
8
|
+
description: '记一笔消费:记 <类别> <金额> [备注]', descriptionI18n: { en: "Record an expense with a category, amount and optional note" },
|
|
7
9
|
alias: ['记'],
|
|
8
10
|
params: {
|
|
9
|
-
entry: { type: 'text', min: 1, max: 200, description: '类别 金额 [备注],例如:午饭 18.5 和同事' },
|
|
11
|
+
entry: { type: 'text', min: 1, max: 200, description: '类别 金额 [备注],例如:午饭 18.5 和同事', descriptionI18n: { en: "Category, amount and optional note, such as Lunch 18.5 With colleagues" } },
|
|
10
12
|
},
|
|
11
|
-
async execute({ input, params, use }) {
|
|
13
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
12
14
|
return replyLedger(async () => {
|
|
13
|
-
const caller = ledgerCaller(input);
|
|
15
|
+
const caller = ledgerCaller(input, locale);
|
|
14
16
|
return use(ledgerServiceToken).addEntry(caller, params.entry);
|
|
15
17
|
});
|
|
16
18
|
},
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '记一笔消费:记 <类别> <金额> [备注]',
|
|
8
|
+
description: '记一笔消费:记 <类别> <金额> [备注]', descriptionI18n: { en: "Record an expense with a category, amount and optional note" },
|
|
7
9
|
alias: ['记'],
|
|
8
10
|
params: {
|
|
9
|
-
entry: { type: 'text', min: 1, max: 200, description: '类别 金额 [备注],例如:午饭 18.5 和同事' },
|
|
11
|
+
entry: { type: 'text', min: 1, max: 200, description: '类别 金额 [备注],例如:午饭 18.5 和同事', descriptionI18n: { en: "Category, amount and optional note, such as Lunch 18.5 With colleagues" } },
|
|
10
12
|
},
|
|
11
|
-
async execute({ input, params, use }) {
|
|
13
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
12
14
|
return replyLedger(async () => {
|
|
13
|
-
const caller = ledgerCaller(input);
|
|
15
|
+
const caller = ledgerCaller(input, locale);
|
|
14
16
|
return use(ledgerServiceToken).addEntry(caller, params.entry);
|
|
15
17
|
});
|
|
16
18
|
},
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '删除自己的一笔记账:删账 <编号>',
|
|
8
|
+
description: '删除自己的一笔记账:删账 <编号>', descriptionI18n: { en: "Delete one of your expense records" },
|
|
7
9
|
alias: ['删账'],
|
|
8
10
|
params: {
|
|
9
|
-
id: { type: 'integer', min: 1, description: '账目编号(记账回复或「账单」中的 #编号)' },
|
|
11
|
+
id: { type: 'integer', min: 1, description: '账目编号(记账回复或「账单」中的 #编号)', descriptionI18n: { en: "Record ID from the expense list" } },
|
|
10
12
|
},
|
|
11
|
-
async execute({ input, params, use }) {
|
|
13
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
12
14
|
return replyLedger(async () => {
|
|
13
|
-
const caller = ledgerCaller(input);
|
|
15
|
+
const caller = ledgerCaller(input, locale);
|
|
14
16
|
return use(ledgerServiceToken).deleteEntry(caller, params.id);
|
|
15
17
|
});
|
|
16
18
|
},
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '删除自己的一笔记账:删账 <编号>',
|
|
8
|
+
description: '删除自己的一笔记账:删账 <编号>', descriptionI18n: { en: "Delete one of your expense records" },
|
|
7
9
|
alias: ['删账'],
|
|
8
10
|
params: {
|
|
9
|
-
id: { type: 'integer', min: 1, description: '账目编号(记账回复或「账单」中的 #编号)' },
|
|
11
|
+
id: { type: 'integer', min: 1, description: '账目编号(记账回复或「账单」中的 #编号)', descriptionI18n: { en: "Record ID from the expense list" } },
|
|
10
12
|
},
|
|
11
|
-
async execute({ input, params, use }) {
|
|
13
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
12
14
|
return replyLedger(async () => {
|
|
13
|
-
const caller = ledgerCaller(input);
|
|
15
|
+
const caller = ledgerCaller(input, locale);
|
|
14
16
|
return use(ledgerServiceToken).deleteEntry(caller, params.id);
|
|
15
17
|
});
|
|
16
18
|
},
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { parsePeriodWord } from "../../lib/period.js";
|
|
5
7
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
6
8
|
export default defineCommand({
|
|
7
|
-
description: '列出账目及编号(最新 20 笔):账单 [今日|本周|本月|全部],默认本月',
|
|
9
|
+
description: '列出账目及编号(最新 20 笔):账单 [今日|本周|本月|全部],默认本月', descriptionI18n: { en: "List the latest 20 expense records with IDs; defaults to the current month" },
|
|
8
10
|
alias: ['账单'],
|
|
9
11
|
params: {
|
|
10
|
-
period: { type: 'word', optional: true, description: '今日、本周、本月或全部' },
|
|
12
|
+
period: { type: 'word', optional: true, description: '今日、本周、本月或全部', descriptionI18n: { en: "Today, this week, this month, or all time" } },
|
|
11
13
|
},
|
|
12
|
-
async execute({ input, params, use }) {
|
|
14
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
13
15
|
return replyLedger(async () => {
|
|
14
|
-
const caller = ledgerCaller(input);
|
|
15
|
-
const period = parsePeriodWord(params.period, 'month');
|
|
16
|
+
const caller = ledgerCaller(input, locale);
|
|
17
|
+
const period = parsePeriodWord(params.period, 'month', locale);
|
|
16
18
|
if (!period)
|
|
17
|
-
return '
|
|
19
|
+
return t(locale, 'periodInput');
|
|
18
20
|
return use(ledgerServiceToken).listEntries(caller, period);
|
|
19
21
|
});
|
|
20
22
|
},
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { parsePeriodWord } from '../../src/period.js';
|
|
4
6
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
5
7
|
|
|
6
8
|
export default defineCommand({
|
|
7
|
-
description: '列出账目及编号(最新 20 笔):账单 [今日|本周|本月|全部],默认本月',
|
|
9
|
+
description: '列出账目及编号(最新 20 笔):账单 [今日|本周|本月|全部],默认本月', descriptionI18n: { en: "List the latest 20 expense records with IDs; defaults to the current month" },
|
|
8
10
|
alias: ['账单'],
|
|
9
11
|
params: {
|
|
10
|
-
period: { type: 'word', optional: true, description: '今日、本周、本月或全部' },
|
|
12
|
+
period: { type: 'word', optional: true, description: '今日、本周、本月或全部', descriptionI18n: { en: "Today, this week, this month, or all time" } },
|
|
11
13
|
},
|
|
12
|
-
async execute({ input, params, use }) {
|
|
14
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
13
15
|
return replyLedger(async () => {
|
|
14
|
-
const caller = ledgerCaller(input);
|
|
15
|
-
const period = parsePeriodWord(params.period, 'month');
|
|
16
|
-
if (!period) return '
|
|
16
|
+
const caller = ledgerCaller(input, locale);
|
|
17
|
+
const period = parsePeriodWord(params.period, 'month', locale);
|
|
18
|
+
if (!period) return t(locale, 'periodInput');
|
|
17
19
|
return use(ledgerServiceToken).listEntries(caller, period);
|
|
18
20
|
});
|
|
19
21
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看本月消费合计与分类明细',
|
|
8
|
+
description: '查看本月消费合计与分类明细', descriptionI18n: { en: "View this month's spending totals and categories" },
|
|
7
9
|
alias: ['本月消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'month');
|
|
12
14
|
});
|
|
13
15
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看本月消费合计与分类明细',
|
|
8
|
+
description: '查看本月消费合计与分类明细', descriptionI18n: { en: "View this month's spending totals and categories" },
|
|
7
9
|
alias: ['本月消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'month');
|
|
12
14
|
});
|
|
13
15
|
},
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
|
-
const ACTIONS = {
|
|
6
|
-
开启: 'on',
|
|
7
|
-
关闭: 'off',
|
|
8
|
-
状态: 'status',
|
|
9
|
-
};
|
|
10
7
|
export default defineCommand({
|
|
11
|
-
description: '订阅或取消每日私信记账日报:记账日报 [开启|关闭|状态]',
|
|
8
|
+
description: '订阅或取消每日私信记账日报:记账日报 [开启|关闭|状态]', descriptionI18n: { en: "Manage the daily expense report sent by private message" },
|
|
12
9
|
alias: ['记账日报'],
|
|
13
10
|
params: {
|
|
14
|
-
action: { type: 'word', optional: true,
|
|
11
|
+
action: { type: 'word', optional: true, description: '开启、关闭或状态(默认状态)', descriptionI18n: { en: "on, off, or status (default: status)" } },
|
|
15
12
|
},
|
|
16
|
-
async execute({ input, params, use }) {
|
|
13
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
17
14
|
return replyLedger(async () => {
|
|
18
|
-
const caller = ledgerCaller(input);
|
|
19
|
-
const
|
|
20
|
-
|
|
15
|
+
const caller = ledgerCaller(input, locale);
|
|
16
|
+
const actions = resolveLocale(locale) === 'en' ? { on: 'on', off: 'off', status: 'status' } : { 开启: 'on', 关闭: 'off', 状态: 'status' };
|
|
17
|
+
const action = params.action === undefined ? 'status' : actions[params.action];
|
|
18
|
+
if (!action)
|
|
19
|
+
return t(locale, 'actionInput');
|
|
20
|
+
return use(ledgerServiceToken).dailyReport(caller, action, formatCommand('ledger-report'));
|
|
21
21
|
});
|
|
22
22
|
},
|
|
23
23
|
});
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
import type { DailyReportAction } from '../../src/service.js';
|
|
5
7
|
|
|
6
|
-
const ACTIONS: Readonly<Record<string, DailyReportAction>> = {
|
|
7
|
-
开启: 'on',
|
|
8
|
-
关闭: 'off',
|
|
9
|
-
状态: 'status',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
8
|
export default defineCommand({
|
|
13
|
-
description: '订阅或取消每日私信记账日报:记账日报 [开启|关闭|状态]',
|
|
9
|
+
description: '订阅或取消每日私信记账日报:记账日报 [开启|关闭|状态]', descriptionI18n: { en: "Manage the daily expense report sent by private message" },
|
|
14
10
|
alias: ['记账日报'],
|
|
15
11
|
params: {
|
|
16
|
-
action: { type: 'word', optional: true,
|
|
12
|
+
action: { type: 'word', optional: true, description: '开启、关闭或状态(默认状态)', descriptionI18n: { en: "on, off, or status (default: status)" } },
|
|
17
13
|
},
|
|
18
|
-
async execute({ input, params, use }) {
|
|
14
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
19
15
|
return replyLedger(async () => {
|
|
20
|
-
const caller = ledgerCaller(input);
|
|
21
|
-
const
|
|
22
|
-
|
|
16
|
+
const caller = ledgerCaller(input, locale);
|
|
17
|
+
const actions: Readonly<Record<string, DailyReportAction>> = resolveLocale(locale) === 'en' ? { on: 'on', off: 'off', status: 'status' } : { 开启: 'on', 关闭: 'off', 状态: 'status' };
|
|
18
|
+
const action = params.action === undefined ? 'status' : actions[params.action];
|
|
19
|
+
if (!action) return t(locale, 'actionInput');
|
|
20
|
+
return use(ledgerServiceToken).dailyReport(caller, action, formatCommand('ledger-report'));
|
|
23
21
|
});
|
|
24
22
|
},
|
|
25
23
|
});
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { parsePeriodWord } from "../../lib/period.js";
|
|
5
7
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
6
8
|
export default defineCommand({
|
|
7
|
-
description: '按类别统计合计、笔数、平均、最大与占比:分类统计 [今日|本周|本月|全部],默认本月',
|
|
9
|
+
description: '按类别统计合计、笔数、平均、最大与占比:分类统计 [今日|本周|本月|全部],默认本月', descriptionI18n: { en: "Category totals, counts, averages, maxima and proportions; defaults to the current month" },
|
|
8
10
|
alias: ['分类统计'],
|
|
9
11
|
params: {
|
|
10
|
-
period: { type: 'word', optional: true, description: '今日、本周、本月或全部' },
|
|
12
|
+
period: { type: 'word', optional: true, description: '今日、本周、本月或全部', descriptionI18n: { en: "Today, this week, this month, or all time" } },
|
|
11
13
|
},
|
|
12
|
-
async execute({ input, params, use }) {
|
|
14
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
13
15
|
return replyLedger(async () => {
|
|
14
|
-
const caller = ledgerCaller(input);
|
|
15
|
-
const period = parsePeriodWord(params.period, 'month');
|
|
16
|
+
const caller = ledgerCaller(input, locale);
|
|
17
|
+
const period = parsePeriodWord(params.period, 'month', locale);
|
|
16
18
|
if (!period)
|
|
17
|
-
return '
|
|
19
|
+
return t(locale, 'periodInput');
|
|
18
20
|
return use(ledgerServiceToken).categoryStatistics(caller, period);
|
|
19
21
|
});
|
|
20
22
|
},
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { parsePeriodWord } from '../../src/period.js';
|
|
4
6
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
5
7
|
|
|
6
8
|
export default defineCommand({
|
|
7
|
-
description: '按类别统计合计、笔数、平均、最大与占比:分类统计 [今日|本周|本月|全部],默认本月',
|
|
9
|
+
description: '按类别统计合计、笔数、平均、最大与占比:分类统计 [今日|本周|本月|全部],默认本月', descriptionI18n: { en: "Category totals, counts, averages, maxima and proportions; defaults to the current month" },
|
|
8
10
|
alias: ['分类统计'],
|
|
9
11
|
params: {
|
|
10
|
-
period: { type: 'word', optional: true, description: '今日、本周、本月或全部' },
|
|
12
|
+
period: { type: 'word', optional: true, description: '今日、本周、本月或全部', descriptionI18n: { en: "Today, this week, this month, or all time" } },
|
|
11
13
|
},
|
|
12
|
-
async execute({ input, params, use }) {
|
|
14
|
+
async execute({ input, params, use, locale, formatCommand }) {
|
|
13
15
|
return replyLedger(async () => {
|
|
14
|
-
const caller = ledgerCaller(input);
|
|
15
|
-
const period = parsePeriodWord(params.period, 'month');
|
|
16
|
-
if (!period) return '
|
|
16
|
+
const caller = ledgerCaller(input, locale);
|
|
17
|
+
const period = parsePeriodWord(params.period, 'month', locale);
|
|
18
|
+
if (!period) return t(locale, 'periodInput');
|
|
17
19
|
return use(ledgerServiceToken).categoryStatistics(caller, period);
|
|
18
20
|
});
|
|
19
21
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看今日消费合计与分类明细',
|
|
8
|
+
description: '查看今日消费合计与分类明细', descriptionI18n: { en: "View today's spending totals and categories" },
|
|
7
9
|
alias: ['今日消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'today');
|
|
12
14
|
});
|
|
13
15
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看今日消费合计与分类明细',
|
|
8
|
+
description: '查看今日消费合计与分类明细', descriptionI18n: { en: "View today's spending totals and categories" },
|
|
7
9
|
alias: ['今日消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'today');
|
|
12
14
|
});
|
|
13
15
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
3
|
+
import { messages as t } from "../../lib/i18n.js";
|
|
2
4
|
import { defineCommand } from 'zhin.js/command';
|
|
3
5
|
import { ledgerCaller, replyLedger } from "../../lib/identity.js";
|
|
4
6
|
import { ledgerServiceToken } from "../../lib/runtime.js";
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看本周(周一至周日)消费合计与分类明细',
|
|
8
|
+
description: '查看本周(周一至周日)消费合计与分类明细', descriptionI18n: { en: "View this week's spending totals and categories (Monday through Sunday)" },
|
|
7
9
|
alias: ['本周消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'week');
|
|
12
14
|
});
|
|
13
15
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { resolveLocale } from 'zhin.js/i18n';
|
|
2
|
+
import { messages as t } from '../../src/i18n.js';
|
|
1
3
|
import { defineCommand } from 'zhin.js/command';
|
|
2
4
|
import { ledgerCaller, replyLedger } from '../../src/identity.js';
|
|
3
5
|
import { ledgerServiceToken } from '../../src/runtime.js';
|
|
4
6
|
|
|
5
7
|
export default defineCommand({
|
|
6
|
-
description: '查看本周(周一至周日)消费合计与分类明细',
|
|
8
|
+
description: '查看本周(周一至周日)消费合计与分类明细', descriptionI18n: { en: "View this week's spending totals and categories (Monday through Sunday)" },
|
|
7
9
|
alias: ['本周消费'],
|
|
8
|
-
async execute({ input, use }) {
|
|
10
|
+
async execute({ input, use, locale, formatCommand }) {
|
|
9
11
|
return replyLedger(async () => {
|
|
10
|
-
const caller = ledgerCaller(input);
|
|
12
|
+
const caller = ledgerCaller(input, locale);
|
|
11
13
|
return use(ledgerServiceToken).periodSummary(caller, 'week');
|
|
12
14
|
});
|
|
13
15
|
},
|
package/lib/config.js
CHANGED
|
@@ -2,9 +2,9 @@ import { Schema } from 'zhin.js';
|
|
|
2
2
|
export const DEFAULT_TIMEZONE = 'Asia/Shanghai';
|
|
3
3
|
export const DEFAULT_REPORT_TIME = '22:00';
|
|
4
4
|
export const ledgerConfig = Schema.object({
|
|
5
|
-
timezone: Schema.string().default(DEFAULT_TIMEZONE).description('计算今日、本周(周一开始)、本月与日报日期所用的 IANA 时区').effect('reload'),
|
|
6
|
-
reportTime: Schema.string().default(DEFAULT_REPORT_TIME).description('记账日报的发送时间(HH:MM,按 timezone);只发给用「记账日报 开启」订阅的用户').effect('reload'),
|
|
7
|
-
reportWhenEmpty: Schema.boolean().default(false).description('当天没有记账时是否仍发送日报').effect('reload'),
|
|
5
|
+
timezone: Schema.string().default(DEFAULT_TIMEZONE).description('计算今日、本周(周一开始)、本月与日报日期所用的 IANA 时区').i18n({ "en": { "description": "IANA timezone used to calculate today, this week (starting Monday), this month and daily-report dates." } }).effect('reload'),
|
|
6
|
+
reportTime: Schema.string().default(DEFAULT_REPORT_TIME).description('记账日报的发送时间(HH:MM,按 timezone);只发给用「记账日报 开启」订阅的用户').i18n({ "en": { "description": "Daily ledger report time (HH:MM in timezone); sent only to users who explicitly subscribed to daily reports." } }).effect('reload'),
|
|
7
|
+
reportWhenEmpty: Schema.boolean().default(false).description('当天没有记账时是否仍发送日报').i18n({ "en": { "description": "Send a daily report even when no transactions were recorded that day." } }).effect('reload'),
|
|
8
8
|
});
|
|
9
9
|
const REPORT_TIME_PATTERN = /^(?:[01]\d|2[0-3]):[0-5]\d$/u;
|
|
10
10
|
function assertTimezone(timezone) {
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,EAAC,aAAa,EAAE,wGAAwG,EAAC,EAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC5P,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,EAAC,aAAa,EAAE,8GAA8G,EAAC,EAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;IACrR,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,EAAC,aAAa,EAAE,uEAAuE,EAAC,EAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;CACvM,CAAC,CAAC;AAUH,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAE3D,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,CAAC;QACH,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,QAAQ,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAC;QACxH,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,SAAS,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,MAAyC;IAC3E,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,IAAI,gBAAgB,CAAC;IACtD,MAAM,UAAU,GAAG,MAAM,EAAE,UAAU,IAAI,mBAAmB,CAAC;IAC7D,MAAM,eAAe,GAAG,MAAM,EAAE,eAAe,IAAI,KAAK,CAAC;IACzD,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,2BAA2B,UAAU,EAAE,CAAC,CAAC;IACxG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AACnD,CAAC"}
|
package/lib/entry-input.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type Locale } from 'zhin.js/i18n';
|
|
1
2
|
export declare const MAX_CATEGORY_LENGTH = 20;
|
|
2
3
|
export declare const MAX_NOTE_LENGTH = 100;
|
|
3
|
-
export declare const ADD_USAGE
|
|
4
|
+
export declare const ADD_USAGE: string;
|
|
4
5
|
export interface ParsedEntryInput {
|
|
5
6
|
readonly category: string;
|
|
6
7
|
readonly amountCents: number;
|
|
@@ -14,5 +15,5 @@ export type EntryInputResult = {
|
|
|
14
15
|
readonly reason: string;
|
|
15
16
|
};
|
|
16
17
|
/** Parses the text after `记`: category, amount, then an optional free-form note. */
|
|
17
|
-
export declare function parseEntryInput(text: string): EntryInputResult;
|
|
18
|
+
export declare function parseEntryInput(text: string, locale?: Locale): EntryInputResult;
|
|
18
19
|
//# sourceMappingURL=entry-input.d.ts.map
|
package/lib/entry-input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-input.d.ts","sourceRoot":"","sources":["../src/entry-input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-input.d.ts","sourceRoot":"","sources":["../src/entry-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI1D,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,SAAS,QAAsB,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAMpD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAiB/E"}
|
package/lib/entry-input.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
+
import { messages as t } from './i18n.js';
|
|
1
2
|
import { parseAmountToCents } from './money.js';
|
|
2
3
|
export const MAX_CATEGORY_LENGTH = 20;
|
|
3
4
|
export const MAX_NOTE_LENGTH = 100;
|
|
4
|
-
export const ADD_USAGE = '
|
|
5
|
+
export const ADD_USAGE = t('zh-CN', 'usage');
|
|
5
6
|
function rejected(reason) {
|
|
6
7
|
return { ok: false, reason };
|
|
7
8
|
}
|
|
8
9
|
/** Parses the text after `记`: category, amount, then an optional free-form note. */
|
|
9
|
-
export function parseEntryInput(text) {
|
|
10
|
+
export function parseEntryInput(text, locale) {
|
|
11
|
+
const usage = t(locale, 'usage');
|
|
10
12
|
const words = text.trim().split(/\s+/u).filter((word) => word !== '');
|
|
11
13
|
if (words.length < 2)
|
|
12
|
-
return rejected(
|
|
14
|
+
return rejected(usage);
|
|
13
15
|
const category = words[0];
|
|
14
16
|
const amountText = words[1];
|
|
15
17
|
const note = words.slice(2).join(' ');
|
|
16
|
-
const amount = parseAmountToCents(amountText);
|
|
18
|
+
const amount = parseAmountToCents(amountText, locale);
|
|
17
19
|
if (!amount.ok) {
|
|
18
20
|
const categoryLooksLikeAmount = parseAmountToCents(category).ok;
|
|
19
21
|
if (categoryLooksLikeAmount)
|
|
20
|
-
return rejected(
|
|
21
|
-
return rejected(
|
|
22
|
+
return rejected(t(locale, 'order', { usage }));
|
|
23
|
+
return rejected(t(locale, 'amountError', { reason: amount.reason, usage }));
|
|
22
24
|
}
|
|
23
25
|
if (parseAmountToCents(category).ok)
|
|
24
|
-
return rejected(
|
|
26
|
+
return rejected(t(locale, 'categoryNumber', { usage }));
|
|
25
27
|
if ([...category].length > MAX_CATEGORY_LENGTH)
|
|
26
|
-
return rejected(
|
|
28
|
+
return rejected(t(locale, 'categoryLimit', { max: MAX_CATEGORY_LENGTH }));
|
|
27
29
|
if ([...note].length > MAX_NOTE_LENGTH)
|
|
28
|
-
return rejected(
|
|
30
|
+
return rejected(t(locale, 'noteLimit', { max: MAX_NOTE_LENGTH }));
|
|
29
31
|
return { ok: true, entry: { category, amountCents: amount.cents, note } };
|
|
30
32
|
}
|
|
31
33
|
//# sourceMappingURL=entry-input.js.map
|
package/lib/entry-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-input.js","sourceRoot":"","sources":["../src/entry-input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-input.js","sourceRoot":"","sources":["../src/entry-input.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAY7C,SAAS,QAAQ,CAAC,MAAc;IAC9B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAe;IAC3D,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QAChE,IAAI,uBAAuB;YAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7F,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,GAAG,mBAAmB;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC1H,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,GAAG,eAAe;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;IAC1G,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;AAC5E,CAAC"}
|
package/lib/i18n.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const messages: (locale: import("zhin.js").Locale | undefined, key: "actor" | "usage" | "order" | "amountError" | "categoryNumber" | "categoryLimit" | "noteLimit" | "negative" | "amountFormat" | "zero" | "amountMax" | "period.today" | "period.week" | "period.month" | "period.all" | "allRecords" | "periodInput" | "actionInput" | "added" | "notFound" | "deleted" | "spending" | "statistics" | "entryList" | "privateSent" | "privateFallback" | "reportEnabled" | "reportDisabled" | "reportOff" | "noPrivate" | "reportOn" | "cannotPrivate" | "reportOnPrivate" | "report" | "commandHint" | "emptySummary" | "summaryHeader" | "total" | "categoryFull" | "categoryMasked" | "emptyStats" | "statsHeader" | "statsFull" | "statsMasked" | "categoryCount" | "categoryCountTotal" | "emptyList" | "listHeader" | "more", values?: import("zhin.js").MessageValues) => string;
|
|
2
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,20BAqMnB,CAAC"}
|