https://jswebapp.com/product/ionic-6-school-managment-app/
On Wednesday, October 5, 2022 at 11:20:21 AM UTC+5:30 abmor...@gmail.com 
wrote:

> Hi everyone, 
>
> I am writing an i18n feature for my app, but for each supported language I 
> want to add a prefix to my url e.g.: 
> app.com/content (for english)
> app.com/fr/content (for french)
> app.com/it/content (for italian)
> and so on.
>
> I am using ngx-translate and it is fully working in my app, and I have 
> already tried using a provider for APP_BASE_HREF. ex:
>   {
>       provide: APP_BASE_HREF,
>       useFactory: () => {
>         const storedLang =  localStorage.getItem('cr-preferred-lang');
>         if (environment.supportedLanguages.includes(storedLang)) {
>           return storedLang === 'en' ? '/' : `/${storedLang}`;
>         } else {
>           localStorage.setItem('cr-preferred-lang', 'en');
>           return '/';
>         }
>       }
>     }
>
> But whenever I deploy this and try to access a page with the prefix on a 
> new tab it gets returned as error 500.
>
> I have been stuck on this for weeks now, and I am not sure how to handle 
> it.
>
> Any help would be great. Thanks :) 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/3eb37114-3d62-4b91-830c-0b95919df336n%40googlegroups.com.

Reply via email to