-
SummaryI included internationalization to my angular project, now when I run the ng build --localize command I have 2 folders inside the dist folder, but when I try to navigate to the /en path for the english language the browser throws a mime type error. For example it's trying to search the main.ts file in the https://example instead of the https://example/es url I tried adding this rewrite to the vercel.json but that didn't work Examplehttps://github.com/BaloJr99/InvitesCard/tree/incluiding-i18n Steps to ReproduceThis error happens when I try to navigate to https://invites-card-fkvf-git-incluiding-i18n-balojr99s-projects.vercel.app/es url |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Finally I was able to fix the issue, I used redirect for changing the main path depending of the user preferred language, then I used rewrite to redirect any request to the depending language dist file, maybe this is usefull for some people but when I tried to reload any page there was a 404 Not Found, so I used the (.) regex in the rewrite source request |
Beta Was this translation helpful? Give feedback.
Finally I was able to fix the issue, I used redirect for changing the main path depending of the user preferred language, then I used rewrite to redirect any request to the depending language dist file, maybe this is usefull for some people but when I tried to reload any page there was a 404 Not Found, so I used the (.) regex in the rewrite source request
{
"redirects": [
{
"source": "/",
"has": [
{
"type": "header",
"key": "Accept-Language",
"value": "(^en.$)"
}
],
"destination": "/en"
},
{
"source": "/",
"has": [
{
"type": "header",
"key": "Accept-Language",
"value": "(^(?!^en).$)"
}
],
"destination": "/es"
}
],
"rewrites": [
{
"source": "/en/(.)",
"has": [
{
"type": "header",
"key": "A…