4
I asked that same question in the English version but I was unsuccessful!
I have an application that will be translated into three languages en/en/es. Until then I’ll use Globalresources, I have no problems with it, but I’m having a lot of difficulties when trying to write a url with the following appearance:
Eu tenho isso => http://www.teste.com.br/algumacoisa
Mas preciso disso => http://www.teste.com.br/pt/algumacoisa
I know it sounds simple, but I couldn’t work with that url. I can even put everything I tried here, but I don’t know if it will help, if you need send in the comments I change the question.
ps: the urls are in the app’s web.config. And I’m in Web Forms
UPDATE 1
<rewrite>
<rules>
<!-- Produtos -->
<rule name="produtos">
<match url="^produtos/([0-9]+)/([a-zA-Z0-9_-]+)/?$" ignoreCase="true"/>
<action type="Rewrite" url="/produtos/Detail.aspx?id={R:1}" appendQueryString="false"/>
</rule>
<!-- /Produtos -->
</rules>
</rewrite>
In ASP.NET, language determination is not done, in general, in the URL, but in web.config, or it is detected automatically by the browser. For example, your website would always have the http://www.teste.com.br/algumacoisa language independent URL. If it were pt or en, the URL would remain the same. What would be different would be the configuration on web.config. To achieve this, you use the internationalization mechanism of .NET. If you still want to generate Urls with the language, then you will need to use rewrite URL: http://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net
– EduardoFernandes
Is the idea would be to recover this pt/en and such, through query string as I do in other url’s, which I posted for example there...
– Bruno Casali
Why not use the internationalisation mechanism of ASP.NET?
– EduardoFernandes
@Eduardofernandes you’re saying about Globalresources ?
– Bruno Casali
You can also use local Resources. See the following link with an interesting explanation: http://www.codeproject.com/Articles/334820/Using-Globalization-and-Localization-in-ASP-NET
– EduardoFernandes