-
Notifications
You must be signed in to change notification settings - Fork 342
Description
I encountered an issue after switching the language to Arabic in my application. The following error is thrown in the console:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0') at r.i18next (runtime.4a59971d836709dfc991.js:6:2322) at library.b717a95e17e4d6e9f5ca.js:350:1082 at e.exports.ChartWidget._setActions (library.b717a95e17e4d6e9f5ca.js:353:3062) at e.exports.ChartWidget._makeDefaultModel (library.b717a95e17e4d6e9f5ca.js:342:2175) at e.exports.ChartWidget._init (library.b717a95e17e4d6e9f5ca.js:341:2987) at e.exports.ChartWidget._requestMetadataAndProcessModel (library.b717a95e17e4d6e9f5ca.js:345:1601)
The error seems to be related to the i18next function in the charting library, specifically when handling the Arabic language.
Steps to Reproduce:
Load the application.
Switch the language to Arabic.
Check the console for the error.
code of the error raising part
r.i18next = (e, a={}, d, c=r.g.language) => { if (null === e) { if (Array.isArray(d)) return d[void 0 === a.count ? 0 : r._plural[c](a.count)].replace(/{(\w+)}/g, ( (e, d) => void 0 !== (a.replace || a)[d] ? (a.replace || a)[d] : e)); if ("object" == typeof d) { if (r.g.customTranslateFunction) { const e = r.g.customTranslateFunction(d.en[r._plural.en(a.count)], d.en[0], d[r.g.language][r._plural[r.g.language](a.count)]); if (null !== e) return e.replace(/{(\w+)}/g, ( (e, d) => void 0 !== (a.replace || a)[d] ? (a.replace || a)[d] : e)) } return d[r.g.language] ? r.i18next(null, a, d[r.g.language]) : r.i18next(null, a, d.en, "en") } } else if (d && e) { const c = ${e}${a.context ? _${a.context} : ""}; if (d[c]) return r.i18next(null, a, d[c]) } return "number" == typeof e ? e.toString() : "string" != typeof e ? "" : e }
Potential Cause: The issue seems to occur when the Arabic translation is missing or improperly defined, causing the function to attempt to access an undefined property.(Error raises for the word 'More settings' ,
