- Issue created by @Shiraz Dindar
- Status changed to Needs work
over 1 year ago 3:56pm 10 April 2023 - heddn Nicaragua
+++ b/config/install/tmgmt.translator.microsoft.yml @@ -0,0 +1,16 @@ +settings:
These need a config schema as well.
There are a number of optional parameters that the Microsoft Translate API will accept, as documented at https://learn.microsoft.com/en-us/azure/cognitive-services/translator/re..., which the module currently ignores.
I needed to be able to set the Category parameter. But instead of just hard-patching that, I've provided here a patch that adds all* of those optional parameters as configurable options in the TMGMT Microsoft provider configuration form. The request to the API then includes these parameters in its call.
I've attached a screenshot of the updated provider form. The descriptions of the parameters are taken directly out of the documentation linked above, with some minor tweaks to avoid redundancy. The key field at the top is using the key patch I have posted separately in this issue queue, and has no bearing on this patch (you can apply it if you want or not -- I'm only mentioning it now to avoid confusion).
* not quite all fields are in the form. "From" is excluded because it is already being set and not something we would want to change. "Suggested from" is excluded because it will never be used as long as "From" is provided. Additionally worth mentioning is that "textType" was hardcoded in the dev release to "html", and in the stable release to "plain", as of this writing. Now I've included it as an option so it will use whatever is set in the form (defaults to "html").
Default values for these parameters are included with the install config. As such, there shouldn't be any regressions, though if you are applying this patch after already using the module, be sure to visit the provider page and save the settings.
Unlike some of my more recent contributions to this project in the form of patches, this one is definitely aimed at being committed as it should benefit others, with no drawbacks if you don't need the extra params.
Needs work
1.0
Code
+++ b/config/install/tmgmt.translator.microsoft.yml
@@ -0,0 +1,16 @@
+settings:
These need a config schema as well.