0

I am a bit confused about how i should set up my multilingual website using @angular/localize.

The angular docs mention this for deploying on a webserver: https://angular.io/guide/i18n-common-deploy

However, my type of hosting does not allow me to do any url rewriting based on http headers! I need a solution that is applicable using plain static file hosting.

So, what i want to achieve is:

  • the source en version of the site is hosted in the root folder
  • all other languages are hosted in their subfolder (/fr, /es, ...)

How do i set this up?

Currently, i kinda hacked my way around it by putting this in my build script line:

    "scripts": {
        ...
        "build": "ng build --configuration=production && cp dist/application/en-US/*.* dist/application",
    }

... but i would like to configure this properly without this hacky way of working.

Davy
  • 6,295
  • 5
  • 27
  • 38
  • I find the localization subsystem the single worst part of the Angular framework. I started using `ngx-translate` (https://github.com/ngx-translate/core) 5 years ago and, every time I look up how the development of @angular/localize is going, I always find it lacking. Sorry if it's not a proper answer, but this is just my 2c. – Alberto Chiesa Jun 28 '22 at 14:23
  • I like the fact that is precompiles the translations, it does make sense. Just to bad that configuring it is not very straight forward. If i can just have all translation in subfolders and the source version in the root, i would be happy. – Davy Jun 28 '22 at 14:27

0 Answers0