How to use APP_BASE_HREF with @angular/localize

166 Views Asked by At

I am setting up @angular/localize for my application but I do not understand how to use both APP_BASE_HREF and @angular/localize. I am using this in my app.module.ts to set up APP_BASE_HREF.

  providers: [
{ provide: APP_BASE_HREF, useValue: '/database' },  
             ],

In my angular.json, I have set up the locales like this

      "locales": {
      "ar": {
        "translation": "src/assets/locale/messages.ar.xlf",
        "baseHref": "/ar/"
      },
      "cs": {
        "translation": "src/assets/locale/messages.cs.xlf",
        "baseHref": "/cs/"
      },
                 }

Now angular sets the route as www.my-domain/ar or www.my-domain/cs whereas I want it to be www.my-domain/database/ar. Is there a way to achieve this?

0

There are 0 best solutions below