如何获取 ISO 翻译的 sitecore 语言环境值

How to obtain sitecore locale value for ISO translations

我在 Sitecore 中使用 angularJS,需要将本地化层添加到 Angular,因此需要从 Sitecore 获取当前 language/locale[=11 的变量=]

在我的 html 中,我需要访问以下类型的文件:例如 angular-en-gb.js 或 angular-de-de.js所以我希望将 Sitecore 的值连接到模式:

"path-to-js/angular-" + locale + ".js"

感谢您的帮助。

你应该使用 Sitecore.Context.Language

string filepath = "path-to-js/angular-" + Sitecore.Context.Language.Name + ".js";