Closed mdmoura closed 7 years ago
I have the following route:
public class CampaignController : Controller { [HttpGet("{name}")] public async Task<IActionResult> Show(String name) { } }
So the URL is something like: /some-campaign-name
This URL should return Page Not Found and I would like to force the culture into the URL so:
/en/campaign/some-campaign-name or /pt/campanha/some-campaign-name
I used the following:
.AddRouteLocalization(x => { x.UseCulture("en") .WhereController(nameof(CampaignController)) .WhereAction(nameof(CampaignController.Show)) .TranslateAction("campaign/{name}"); x.UseCulture("pt") .WhereController(nameof(CampaignController)) .WhereAction(nameof(CampaignController.Show)) .TranslateAction("campanha/{name}") .RemoveOriginalRoutes();
I am able to access
/en/campaign/some-campaign-name (Expected)
But not able to access
/some-campaign-name (Expected) /pt/campanha/some-campaign-name (NOT EXPECTED)
Why is the Protuguese version not working? Any idea?
The problem was in my code ... Solved
I have the following route:
So the URL is something like: /some-campaign-name
This URL should return Page Not Found and I would like to force the culture into the URL so:
I used the following:
I am able to access
But not able to access
Why is the Protuguese version not working? Any idea?