mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix(i18n): Turkish locale-aware search and sorting (#3115)
* feat(i18n): add Turkish locale-aware text helpers (search/sort) * test(i18n): cover null/whitespace edges + document compareTr/normalize contract * fix(i18n): route dashboard search through Turkish-safe matchesSearch * fix(i18n): sort user-visible lists with Turkish collation (compareTr) * fix(i18n): keep providerId tiebreaker as ASCII sort (technical id) * docs(i18n): document intentional lang=en in global-error boundary * chore(lint): guard against locale-unsafe toLowerCase().includes search * fix(i18n): migrate missed provider-name search + harden lint disable placement * fix(i18n): downgrade no-restricted-syntax to warn (incremental adoption) The rule errored on ~19 pre-existing toLowerCase().includes() call-sites in src/app accumulated since this PR's base. Keep it as a warning so the guard-rail guides future code without breaking the 0-errors lint gate (project policy: 0 errors, warnings tolerated). --------- Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import path from "path";
|
||||
import { requireCliToolsAuth } from "@/lib/api/requireCliToolsAuth";
|
||||
import { ensureCliConfigWriteAllowed, getCliConfigPaths } from "@/shared/services/cliRuntime";
|
||||
import { resolveDataDir } from "@/lib/dataPaths";
|
||||
import { compareTr } from "@/shared/utils/turkishText";
|
||||
import { codexProfileIdSchema, codexProfileNameSchema } from "@/shared/validation/schemas";
|
||||
import { isValidationFailure, validateBody } from "@/shared/validation/helpers";
|
||||
|
||||
@@ -88,7 +89,7 @@ export async function GET(request: Request) {
|
||||
}
|
||||
|
||||
// Sort by name
|
||||
profiles.sort((a, b) => a.name.localeCompare(b.name));
|
||||
profiles.sort((a, b) => compareTr(a.name, b.name));
|
||||
return NextResponse.json({ profiles });
|
||||
} catch (error) {
|
||||
console.log("Error listing codex profiles:", error.message);
|
||||
|
||||
@@ -134,6 +134,7 @@ async function saveContinueConfig({ baseUrl, apiKey, model }) {
|
||||
normalizeApiBase(m.apiBase).includes("omniroute") ||
|
||||
normalizeApiBase(m.apiBase).includes(`localhost:${apiPort}`) ||
|
||||
normalizeApiBase(m.apiBase).includes(`127.0.0.1:${apiPort}`) ||
|
||||
// eslint-disable-next-line no-restricted-syntax -- teknik string kontrolü, kullanıcı metni araması değil
|
||||
String(m.apiKey || "")
|
||||
.toLowerCase()
|
||||
.includes("sk_omniroute"))
|
||||
|
||||
Reference in New Issue
Block a user