我们正在尝试构建一个支持英语(en-us)和德语(de-de)的多语言聊天机器人。我们曾在Microsoft Teams上使用它,没有任何问题,直到2020年6月中旬左右。此后,我们注意到本地化不再正常工作。我们还注意到这是Teams引入清单版本1.7的时间。出现了以下情况:
如果Teams管理员上传应用程序时其MS Teams客户端语言为en-us,则所有自定义应用程序都会忽略“de-de”本地化信息,并且所有信息以及命令都仅显示为英语,即使用户的客户端语言为德语。
如果管理员的语言为de-de,上传应用程序,则机器人的所有信息将为德语,而默认语言(英语)将被忽略。
这是一个示例截图。
在这里,您可以看到尽管客户端语言是德语,建议命令仍然以英语显示。实际上,机器人名称和描述也是英文的。事实上,我们观察到微软官方模板的官方清单也表现出相同的行为。
以下是我们的清单文件: manifest.json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json",
"manifestVersion": "1.7",
"version": "1.0.0",
"id": "00000000-0000-0000-0000-00000000000",
"packageName": "com.sample.sample.sample.dev.bot3",
"developer": {
"name": "Sample Inc.",
"websiteUrl": "https:/sample.z6.web.core.windows.net",
"privacyUrl": "https://sample.z6.web.core.windows.net/privacy.html",
"termsOfUseUrl": "https://sample.z6.web.core.windows.net/tou.html"
},
"localizationInfo": {
"defaultLanguageTag": "en-us",
"additionalLanguages": [
{
"languageTag": "de-de",
"file": "de-de.json"
}
]
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Manifest Test EN",
"full": "Manifest Test EN Bot"
},
"description": {
"short": "Manifest Test EN",
"full": "Manifest Test EN Bot"
},
"accentColor": "#40497E",
"bots": [
{
"botId": "00000000-0000-0000-0000-00000000000",
"scopes": [
"personal"
],
"supportsFiles": true,
"isNotificationOnly": false,
"commandLists": [
{
"scopes": [
"personal"
],
"commands": [
{
"title": "Personal Command 1",
"description": "Description of Personal Command 1"
},
{
"title": "Personal Command N",
"description": "Description of Personal Command N"
}
]
}
]
}
],
"staticTabs": [
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"sample.z6.web.core.windows.net",
"token.botframework.com"
]
}
本地化文件 de-de.json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.Localization.schema.json",
"name.short": "Manifest Test DE",
"name.full": "Manifest Test DE Bot",
"description.short": "Manifest Test DE",
"description.full": "Manifest Test DE Bot",
"bots[0].commandLists[0].commands[0].title": "Persönlicher Befehl 1",
"bots[0].commandLists[0].commands[0].description": "Beschreibung des persönlichen Befehls 1",
"bots[0].commandLists[0].commands[1].title": "Beschreibung des persönlichen Befehls N",
"bots[0].commandLists[0].commands[1].description": "Das ist DE1"
}