turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

Get API calls redirected - don't want to exclude #240

Closed scotthannen closed 8 years ago

scotthannen commented 8 years ago

https://site.com/api/blog is redirected to https://site.com/blog. It's identifying "api" is a language tag. I read 215 but I don't want to exclude the url from redirection. I want to localize the url - https://site.com/fr/api/blog.

scotthannen commented 8 years ago

I see - three letters is interpreted as a language tag. One fix would be to replace the use of "api" in the application.

turquoiseowl commented 8 years ago

Instead of localizing the api urls, have you considered using the Content-Language HTTP header to specify the language for api calls?

Otherwise, can you re-specify the question.

scotthannen commented 8 years ago

Hi,

I might do that. Right now it's just a POC. For testing purposes I modified it to disregard "api" as a language code. The easiest thing might be just to change our api routes. The package is great. We've got a massive task to localize a busy site, and so far it's covering all the bases.

Thanks On Dec 15, 2015 2:28 PM, "Martin Connell" notifications@github.com wrote:

Instead of localizing the api urls, have you considered using the Content-Language HTTP header to specify the language for api calls?

Otherwise, can you re-specify the question.

— Reply to this email directly or view it on GitHub https://github.com/turquoiseowl/i18n/issues/240#issuecomment-164865093.