1

Is there an easy way to get current culture in Umbraco back end for a node? Right now I have to send $scope.editorState.current.id to my back end, run this C# metod ApplicationContext.Services.ContentService.GetById(editorStateId).GetCulture().TwoLetterISOLanguageName; and then use the value. Seems overkill if I can get the culture in front end right away.

http://umbraco.github.io/Belle/#/api/umbraco.services.editorState

Ogglas
  • 62,132
  • 37
  • 328
  • 418

1 Answers1

0

You can use the userService to retrieve info about the current logged in Umbraco use which includes their local:

userService.getCurrentUser().then(function(user) {
    console.log(user.locale);
});
Anth12
  • 1,869
  • 2
  • 20
  • 39
  • I'm pretty sure it's "locale", not "local"? – Jannik Anker Feb 25 '16 at 17:04
  • It is, yes. Updated. – Anth12 Feb 25 '16 at 22:16
  • Thank you but this is not what I'm looking for exactly. I need to get the culture language of the item I'm currently on/editing. For example your code returned `en-GB` for my user but my above code returns `sv`, `sv-SE`, for a specific item. – Ogglas Feb 26 '16 at 07:22