Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production issue with ar-SA-u-nu-latn #75

Open
nikoskalogridis opened this issue Oct 18, 2017 · 0 comments
Open

Production issue with ar-SA-u-nu-latn #75

nikoskalogridis opened this issue Oct 18, 2017 · 0 comments

Comments

@nikoskalogridis
Copy link

using an ar-SA locale but with the u-nu-latn customization with the following config:

...
new GlobalizePlugin({
      production: true,
      developmentLocale: 'el',
      supportedLocales: ['ar-SA', 'en', 'de', 'fr', 'el'],
      output: '/i18n/[locale].js'
    }),
...

then the following code has issues:

Globalize.locale('ar-SA-u-nu-latn');
_formatDateShort = Globalize.dateFormatter({skeleton: 'yMd'}); // this becomes undefined
_formatDateFull = Globalize.dateFormatter({date: 'full'}); // this becomes undefined
_formatDateWithDay = Globalize.dateFormatter({skeleton: 'yMEd'}); // this becomes undefined
_formatMinTextDay = Globalize.dateFormatter({skeleton: 'E'}); // this becomes undefined
_format12Hour = Globalize.dateFormatter({skeleton: 'hm'}); // this becomes undefined
_format24Hour = Globalize.dateFormatter({skeleton: 'Hm'}); // this becomes undefined
_formatTimePeriod = Globalize.dateFormatter({raw: 's'}); // this becomes undefined
_formatMonthDayPeriod = Globalize.dateFormatter({skeleton: 'MMMEd'}); // this becomes undefined
_formatDateMonth = Globalize.dateFormatter({skeleton: 'Md'}); // this becomes undefined
_formatDayDateMonth = Globalize.dateFormatter({skeleton: 'MEd'}); // this becomes undefined
_formatDay24Hour = Globalize.dateFormatter({skeleton: 'EHm'}); // this becomes undefined
_formatDateDate = Globalize.dateFormatter({skeleton: 'd'}); // this becomes undefined
_formatDateMonthYear = Globalize.dateFormatter({skeleton: 'yMMM'}); // this becomes undefined

I have tried to include in the webpack plugin supportedLocales the 'ar-SA-u-nu-latn' but then the build fails with:

Error: Cannot find module './main/ar-SA-u-nu-latn/ca-gregorian'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at cldrData (/home/user/projects/frontline/node_modules/cldr-data/index.js:55:10)
    at /home/user/projects/frontline/node_modules/globalize-webpack-plugin/util.js:19:14
    at Array.map (native)
    at cldr (/home/user/projects/frontline/node_modules/globalize-webpack-plugin/util.js:18:59)
    at Object.compileExtracts (/home/user/projects/frontline/node_modules/globalize-compiler/lib/compile-extracts.js:55:18)
    at GlobalizeCompilerHelper.compile (/home/user/projects/frontline/node_modules/globalize-webpack-plugin/GlobalizeCompilerHelper.js:63:33)
    at /home/user/projects/frontline/node_modules/globalize-webpack-plugin/ProductionModePlugin.js:235:51
    at RegExp.[Symbol.replace] (native)
    at RegExp.[Symbol.replace] (native)
    at String.replace (native)
    at /home/user/projects/frontline/node_modules/globalize-webpack-plugin/ProductionModePlugin.js:229:58
    at Array.forEach (native)
    at /home/user/projects/frontline/node_modules/globalize-webpack-plugin/ProductionModePlugin.js:227:63
    at Array.forEach (native)
    at Compilation.<anonymous> (/home/user/projects/frontline/node_modules/globalize-webpack-plugin/ProductionModePlugin.js:225:10)
    at Compilation.applyPlugins (/home/user/projects/frontline/node_modules/tapable/lib/Tapable.js:26:37)
    at Compilation.<anonymous> (/home/user/projects/frontline/node_modules/webpack/lib/Compilation.js:558:8)
    at Compilation.next (/home/user/projects/frontline/node_modules/tapable/lib/Tapable.js:67:11)
    at ExtractTextPlugin.<anonymous> (/home/user/projects/frontline/node_modules/extract-text-webpack-plugin/index.js:285:5)
    at /home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:52:16
    at done (/home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:246:17)
    at /home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:44:16
    at /home/user/projects/frontline/node_modules/extract-text-webpack-plugin/index.js:269:6
    at /home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:52:16
    at done (/home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:246:17)
    at /home/user/projects/frontline/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:44:16

how can I support 'ar_SA-u-nu-latn' in production mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant