Serving localized versions with @angular/localize

263 Views Asked by At

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.

0

There are 0 best solutions below