From 239e5eeabe90c6e9ca8bb16214f7e4e88fbbbd2c Mon Sep 17 00:00:00 2001
From: Boria138 <boriabloger@protonmail.com>
Date: Sat, 27 Apr 2024 11:30:52 +0500
Subject: [PATCH] Replace eval_gettext to echo if gettext.sh is not found

---
 data_from_portwine/scripts/start.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/data_from_portwine/scripts/start.sh b/data_from_portwine/scripts/start.sh
index b1d7d99..f031ee6 100755
--- a/data_from_portwine/scripts/start.sh
+++ b/data_from_portwine/scripts/start.sh
@@ -46,12 +46,16 @@ fi
 cd "$(dirname "$(readlink -f "$0")")" && PORT_SCRIPTS_PATH="$(pwd)" || fatal
 cd "${PORT_SCRIPTS_PATH}/../../" && PORT_WINE_PATH="$(pwd)" || fatal
 export PORT_SCRIPTS_PATH PORT_WINE_PATH
-
-# shellcheck source=/dev/null
-source gettext.sh
 export TEXTDOMAIN="PortProton"
 export TEXTDOMAINDIR="${PORT_WINE_PATH}/data/locales"
 
+if [[ -d "$TEXTDOMAINDIR" ]] && command -v gettext.sh &>/dev/null ; then
+    # shellcheck source=/dev/null
+    source gettext.sh
+else
+    eval_gettext() { echo "$1"; }
+fi
+
 # shellcheck source=./functions_helper
 source "${PORT_SCRIPTS_PATH}/functions_helper"