简体   繁体   English

Azure AD B2C自定义HTML元素的翻译

[英]Azure AD B2C translation of custom HTML elements

I'm using Azure AD B2C custom UI and I'm wondering if it is possible to use the translation of own HTML elements 我正在使用Azure AD B2C自定义UI,我想知道是否可以使用自己的HTML元素的翻译

Here is an example: 这是一个例子:

<hr />
<h3 class="text-center" id="Custom1SignUpNewAccountMessage>Sign up with a new account</h3>
<div id="api" data-name="SelfAsserted">
</div>

I can see the text " Sign up with a new account ". 我可以看到“ 使用新帐户注册 ”文字。 Now I would like to translate it for different languages because at the moment it is fixed. 现在我想将它翻译成不同的语言,因为目前它已被修复。

I used the JSON from DefaultLocalizedResources. 我使用了DefaultLocalizedResources中的JSON。

"LocalizedStrings": [
{
   "ElementType": "UxElement",
   "ElementId": null,
   "StringId": "Custom1SignUpNewAccountMessage",
   "Override": true,
   "Value": "Hier neuen Acount registrieren!!!"
 },

Unfortunately, Custom1SignUpNewAccountMessage is not a valid element. 不幸的是, Custom1SignUpNewAccountMessage不是有效的元素。

Is it possible to do translation "outside" <div id="api" ...> ? 是否可以翻译“外部” <div id="api" ...>

The B2C multi-language string overrides are only for the translation of strings that are rendered by B2C. B2C多语言字符串覆盖仅用于转换由B2C呈现的字符串。 That's the feature's primary purpose because otherwise there is no easy way for developers to translate these strings as they do not have direct control over them. 这是该功能的主要用途,因为否则开发人员没有简单的方法来翻译这些字符串,因为他们无法直接控制这些字符串。

B2C does not provide a framework for translation of strings not rendered by it. B2C没有提供翻译未由其呈现的字符串的框架。 That will need to be handled by the application, and typically there are existing developer frameworks that can be used by developers depending on the platform of their choice. 这将需要由应用程序处理,并且通常存在开发人员框架,开发人员可以根据他们选择的平台使用这些框架。

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

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