« Linux Traduction Rapide » : différence entre les versions
Aucun résumé des modifications |
|||
| Ligne 8 : | Ligne 8 : | ||
<syntaxhighlight lang="bash" line> | <syntaxhighlight lang="bash" line> | ||
#!/bin/bash | #!/bin/bash | ||
# | # ~/traduire.sh - Version avec texte agrandi garantie | ||
# | # Récupération du texte | ||
texte_copie=$(xclip -o -selection clipboard 2>/dev/null) | texte_copie=$(xclip -o -selection clipboard 2>/dev/null) | ||
if [ -z "$texte_copie" ]; then | if [ -z "$texte_copie" ]; then | ||
zenity --error --text="Le presse-papiers est vide !" | zenity --error --text="Le presse-papiers est vide !" --width=300 | ||
exit 1 | exit 1 | ||
fi | fi | ||
# Traduction et affichage | # Traduction et affichage avec HTML | ||
traduction=$(trans -b "$texte_copie" -t fr) | traduction=$(trans -b "$texte_copie" -t fr) | ||
zenity --info --title="Traduction" --text="$traduction" --width= | zenity --info \ | ||
--title="Traduction" \ | |||
--text '<span foreground="white" font="14">'"$traduction"'</span>' \ | |||
--width=1800 \ | |||
--height=900 | |||
</syntaxhighlight> | </syntaxhighlight> | ||