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 @@ -49,22 +49,20 @@ export default {
4949 bootstrap ( app ) { } ,
5050 async registerTrads ( { locales } ) {
5151 const importedTrads = await Promise . all (
52- locales . map ( ( locale ) => {
53- return import (
54- /* webpackChunkName: "config-sync-translation-[request]" */ `./translations/${ locale } .json`
55- )
56- . then ( ( { default : data } ) => {
57- return {
58- data : prefixPluginTranslations ( data , pluginId ) ,
59- locale,
60- } ;
61- } )
62- . catch ( ( ) => {
63- return {
64- data : { } ,
65- locale,
66- } ;
67- } ) ;
52+ locales . map ( async ( locale ) => {
53+ try {
54+ // eslint-disable-next-line import/no-dynamic-require, global-require
55+ const data = require ( `./translations/${ locale } .json` ) ;
56+ return {
57+ data : prefixPluginTranslations ( data , pluginId ) ,
58+ locale,
59+ } ;
60+ } catch {
61+ return {
62+ data : { } ,
63+ locale,
64+ } ;
65+ }
6866 } ) ,
6967 ) ;
7068
You can’t perform that action at this time.
0 commit comments