0

I am using asp.net and I have implemented localization in a website where the users can switch between english and french, where english is the default language, I've added shareThis plugin in the pages, the issue is if a user switched to french and then shared the page on facebook or for example sent the page url in a mail to a friend to see, the page will open in english and not french, I know this is logic but the problem is the client wants the shared page to be in the language the user chose, meaning if am sharing the page in french then people will see it in french too.

Is there a solution for this issue?

Thanks in advance

Yasmine
  • 1,959
  • 5
  • 21
  • 37
  • You could implement something like this http://stackoverflow.com/questions/1633980/asp-net-mvc-when-to-set-thread-currentthread-currentuiculture to set the "default" based on the incoming request - that way everyone should get the content based on their own settings not a predefined "default" set by the system. – Luke Baughan Oct 18 '12 at 10:54

1 Answers1

0

This is where it's useful to use a URL scheme for localizing your web app. Instead of relying on session state, your web app can set the CurrentUICulture based on the request URL and your language switch can work by performing a redirect (e.g. to www.yourapp/fr for French). This way, when your French user shares the page, they'll be sharing www.yourapp/fr which always displays in French.

Clafou
  • 15,250
  • 7
  • 58
  • 89
  • Sorry, could you please tell me what do you mean by URL scheme? – Yasmine Oct 19 '12 at 12:42
  • By "URL scheme" I meant using your URLs to specify which language to use (www.youapp.com/xx/yourpage where xx is a language code) – Clafou Oct 20 '12 at 18:12