0

I need to get the current display language of a web via Client Object Model (C#) from a provider-hosted App. The app runs inside a Client Web Part (IFrame). I am aware of this solution but think it is not applicable to my situation, as the App does not contain the necessary JavaScript libraries.

I already have a client context. How could I get the display language?

Edit: The discussion over here also reflects my problem pretty well.

Heinrich Ulbricht
  • 1,929
  • 24
  • 50
  • On SharePoint hosted app you have a query string parameter called SPLanguage, maybee this is available also in provider hosted apps? – Robert Lindgren Apr 24 '13 at 12:09
  • @RobertLindgren Yes it is available. But it doesn't correctly reflect the current display language. So either its meaning is something else (default language maybe?) or it's a bug. – Heinrich Ulbricht Apr 24 '13 at 14:09
  • Might be, or it is the server language. Just spotted it and wanted to give you a heads up :) – Robert Lindgren Apr 24 '13 at 14:36
  • It seems to reflect the regional settings of the site collection, see the discussion here: http://social.msdn.microsoft.com/Forums/en-US/appsforsharepoint/thread/a40c3c1b-e32e-4066-a7f2-8e0090231bd5 - so no luck :-/ – Heinrich Ulbricht Apr 24 '13 at 16:32

2 Answers2

1

The parameters refered to in the link is rendered by SharePoint it self by default, hence your app should not need to reference any specific js libraries to be able to use them.

But I do understand if you do not want to be reliant on outside javascript libraries.

Robert Lindgren
  • 24,520
  • 12
  • 53
  • 79
0

this is global js object in sharepoint page that return language id. 1033 for: en-US

_spPageContextInfo.currentLanguage

this returns the actual string "en-US":

_spPageContextInfo.currentUICultureName