File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed
Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -59,22 +59,20 @@ export default {
5959 } ,
6060 async registerTrads ( { locales } ) {
6161 const importedTrads = await Promise . all (
62- locales . map ( ( locale ) => {
63- return import (
64- /* webpackChunkName: "sitemap-translation-[request]" */ `./translations/${ locale } .json`
65- )
66- . then ( ( { default : data } ) => {
67- return {
68- data : prefixPluginTranslations ( data , pluginId ) ,
69- locale,
70- } ;
71- } )
72- . catch ( ( ) => {
73- return {
74- data : { } ,
75- locale,
76- } ;
77- } ) ;
62+ locales . map ( async ( locale ) => {
63+ try {
64+ // eslint-disable-next-line import/no-dynamic-require
65+ const data = require ( `./translations/${ locale } .json` ) ;
66+ return {
67+ data : prefixPluginTranslations ( data , pluginId ) ,
68+ locale,
69+ } ;
70+ } catch {
71+ return {
72+ data : { } ,
73+ locale,
74+ } ;
75+ }
7876 } ) ,
7977 ) ;
8078
You can’t perform that action at this time.
0 commit comments