79380643

Date: 2025-01-23 10:25:25
Score: 2
Natty:
Report link
/* @vite-ignore */ await import('primelocale/' + event.lang + '.json').then((primeNgLocale) => {
                console.log(primeNgLocale[event.lang])
                this.primeNG.setTranslation(primeNgLocale[event.lang])
            }).catch(async () => {
                // Fallback to English if locale import fails
                /* @vite-ignore */ await import('primelocale/en.json').then((primeNgLocale) => {
                    this.primeNG.setTranslation(primeNgLocale.en)
                }).catch(() => {
                    console.warn(`Could not load PrimeNG locale for language: ${event.lang}`)
                })
            })

I tried do do this for lang switching but it won't work, any suggestions ? I noticed this warning : The above dynamic import cannot be analyzed by Vite. maybe because of that i dont know

Reasons:
  • RegEx Blacklisted phrase (2): any suggestions
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Guillaume OSTORERO