-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DCR] Make Language Policy configurable in Adaptive #3553
Comments
@tomlm will look at this and mark |
@vishwacsena, @tomlm, this is a P0 bug that's not moved forward in 26 days. How can we push this forward? |
I like to consider an update to the DCR. Some context: Today the language policy looks like this:
When the locale on the input matches key "en-US" for resource "foo", the progression will be: In multi-lingual first authoring environment, we're not generating non-locale resource files--there is always a language serialized into the filename. Additionally, some channels like facebook messenger don't always provide the locale with the input, so a fallback is necessary. This is called out as a blocker from the Skills team, and I believe we've heard from the community that this is breaking some bots on facebook messenger. I suggest a modified proposal: Accept a language policy extension that will support and allow users to define the behavior of an empty input locale resolution. What this would look like: language policy:
bot injected language policy:
the complete language policy will be:
The resource progression for The resource progression for |
I like the update to this @cwhitten, this would make it easier to configure a customized policy. most of time, people just override the entry of "". Also link to issues blocked by this: And any facebook related issues will be blocked by this, because FB is not sending locale |
I like this. @cwhitten am I correct in understanding this?
|
@boydc2014 can this be marked as closed via #3624 ? |
Scenario
In composer (as well as in VA) scenario, to support a multi-language experience, we create lg file for dialog per locale. For example, we will have main.en-us.lg and main.fr-fr.lg if en-us and fr-fr is the locale to support.
And assume the user want en-us to be default locale that bot serves. So
Expected VS actual behavior
The expected behavior for this design, is if the incoming locale is fr-fr, then use fr-fr.lg, otherwise use en-us.lg, but actually when incoming locale is not en-us or fr-fr, or the incoming locale is empty, the bot will failed to locate a lg file.
So, given main.en-us.lg and main.fr-fr.lg
Cause
The root cause of this behavior is that the built-in language fallback policy don't work in this scenario, the default behavior is when incoming locale is en-us, the searching order of lg file is "en-us" -> "en" -> "".
to be specific, in main.dialog case,
Since there is no main.lg, it fails eventually. And it don't make sense for composer to generate a main.lg and use as default, because user may switch default language, have a flexible configuration would be better to allow the behavior to be flexible without any extra content manipulation.
this language policy, at it's core is a string => list dictionary that driving the actually behavior like this:
{
"en-us": ["en-us", "en", ""],
"fr-fr": ["fr-fr", "fr", ""],
"“, [""]
}
Solution
So, a simpler solution to fit composer's scenario (and other scenarios i can think of), is to have this language policy configurable. In this specific case, let the dict to be
{
"en-us": ["en-us"],
"fr-fr": ["fr-fr", "en-us"],
"": ["en-us"]
}
Will solve the problem.
The proposal here, is have this language policy configurable by include it into schema and been loadable from dialog file.
Other considerations
This language policy is now only a property in Generator itself, we may consider to put root dialog's language policy into turnContext and shared as default if other dialog is not configured with a customized language policy.
The text was updated successfully, but these errors were encountered: