mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-13 04:34:21 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62353717be |
No files matched your search
@@ -79,6 +79,17 @@ const item = (name: string, kind: OutlineItem["kind"], line: number, children: O
|
||||
return { name, kind, detail: null, range: r, selection_range: r, children };
|
||||
};
|
||||
|
||||
describe("usages label", () => {
|
||||
it("is translated", async () => {
|
||||
const { usagesLabel } = await import("./codeLens");
|
||||
const { setLocale } = await import("@/platform/i18n");
|
||||
expect([0, 1, 3].map(usagesLabel)).toEqual(["no usages", "1 usage", "3 usages"]);
|
||||
await setLocale("zh");
|
||||
expect([0, 1, 3].map(usagesLabel)).toEqual(["无用法", "1 个用法", "3 个用法"]);
|
||||
await setLocale("en");
|
||||
});
|
||||
});
|
||||
|
||||
describe("usages lens targets", () => {
|
||||
it("skips callbacks and anonymous functions", () => {
|
||||
const items = [
|
||||
|
||||
@@ -81,8 +81,8 @@ export function lensTargets(items: readonly OutlineItem[]): LensTarget[] {
|
||||
}
|
||||
|
||||
export function usagesLabel(n: number): string {
|
||||
if (n === 0) return "no usages";
|
||||
return n === 1 ? "1 usage" : `${n} usages`;
|
||||
if (n === 0) return tx("no usages");
|
||||
return n === 1 ? tx("1 usage") : tx`${n} usages`;
|
||||
}
|
||||
|
||||
const setLenses = StateEffect.define<CodeLens[]>();
|
||||
|
||||
@@ -1469,5 +1469,8 @@
|
||||
"Commands agents run appear in the Run tool window as _agent_ tabs. Beyond this many finished ones, the oldest move to the archive at the end of the tab strip. Running commands are never archived.": "Commands agents run appear in the Run tool window as _agent_ tabs. Beyond this many finished ones, the oldest move to the archive at the end of the tab strip. Running commands are never archived.",
|
||||
"Archived agent tabs to keep": "Archived agent tabs to keep",
|
||||
"Beyond this many archived agent tabs, the oldest are closed.": "Beyond this many archived agent tabs, the oldest are closed.",
|
||||
"Archived ({count})": "Archived ({count})"
|
||||
"Archived ({count})": "Archived ({count})",
|
||||
"no usages": "no usages",
|
||||
"1 usage": "1 usage",
|
||||
"{n} usages": "{n} usages"
|
||||
}
|
||||
@@ -7867,5 +7867,8 @@
|
||||
"Commands agents run appear in the Run tool window as _agent_ tabs. Beyond this many finished ones, the oldest move to the archive at the end of the tab strip. Running commands are never archived.": "智能体运行的命令以 _agent_ 标签显示在运行工具窗口中。已结束的标签超过这个数量时,最旧的会移入标签栏末尾的归档。正在运行的命令永远不会被归档。",
|
||||
"Archived agent tabs to keep": "保留的已归档智能体标签数",
|
||||
"Beyond this many archived agent tabs, the oldest are closed.": "已归档的智能体标签超过这个数量时,最旧的会被关闭。",
|
||||
"Archived ({count})": "归档({count})"
|
||||
"Archived ({count})": "归档({count})",
|
||||
"no usages": "无用法",
|
||||
"1 usage": "1 个用法",
|
||||
"{n} usages": "{n} 个用法"
|
||||
}
|
||||
Reference in new issue
Block a user