mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 18:02:17 +03:00
Compare commits
1 Commits
feat/plugi
...
fix/tail-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9ffdb2781 |
@@ -29,11 +29,7 @@ function loadLocale(locale: string): Record<string, unknown> {
|
||||
return JSON.parse(raw) as Record<string, unknown>;
|
||||
}
|
||||
|
||||
function collectPlaceholderLeaves(
|
||||
node: unknown,
|
||||
pathPrefix: string,
|
||||
out: string[]
|
||||
): void {
|
||||
function collectPlaceholderLeaves(node: unknown, pathPrefix: string, out: string[]): void {
|
||||
if (node === null || typeof node !== "object") {
|
||||
if (typeof node === "string" && node.startsWith(PLACEHOLDER_PREFIX)) {
|
||||
out.push(pathPrefix);
|
||||
@@ -47,19 +43,13 @@ function collectPlaceholderLeaves(
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 1. Focused repro: the exact keys from the issue report
|
||||
// 1. (Retired) The original repro asserted zh-TW.json STILL carried raw
|
||||
// __MISSING__: placeholders. That translation backlog has since been filled, so
|
||||
// the sentinel no longer ships on disk — the invariant "no locale has a raw
|
||||
// __MISSING__: leaf" (test 3 below) is the durable guard. Keeping a test that
|
||||
// requires the backlog to EXIST would fail exactly when the content is healthy.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
test("#7258 repro: zh-TW keys carry a raw __MISSING__: placeholder before the fix is exercised", () => {
|
||||
const zhTW = loadLocale("zh-TW");
|
||||
const leaves: string[] = [];
|
||||
collectPlaceholderLeaves(zhTW, "", leaves);
|
||||
assert.ok(
|
||||
leaves.length > 0,
|
||||
"expected zh-TW.json to still contain __MISSING__: placeholders (translation content backlog)"
|
||||
);
|
||||
});
|
||||
|
||||
test("#7258: deepMergeFallback replaces an untranslated __MISSING__ placeholder with the EN fallback value", () => {
|
||||
const target: Record<string, unknown> = {
|
||||
localUsageCommand: `${PLACEHOLDER_PREFIX}Run this command locally`,
|
||||
|
||||
@@ -26,7 +26,7 @@ test("qianfan registers Baidu ERNIE as an OpenAI-compatible API key provider", (
|
||||
|
||||
assert.ok(APIKEY_PROVIDERS.qianfan, "qianfan should be visible in API key providers");
|
||||
assert.equal(APIKEY_PROVIDERS.qianfan.name, "Baidu Qianfan");
|
||||
assert.equal(APIKEY_PROVIDERS.qianfan.website, "https://cloud.baidu.com/product/wenxinworkshop");
|
||||
assert.equal(APIKEY_PROVIDERS.qianfan.website, "https://cloud.baidu.com/product-s/qianfan_home");
|
||||
assert.equal(APIKEY_PROVIDERS.qianfan.passthroughModels, undefined);
|
||||
|
||||
assert.equal(PROVIDERS.qianfan.baseUrl, registryEntry.baseUrl);
|
||||
|
||||
Reference in New Issue
Block a user