Merged PR 2449: language helper

Related work items: #23754
This commit is contained in:
Robert Bond
2026-07-01 11:29:15 +00:00
parent 49aa258fd9
commit e864049bec
63 changed files with 4008 additions and 6094 deletions
+6 -8
View File
@@ -1,17 +1,15 @@
import { JSONPath as jsonpath } from "jsonpath-plus";
import resolveCrmDisplayValue from "../../lib/i18n/crmDisplay/resolveCrmDisplayValue";
const translateLpaName = ({ name, locale, transLookup }) => {
if (!name) return "";
if (locale !== "cy") return name;
return (
jsonpath({
path: '$..[?(@ && @.value=="' + name + '")].value_cy',
json: transLookup,
eval: true
})?.[0] || name
);
return resolveCrmDisplayValue({
value: name,
locale,
translations: transLookup
});
};
export const getCaseLpaNames = ({