Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Keep fallback language files #107

Closed
tlbonum opened this issue Mar 12, 2021 · 3 comments
Closed

Keep fallback language files #107

tlbonum opened this issue Mar 12, 2021 · 3 comments

Comments

@tlbonum
Copy link

tlbonum commented Mar 12, 2021

Hi, not sure what causes this, but some of our clients attempts to load the default/fallback(?) locale files, (the ones not suffixed by _.json, i.e. Legend.json instead of Legend_en.json). We are seeing the following error in our logs:

["[esri.widgets.Widget]","widget-intl:locale-error","esri.widgets.Legend",{"details":{"errors":"[Array]"},"message":"Errors occurred while loading \"esri/widgets/Legend/t9n/Legend\"","name":"intl:message-bundle-error"}]

This happens because the plugin ignores copying these files, if the "locales" option is used. Maybe this is intentional, and there's actually a way to force clients to use a specific locale?

The following patch keeps the files:

diff --git a/node_modules/@arcgis/webpack-plugin/lib/requiredPlugins.js b/node_modules/@arcgis/webpack-plugin/lib/requiredPlugins.js
index 428465d..eada295 100644
--- a/node_modules/@arcgis/webpack-plugin/lib/requiredPlugins.js
+++ b/node_modules/@arcgis/webpack-plugin/lib/requiredPlugins.js
@@ -48,7 +48,7 @@ module.exports = function requiredPlugins(locales = []) {
   }
 
   const localesIgnoreList = locales.map((locale) => `*_${locale}`).join("|");
-  const localesIgnoreGlob = `**/!(${localesIgnoreList}).json`;
+  const localesIgnoreGlob = `**/!(${localesIgnoreList}|!(*_*)).json`;
   const ignoreSass = "**/*.scss";
   return [
     // Copy non-packed resources needed by the app to the build directory

This issue body was partially generated by patch-package.

@odoe
Copy link
Collaborator

odoe commented Mar 12, 2021

I'll take a look at the copy script. It's probably missing the widget ones.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@andygup
Copy link
Member

andygup commented Jan 19, 2024

Closing issue in preparation for repo archiving.

@andygup andygup closed this as completed Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants