Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Cannot add language in ASPNET Zero #6456


User avatar
0
omkarchoudhari created

I am trying to add Malay language in ASPNetZero framework, but framework gives an error that says cannot find module ./ms.js.

Following are the steps I have followed so far:

  1. Added a XML file for Malay language
  2. Added a new language in the DefaultLanguageCreator class
  3. Selected my language from the menu bar.

For detail error see below:

core.js:14597 ERROR Error: Uncaught (in promise): Error: Cannot find module './ms.js' Error: Cannot find module './ms.js' at .*.js$ namespace object:179 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (core.js:16156) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138) at zone.js:872 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:16147) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:16147) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595) defaultErrorLogger @ core.js:14597 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:14645 next @ core.js:16628 schedulerFn @ core.js:12609 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ Subject.js:47 push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit @ core.js:12593 (anonymous) @ core.js:16178 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 push../node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:138 push../node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular @ core.js:16115 onHandleError @ core.js:16178 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.handleError @ zone.js:392 push../node_modules/zone.js/dist/zone.js.Zone.runGuarded @ zone.js:154 _loop_1 @ zone.js:677 api.microtaskDrainDone @ zone.js:686 drainMicroTaskQueue @ zone.js:602 Promise.then (async) scheduleMicroTask @ zone.js:578 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:410 onScheduleTask @ zone.js:297 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:401 push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:232 push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask @ zone.js:252 scheduleResolveOrReject @ zone.js:862 resolvePromise @ zone.js:808 (anonymous) @ zone.js:724 webpackJsonpCallback @ bootstrap:25 (anonymous) @ 892.js:1

Any help in this regard would be appreciated. Thanks


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    I guess ngx-bootstrap has no localization information for Malay. You can add a locale mapping here.

    https://github.com/aspnetzero/aspnet-zero-core/blob/10c44fb88b5946d2864cede85253b146cfdbdd54/angular/src/assets/ngx-bootstrap/ngx-bootstrap-locale-mapping.service.ts

  • User Avatar
    0
    omkarchoudhari created

    I tried entering Malay language in NgxBootstrapLocaleMappingService like-

    export class NgxBootstrapLocaleMappingService { map(locale: string): string { const cultureMap = { 'en': 'en-gb',

    'ms': 'ms',
    'MY-ms': 'ms'
    getModuleName(locale: string): string {
        const moduleNameMap = {
            'en': 'enGb',
    

    'ms': 'ms',

    'MY-ms': 'ms'

    But still it is giving me the same error- Could not find module ‘./ms.js’. Here is the detail error-

    core.js:14597 ERROR Error: Uncaught (in promise): Error: Cannot find module './ms.js' Error: Cannot find module './ms.js' at .*.js$ namespace object:179 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) at Object.onInvoke (core.js:16156) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138) at zone.js:872 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:16147) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:16147) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595) defaultErrorLogger @ core.js:14597 push../node_modules/@angular/core/fesm5/core.js.ErrorHandler.handleError @ core.js:14645 next @ core.js:16628 schedulerFn @ core.js:12609 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub @ Subscriber.js:196 push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next @ Subscriber.js:134 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ Subscriber.js:77 push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:54 push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ Subject.js:47 push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit @ core.js:12593 (anonymous) @ core.js:16178 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 push../node_modules/zone.js/dist/zone.js.Zone.run @ zone.js:138 push../node_modules/@angular/core/fesm5/core.js.NgZone.runOutsideAngular @ core.js:16115 onHandleError @ core.js:16178 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.handleError @ zone.js:392 push../node_modules/zone.js/dist/zone.js.Zone.runGuarded @ zone.js:154 _loop_1 @ zone.js:677 api.microtaskDrainDone @ zone.js:686 drainMicroTaskQueue @ zone.js:602 Promise.then (async) scheduleMicroTask @ zone.js:578 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:410 onScheduleTask @ zone.js:297 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:401 push../node_modules/zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:232 push../node_modules/zone.js/dist/zone.js.Zone.scheduleMicroTask @ zone.js:252 scheduleResolveOrReject @ zone.js:862 resolvePromise @ zone.js:808 (anonymous) @ zone.js:724 webpackJsonpCallback @ bootstrap:25 (anonymous) @ 892.js:1

    Not sure how to go ahead. Can you please help ?

  • User Avatar
    0
    ismcagdas created
    Support Team