This error pops up for ~20 seconds when I first open the application I have created through the Powerapps app on my mobile.
"MicrosoftTranslator.Translate failed: The Method 'Translate' has an invalid value for parameter 'languageTo'"
The error only shows right when the app is opened. I do not have any issues with anything being translated, and there are no issues when in Dev mode. There is no error in the App Checker.
I have a combobox where the default value is English but the user can choose any of the languages provides though the MicrosoftTranslate connector. My formula on the items being translated is:
If(
lang.Code = "en",
[Translate Text Goes Here],
MicrosoftTranslator.Translate(
[Translate Text Goes Here],
lang.Code
)
)
I am not sure why this error is showing when nothing seems to be wrong.
It seems to be related to this issue which never received a solution.
https://powerusers.microsoft.com/t5/Building-Power-Apps/The-method-Translate-has-an-invalid-value-fo...
Solved! Go to Solution.
Set the Combobox default (DefaultSelectedItems) to:
Filter(
allLanguages,
Name = "English"
)
Hi @tperry
What do you have on the "OnStart" property for your app? Is there any situation, where a call is made to the Translator when the app is opened?
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hi yashag2255!
I do not have anything in the OnStart, but I do have an OnVisible on the home page, that sets "English" as the default via a global variable.
I tried moving that to the OnStart section and it has not changed anything.
Example:
OnStart = Set(GV_Language, "English")
I guess I am not sure what kind of call needs to be made to the translator to initialize it?
Hi @tperry ,
Could you show me your formula about MicrosoftTranslator.Translate?
I've made a similar test , use "English" in this function will not work.
Please try this:
MicrosoftTranslator.Translate(text that you want to translate,"en")
Here's a doc about this connector for your reference:
https://docs.microsoft.com/en-us/connectors/microsofttranslator/#array-of-language
Best regards,
It's a conditional value based on the language the user is selecting in the dropdown.
If(dd_languages.Selected.Code="en","Text I want to translate",MicrosoftTranslator.Translate("Text I want to translate",dd_languages.Selected.Code))
Set the Combobox default (DefaultSelectedItems) to:
Filter(
allLanguages,
Name = "English"
)
User | Count |
---|---|
262 | |
110 | |
90 | |
54 | |
44 |