ShareShortcuts

The “Translator”

aster
„The “Translator”“ forken

Hast du auf Basis dieses Kurzbefehls etwas Neues erstellt? Teile ihn als Fork: Er wird zu deinem eigenen Kurzbefehl, den du selbst verwaltest, und beide Seiten verlinken aufeinander, damit aster die Anerkennung erhält.

  1. 1Lade den Kurzbefehl und ändere ihn in der Kurzbefehle-App. Gib ihm einen eigenen Namen.
  2. 2Teile ihn in der Kurzbefehle-App und kopiere den iCloud-Link.
  3. 3Komm hierher zurück, füge den Link ein und beschreibe, was sich geändert hat, z. B. „Einen Schritt hinzugefügt, der Apple Intelligence nutzt, um den Text zu personalisieren.“
Downloads
23K
Gesichert
1
Aktionen
65
Kategorie
Productivity
Version
1.0
Sprache
EN

A translator, ofcourse, but with some special abilities like super fast and doesn’t need to tap many times, just one time. also it will translate to 2 another language, but just look based on your purpose.

Please read the comment on top of shortcut code for more info

Neue Funktionen

Version 1.0

First release

Versionsverlauf
1.0 5. Jul 2024

First release

Was er macht

65 Aktionen
  1. Comment
    ###How to look: hard to explain but the basic language is japanese, english, spanish in this, so: if you type in english, output is japanese and spanish if you type in japanese, output is english and spanish if you type in spanish, output is english…
  2. If
  3. Text
  4. If
  5. Ask for Input
    translate
  6. If
  7. If
  8. Extract Text from Image
  9. If
  10. Choose from Menu
    no input
  11. Choose from Menu
    take photo
  12. Take Photo
  13. Choose from Menu
    choose
  14. Select Photos
  15. Extract Text from Image
  16. If
  17. Get Variable
  18. Set Variable
    input
  19. If
  20. Open App
  21. Stop This Shortcut
  22. Detect Language
  23. Set Variable
    detects
  24. If
  25. Translate Text
  26. Set Variable
    jpen
  27. Translate Text
  28. Set Variable
    spen
  29. Text
  30. If
  31. If
  32. Translate Text
  33. Set Variable
    ensp
  34. Translate Text
  35. Set Variable
    jpsp
  36. Text
  37. If
  38. If
  39. Translate Text
  40. Set Variable
    enjp
  41. Translate Text
  42. Set Variable
    spjp
  43. Text
  44. If
  45. Translate Text
  46. Set Variable
    enot
  47. Translate Text
  48. Set Variable
    jpot
  49. Translate Text
  50. Set Variable
    spot
  51. Text
  52. Count
  53. If
  54. Show Result
  55. Text
  56. If
  57. Get Variable
  58. Choose from Menu
    …
  59. Choose from Menu
    copy
  60. Split Text
  61. Choose from List
  62. Copy to Clipboard
  63. Choose from Menu
    more
  64. Run Shortcut
    F/D trans C
  65. Choose from Menu
    done

Als Code ansehen
Beta

Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.

#include 'actions/translation'
#include 'actions/photos'
#include 'actions/media'
#include 'actions/images'
#define color orange
#define glyph network

/*
###How to look:
hard to explain but the basic language is japanese, english, spanish in this, so:
if you type in english, output is japanese and spanish
if you type in japanese, output is english and spanish
if you type in spanish, output is english and japanese

###How to change 3 basic language:
you will change the variable that have a comment on top of it which says “basic language”. so if you want to change japanese, check the basic language comment with japanese (basic language: japanese)

tho it’s hard to change if you are not a super well “shortcutter”

###All of the hidden specialities:
-translate directly from picture : run from share sheet to get here directly, or type nothing to add picture
-if doesn’t look well in this, go to google translate with typing “t”
    though, I don’t use much ^
*/

const IfResult = if ShortcutInput {
} else {
	prompt("translate")
}

const MenuResult = if !IfResult {
	if ShortcutInput {
		extractImageText(ShortcutInput)
	} else {
		menu "no input" {
		item "take photo":
			takePhoto(1, true)
		item "choose":
			selectPhotos()
		}
		extractImageText(MenuResult)
	}
} else {
	// TODO: Get Variable not supported: Assign variable here to 'IfResult'.
}
@input

if @input == "t" {
	openApp("com.google.Translate")
	stop()
}
detectLanguage(@input)
@detects

if @detects contains "English" {
	translate(@input, "ja_JP")
	@jpen
	translate(@input, "es_ES")
	@spen
} else {
	if @detects contains "Spanish" {
		translate(@input, "")
		@ensp
		translate(@input, "ja_JP")
		@jpsp
	} else {
		if @detects contains "Japanese" {
			translate(@input, "en_US", "Detect Language")
			@enjp
			translate(@input, "es_ES")
			@spjp
		} else {
			translate(@input, "en_US")
			@enot
			translate(@input, "ja_JP")
			@jpot
			translate(@input, "es_ES")
			@spot
		}
	}
}
const Count = count(IfResult1, "Lines")

if Count > 10 {
	show(IfResult1)
} else {
	// TODO: Get Variable not supported: Assign variable here to 'IfResult1'.
}

menu  {
item "copy":
	const SplitText = splitText(IfResult1)
	const ChosenItem = chooseFromList(SplitText, "what to copy?", false)
	setClipboard(ChosenItem)
item "more":
	runSelf()
item "done":
}
In Cherri Playground öffnen Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.

Bewertungen und Rezensionen

Rezension schreiben
–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Werbung

Mehr von aster

Alle anzeigen

Das gefällt dir vielleicht auch

Alle anzeigen
Werbung