0

I have default locale and /nl locale.

I am having an issue with ng build --prod --localize. it says:

Locale data for 'en-US' cannot be found. No locale data will be included for this locale.

But it continues to build, However in dist/myProject I have folder en-US and nl/

So I upload in the production server in htdocs folder all contents from en-US and nl folder

so my final production url is:

Loads default:

mydomain.com/    redirects to: mydomain.com/dashboard 

Loads nl locale:

mydomain.com/nl  redirect to:  mydomain.com/nl/dashboard 

When I load the first time both work fine but when I refresh the page on both cases it goes blank with 404 on the file: styles, runtime, polyfills, main which contains the en-US path on it.

I am not sure why as before with the previous version this wasn't an issue.

Any ideas why this is?

Ahsan Ali
  • 124
  • 8
Juliano
  • 141
  • 1
  • 11
  • I've seen that they now create folder inside root as en-US if you don't specify. Before they didn't create sub-folder for main language... – Miroslav Maksimovic Feb 13 '20 at 20:04
  • 1
    @MiroslavMaksimovic yes that's right. I not particularly enjoying this but I have now to run two separate commands to generate for production one for Root folder as in `/` and other for locale as in `nl` **E.G:** `ng build --prod` and upload to server then run `ng build --prod --localize` and then just upload the locale `nl` folder so now I have a redundant 'en-US' locale which I don't need, unless there is a more productive way which I don't know. – Juliano Feb 14 '20 at 08:56
  • I agree, that is pain now... @Juliano – Miroslav Maksimovic Feb 14 '20 at 10:11
  • do you have the property: ` "sourceLocale": "en-US", in your angular json under the i18n explicit defined? there it sould create all required files for the default locale. see [the official docs | https://angular.io/guide/i18n#merge-the-completed-translation-file-into-the-app] – wami May 11 '20 at 14:38

0 Answers0