From 9b0c8c21296bf2fcd3d6376c287ac25402e796f8 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:02:15 +0100 Subject: [PATCH] translate security objectives --- frontend/src/lib/utils/i18n.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/lib/utils/i18n.ts b/frontend/src/lib/utils/i18n.ts index 4cdc174d2..8e555956c 100644 --- a/frontend/src/lib/utils/i18n.ts +++ b/frontend/src/lib/utils/i18n.ts @@ -11,6 +11,10 @@ export function unsafeTranslate(key: string, params = {}, options = {}): string if (Object.hasOwn(m, key)) { return m[key](params, options); } + let res = key.match('^([^:]+):([^:]+)$'); + if (res) { + return (Object.hasOwn(m, res[1]) ? m[res[1]](params, options) : res[1]) + ':' + res[2]; + } if (Object.hasOwn(m, toCamelCase(key))) { return m[toCamelCase(key)](params, options); }