Last post Feb 16, 2021 08:24 AM by yij sun
Feb 13, 2021 02:45 PM|sajjadzare|LINK
I use App_GlobalResources with two languages en(English) and tr (Turkish), when I use like below it's OK:
<label><%= Resources.Resource.Login %></label>
But like below line it isn't OK and doesn't work (means for example language is tr but show English text):
<asp:Button ID="BtnLogin" runat="server" Text="<%$ Resources:Resource, Login %>"/>
Feb 13, 2021 10:35 PM|SurferOnWww|LINK
did you set the Culture and UICulture to "auto"?
Feb 14, 2021 06:34 AM|sajjadzare|LINK
I tried both : without set to "auto" and with
<globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto" />
Feb 16, 2021 01:13 AM|SurferOnWww|LINK
Sorry, I cannot help since it seems to me that everything is OK as far as the code and description shown in your posts are concerned. I guess that something not mentioned in your posts is causing the issue. But I cannot see it because it is not shown.
Feb 16, 2021 08:24 AM|yij sun|LINK
According to your description,as far as I think,you could check if your operations are right.Just like this:
1.Create you need to add App_GlobalResources folder to your project.
2.After that, right-click on App_GlobalRrsources folder and select Resources File to create new files for additional languages. You can define the name for language files as the pattern “name.language-culture.resx”. In this demo I will define two files name
as chienvh.language.resx (English) and chienvh.language.vi-vn.resx (Vietnamese).
3.Open two resource files to define the name and value (notice leaving the names as a keys as the same in those files)
4.Create new a class file with the name as BasePage.
5.Create a new webpage with the name as Default.aspx, then open the code behind of this file and change inheritance from System.Web.UI.Page to BasePage.
More details,you could refer to below article: