Domanda

I really need your help guys, as i already designed a website but after i designed and write all the texts i decide to make it global. Now i have two question: First: - How i can make my website with multiple languages should i rewrite the whole paragraphs and labels, etc.

  • The 2nd question that how i can the website shows the contents of each country, i mean i case if the user select the country U.S.A then the all the ads and items of U.S.A will appear. should i create many master pages and pages for each country of we can make the website shows the local items since the user choose his language or his country?

Many thanks

È stato utile?

Soluzione

Use Resource files for Localization - Create a resource file for each language.

When a page runs, ASP.NET selects the version of the resource file that most closely matches the current UICulture setting for the page. If there is no match, ASP.NET uses resource fallback to obtain a resource. For example, if you are running the Default.aspx page and the current UICulture property is set to es (Spanish), ASP.NET uses the compiled version of the local resource file Default.aspx.es.resx. ASP.NET can set the UICulture and Culture properties for the page to the language and culture values that are passed by the browser. Alternatively, you can set the UICulture and Culture properties explicitly, either declaratively or in code. You can also set the values declaratively in Web.config files.

For your second question, you can use Page.UICulture to identify the current language and present that relevant ads.

When the page is requested, the dynamically generated class sets the value of this property. In addition, you can also explicitly set the value of the UICulture property in the globalization element of the Web.config file.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top