fix: Update translation payload for audit logs (#10217)
Vue i18n would automatically merge arrays previously, it does not do so now. This PR fixes it by cleaning up the payload before passing it for translation
This commit is contained in:
@@ -35,13 +35,19 @@ const fetchAuditLogs = page => {
|
||||
};
|
||||
|
||||
const generateLogText = auditLogItem => {
|
||||
const translationPayload = generateTranslationPayload(
|
||||
auditLogItem,
|
||||
agentList.value
|
||||
);
|
||||
const payload = generateTranslationPayload(auditLogItem, agentList.value);
|
||||
const translationKey = generateLogActionKey(auditLogItem);
|
||||
|
||||
return t(translationKey, translationPayload);
|
||||
const joinIfArray = value => {
|
||||
return Array.isArray(value) ? value.join(', ') : value;
|
||||
};
|
||||
|
||||
const mergedPayload = {
|
||||
...payload,
|
||||
attributes: joinIfArray(payload.attributes),
|
||||
values: joinIfArray(payload.values),
|
||||
};
|
||||
return t(translationKey, mergedPayload);
|
||||
};
|
||||
|
||||
const onPageChange = page => {
|
||||
|
||||
Reference in New Issue
Block a user