简体   繁体   English

Azure AD B2C 自定义策略语言翻译

[英]Azure AD B2C Custom policy language translation

I have declared a set of supported langauges in my custom policy.我在自定义策略中声明了一组受支持的语言。 But what happens is, Microsoft implicitly convert some text and messages to other languages eventhough when i haven't decalred that langugae to be supportred.但是发生的情况是,即使我没有标记要支持的语言,Microsoft 也会隐式地将某些文本和消息转换为其他语言。

(Eg) I haven't supported croatian language in my app, so when i pass croatian langauge in my query param, it should point to default language referred in the custom policy, Because croatian is in my unsupported langugaes list. (例如)我的应用程序不支持克罗地亚语,所以当我在查询参数中传递克罗地亚语时,它应该指向自定义策略中引用的默认语言,因为克罗地亚语在我不受支持的语言列表中。 what in reality some of the messages gets converted to croatian and shown in UI.实际上,有些消息会转换为克罗地亚语并显示在 UI 中。

It is true.是真的。 And Custom Policies out of the box supported language customization but support is limited to few fields/inputs/labels/messages.开箱即用的自定义策略支持语言自定义,但支持仅限于少数字段/输入/标签/消息。 If your application support multi language then you can add your own customization.如果您的应用程序支持多语言,那么您可以添加自己的自定义。

(Eg) I haven't supported croatian language in my app, so when i pass croatian langauge in my query param, it should point to default language referred in the custom policy, Because croatian is in my unsupported langugaes list. (例如)我的应用程序不支持克罗地亚语,所以当我在查询参数中传递克罗地亚语时,它应该指向自定义策略中引用的默认语言,因为克罗地亚语在我不受支持的语言列表中。 what in reality some of the messages gets converted to croatian and shown in UI.实际上,有些消息会转换为克罗地亚语并显示在 UI 中。

Update: Currently this is not possible and you need to limit supported languages from your application it self.更新:目前这是不可能的,您需要自己限制应用程序支持的语言。

Typical Multi Language Scenario for a web/ native application (may be a workaround): Web/本机应用程序的典型多语言场景(可能是一种解决方法):

  1. Web application show up the list of supported languages either in drop down or any user friendly way Web 应用程序以下拉或任何用户友好的方式显示支持的语言列表
  2. Application will capture the locale from the customer selected language and append to the request URL.应用程序将从客户选择的语言中捕获区域设置并附加到请求 URL。
  3. If that locale is valid at B2C side it will start displaying Ux in that language如果该语言环境在 B2C 端有效,它将开始以该语言显示 Ux

There is only 1% changes where customers can actually edit the Authorize URL to modify the locale.只有 1% 的更改让客户可以实际编辑授权 URL 以修改区域设置。 Your concern is still valid but based on above scenario itwill become less impact on your application.您的担忧仍然有效,但基于上述情况,它对您的应用程序的影响将变小。

If you would like to force the locale you can use the query string when requesting the B2C application.如果您想强制使用语言环境,您可以在请求 B2C 应用程序时使用查询字符串。

?ui_locales={en}

Where you would replace {en} with the locale you support for more info see the offical docs您将在哪里用您支持的语言环境替换{en}以获取更多信息,请参阅官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM