Translate with many input options including dictation and spoken output
Translate is a very versatile translation shortcut. It accepts text selections, selections on Safari pages, from the clipboard, typed text, or text dictated in 3 pre-set languages (as distributed: English, Spanish, Indonesian). When dictated, user confirms/edits by default, or can it be set (in import/customize) to skip confirmation/edits.
User chooses origin and target languages in a menu, with pre-set languages given, and with additional choice to detect and choose any language. Translation copied to clipboard (by default). Then shown in an alert, with choice to speak the result in the target language.
I realize this is Yet-Another-Translator (YAT), and there are many other good ones, but none that could accept any type of input including dictation, copy results to clipboard, and properly speak the output. I also know that Microsoft translation isn't as good as Google, but it's faster. I am keeping a modified version of "Google Translate" by u/brechtbakker also for those more accurate translations without spoken output. If Apple fixes known bugs, I may implement (i.e. copy) the Google option as well.
This is still a work in progress, but one that cannot go much further until Apple fixes certain bugs in speech dictation with Shortcuts. (Shortcuts 2.1.1 fixed the Speak Text bug.) For that reason, if you want to configure other languages, the option is given to test these 3 functions, to find the appropriate menu choices. It will require some trial and error to configure for other languages. This is discussed here, and explained in the comments.
Credits: Almost completely rebuilt but drawn from a verision by u/SoulTaker981 called Translate Text 2.1 SFS, which itself is modified from an unknown chain.
Latest Release Notes
1.2 - Nov. 8, 2018, 9 a.m.
• No need anymore to hard-set spoken output languages, since Apple fixed this bug with Shortcuts 2.1.1
• For same reason, can now choose an output language if using detect any language
• Adjusted spoken output main settings accordingly
• Recommended to re-save prefs again than loading them for accurate spoken output
• Best results with Shortcuts 2.1.1+