feat(i18n): translate fws-proton-ge
This commit is contained in:
1 file changed
+18
-18
@@ -3,44 +3,44 @@
|
||||
# meilleure compatibilité des jeux Windows que le Proton officiel.
|
||||
# S'exécute en UTILISATEUR (installe dans ~/.steam/root/compatibilitytools.d).
|
||||
set -u
|
||||
. /usr/local/lib/fws/i18n.sh proton common
|
||||
say() { printf '\n\033[1;34m==> %s\033[0m\n' "$*"; }
|
||||
fail() { printf '\033[1;31m ✗ %s\033[0m\n' "$*"; read -rp "Entrée pour fermer. " _; exit 1; }
|
||||
fail() { printf '\033[1;31m ✗ %s\033[0m\n' "$*"; read -rp "$(t common.press_enter_to_close) " _; exit 1; }
|
||||
|
||||
[ "$(id -u)" -eq 0 ] && fail "à lancer en utilisateur normal (pas root) : l'outil s'installe dans ton Steam."
|
||||
[ "$(id -u)" -eq 0 ] && fail "$(t proton.not_as_root)"
|
||||
|
||||
API="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest"
|
||||
DEST="$HOME/.steam/root/compatibilitytools.d"
|
||||
|
||||
say "Recherche de la dernière version de Proton-GE…"
|
||||
JSON="$(curl -fsSL "$API")" || fail "GitHub inaccessible (réseau ?)"
|
||||
say "$(t proton.looking_up_latest)"
|
||||
JSON="$(curl -fsSL "$API")" || fail "$(t proton.github_unreachable)"
|
||||
URL="$(printf '%s' "$JSON" | grep -o '"browser_download_url": *"[^"]*\.tar\.gz"' | cut -d'"' -f4 | head -1)"
|
||||
SUM_URL="$(printf '%s' "$JSON" | grep -o '"browser_download_url": *"[^"]*\.sha512sum"' | cut -d'"' -f4 | head -1)"
|
||||
[ -n "$URL" ] || fail "archive introuvable dans la release GitHub"
|
||||
[ -n "$URL" ] || fail "$(t proton.archive_not_found)"
|
||||
NAME="$(basename "$URL" .tar.gz)"
|
||||
|
||||
if [ -d "$DEST/$NAME" ]; then
|
||||
say "$NAME est déjà installé ✔"
|
||||
read -rp "Entrée pour fermer. " _; exit 0
|
||||
say "$(t proton.already_installed name="$NAME")"
|
||||
read -rp "$(t common.press_enter_to_close) " _; exit 0
|
||||
fi
|
||||
|
||||
TMP="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMP"' EXIT
|
||||
say "Téléchargement de $NAME (~450 Mo)…"
|
||||
curl -fL --progress-bar -o "$TMP/$NAME.tar.gz" "$URL" || fail "téléchargement échoué"
|
||||
say "$(t proton.downloading name="$NAME")"
|
||||
curl -fL --progress-bar -o "$TMP/$NAME.tar.gz" "$URL" || fail "$(t proton.download_failed)"
|
||||
|
||||
if [ -n "$SUM_URL" ]; then
|
||||
say "Vérification de l'intégrité (sha512)…"
|
||||
say "$(t proton.verifying)"
|
||||
curl -fsSL -o "$TMP/sum" "$SUM_URL" \
|
||||
&& (cd "$TMP" && sed "s|[^ ]*\.tar\.gz|$NAME.tar.gz|" sum | sha512sum -c -) \
|
||||
|| fail "somme de contrôle invalide — archive corrompue ?"
|
||||
|| fail "$(t proton.checksum_invalid)"
|
||||
fi
|
||||
|
||||
say "Installation dans $DEST…"
|
||||
say "$(t proton.installing_into folder="$DEST")"
|
||||
mkdir -p "$DEST"
|
||||
tar -xzf "$TMP/$NAME.tar.gz" -C "$DEST" || fail "extraction échouée"
|
||||
tar -xzf "$TMP/$NAME.tar.gz" -C "$DEST" || fail "$(t proton.extraction_failed)"
|
||||
|
||||
say "$NAME installé ✔"
|
||||
echo " Dans Steam : Paramètres → Compatibilité → activer, puis choisir"
|
||||
echo " « $NAME » (ou par jeu : Propriétés → Compatibilité)."
|
||||
echo " Redémarre Steam pour qu'il apparaisse."
|
||||
read -rp "Entrée pour fermer. " _
|
||||
say "$(t proton.installed name="$NAME")"
|
||||
# The texts carry their own line breaks: sed indents every line.
|
||||
printf '%s\n' "$(t proton.how_to_enable name="$NAME")" "$(t proton.restart_steam)" | sed 's/^/ /'
|
||||
read -rp "$(t common.press_enter_to_close) " _
|
||||
Reference in new issue
Block a user