« Linux Traduction Rapide » : différence entre les versions

 
(5 versions intermédiaires par le même utilisateur non affichées)
Ligne 25 : Ligne 25 :
         --width=1800 \
         --width=1800 \
         --height=900
         --height=900
</syntaxhighlight>
ou (scrollbar si texte trop long ...)
<syntaxhighlight lang="bash" line>
#!/bin/bash
# ~/traduire.sh - Version avec texte agrandi garantie
# Récupération du texte
texte_copie=$(xclip -o -selection clipboard 2>/dev/null)
if [ -z "$texte_copie" ]; then
    zenity --error --text="Le presse-papiers est vide !" --width=300
    exit 1
fi
# Traduction et affichage avec HTML
traduction=$(trans -b "$texte_copie" -t fr)
echo "$traduction" | zenity --text-info \
      --title="Traduction" \
      --width=1800 \
      --height=900 \
      --text '<span foreground="white" font="14">'"$traduction"'</span>' \
      --ok-label="Fermer" \
      --font "ubuntu 14"


</syntaxhighlight>
</syntaxhighlight>
Ligne 53 : Ligne 81 :
→ Désormais, copiez un texte et appuyez sur Super+T pour voir la traduction !
→ Désormais, copiez un texte et appuyez sur Super+T pour voir la traduction !


[[Catégorie:Linux]] [[Catégorie:Debian]]
[[Catégorie: Terminal Tools]]