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

Adding Norwegian to localization (Aspnet Core 2.1 + Angular 6) #6179


User avatar
0
larsfk created

Hi!

Im trying to add Norwegian to the application, but cant get it to work. This is what I have done:

Backend:

  • Added MentorApplication-nb-NO.xml with content
  • Added nb-NO to DefaultLanguagesCreator.cs new ApplicationLanguage(tenantId, "nb-NO", "Norsk", "famfamfam-flags no")

Frontend:

  • Edited LocalizedResourcesHelper with the following:
    • mapCultureForTimeago to support 'nb-NO': 'no'

When logging in I get the following error in console:

ERROR Error: Cannot find module './nb-NO.js'
    at .*\.js$ namespace object:4199
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:3825)
    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:3816)
    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)
    

zone.js:665 Unhandled Promise rejection: Cannot find module './nb-NO.js' ; Zone: <root> ; Task: Promise.then ; Value: Error: Cannot find module './nb-NO.js'
    at .*\.js$ namespace object:4199
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:3825)
    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:3816)
    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) Error: Cannot find module './nb-NO.js'
    at http://localhost:4200/main.js:4208:12
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:4200/polyfills.js:7141:26)
    at Object.onInvoke (http://localhost:4200/vendor.js:42573:33)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:4200/polyfills.js:7140:32)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:4200/polyfills.js:6891:43)
    at http://localhost:4200/polyfills.js:7625:34
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:7174:31)
    at Object.onInvokeTask (http://localhost:4200/vendor.js:42564:33)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:7173:36)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (http://localhost:4200/polyfills.js:6941:47)

Hope you have some advise, thanks! :)


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @larsfk

    It seems like Angular doesn't contain "nb-NO" culture. So, you can add a locale mapping here for Angular.

    {
      "from": "nb-NO",
      "to": "nb"
    }
    

    or

    {
      "from": "nb-NO",
      "to": "nb-SJ"
    }
    

    You also need to do the same for ngx-bootstrap here

    ngx-bootstrap only supports "nb" culture.