Commit d62bc8c1 authored by Mikhail Tergoev's avatar Mikhail Tergoev

update cache lang

parent 9df95680
......@@ -158,7 +158,7 @@ generate_pot () {
try_remove_file "${PORT_SCRIPTS_PATH}/start.sh_tmp"
try_remove_file "${PORT_SCRIPTS_PATH}/setup.sh_tmp"
try_remove_file "${PORT_SCRIPTS_PATH}/functions_helper_tmp"
try_remove_dir "${PORT_SCRIPTS_PATH}/translations"
try_remove_dir "${PW_CACHE_LANG_PATH}"
}
export -f generate_pot
......@@ -166,16 +166,16 @@ eval_translations () {
# Для того чтобы раскрывать переменную уже после создания массива
# Вместо {translations[\$TEST text]} нужно (eval_translations "\$%TEST% text" "TEST=test"), перевод должен быть с %% тоже
# В остальных случаях можно использовать {translations[\$TEST text]} ,но переменную нужно обьявлять до создания массива
# до source "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" или можно использовать команды {translations[\$(cat file.txt) text]}
# до source "${PW_CACHE_LANG_PATH}/$LANGUAGE" или можно использовать команды {translations[\$(cat file.txt) text]}
# но тогда выполнение команды будет происходить во время создания массива всегда, а не там где это требуется
echo "${translations[$1]//\$*"%"/${2//*=/}}"
}
create_translations () {
if [[ ! -d "${PORT_SCRIPTS_PATH}/translations" ]] ; then
create_new_dir "${PORT_SCRIPTS_PATH}/translations"
if [[ ! -d "${PW_CACHE_LANG_PATH}" ]] ; then
create_new_dir "${PW_CACHE_LANG_PATH}"
fi
cat << EOF > "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
cat << EOF > "${PW_CACHE_LANG_PATH}/$LANGUAGE"
#!/usr/bin/env bash
TRANSLATIONS_VER=$scripts_install_ver
declare -A translations=(
......@@ -238,18 +238,18 @@ EOF
msgstr=${msgstr//"\$"/\\$}
fi
fi
echo \["$msgid"\]="$msgstr" >> "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
echo \["$msgid"\]="$msgstr" >> "${PW_CACHE_LANG_PATH}/$LANGUAGE"
fi
done
done < "$po_file"
IFS="$orig_IFS"
echo ")" >> "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
sed -i 's/+_+/\n/g' "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
sed -i 's/#_#/\*/g' "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
sed -i 's/-_-/ /g' "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
echo ")" >> "${PW_CACHE_LANG_PATH}/$LANGUAGE"
sed -i 's/+_+/\n/g' "${PW_CACHE_LANG_PATH}/$LANGUAGE"
sed -i 's/#_#/\*/g' "${PW_CACHE_LANG_PATH}/$LANGUAGE"
sed -i 's/-_-/ /g' "${PW_CACHE_LANG_PATH}/$LANGUAGE"
if [[ $LANGUAGE == "en" ]] ; then
sed -i 's/msgid //g' "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
sed -i 's/msgid //g' "${PW_CACHE_LANG_PATH}/$LANGUAGE"
fi
}
export -f create_translations
......@@ -5656,8 +5656,10 @@ pw_autoinstall_from_db () {
}
button_click () {
echo "$2" > "${PW_TMPFS_PATH}/tmp_yad_form"
case "$1" in
--normal|--desktop)
--normal)
kill -s SIGUSR1 $(pgrep -a yad | grep "\--key=${KEY_MENU}" | awk '{print $1}') > /dev/null 2>&1
;;
--start)
......@@ -5666,38 +5668,36 @@ button_click () {
--userconf)
kill -s SIGUSR1 $(pgrep -a yad | grep "\--key=${KEY_USERCONF_GUI}" | awk '{print $1}') > /dev/null 2>&1
;;
esac
echo "$2" > "${PW_TMPFS_PATH}/tmp_yad_form"
if [[ "$1" == "--desktop" ]] ; then
PW_YAD_SET="${PORT_WINE_PATH}/${PW_YAD_SET//#@_@#/ }"
if [[ $PW_DESKTOP_FILES_REGEX == "1" ]] ; then
PW_YAD_SET="${PW_YAD_SET//#+_1#/\(}"
PW_YAD_SET="${PW_YAD_SET//#+_2#/\)}"
PW_YAD_SET="${PW_YAD_SET//#+_3#/\!}"
PW_YAD_SET="${PW_YAD_SET//#+_4#/\$}"
PW_YAD_SET="${PW_YAD_SET//#+_5#/\%}"
PW_YAD_SET="${PW_YAD_SET//#+_6#/\&}"
PW_YAD_SET="${PW_YAD_SET//#+_7#/\`}"
PW_YAD_SET="${PW_YAD_SET//#+_8#/\'}"
PW_YAD_SET="${PW_YAD_SET//#+_9#/\"}"
PW_YAD_SET="${PW_YAD_SET//#+_10#/\>}"
PW_YAD_SET="${PW_YAD_SET//#+_11#/\<}"
PW_YAD_SET="${PW_YAD_SET//#+_12#/\\}"
PW_YAD_SET="${PW_YAD_SET//#+_13#/\|}"
PW_YAD_SET="${PW_YAD_SET//#+_14#/\;}"
fi
if check_flatpak
then PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | sed 's|flatpak run ru.linux_gaming.PortProton|\"${PORT_SCRIPTS_PATH}/start.sh\"|' | awk -F'=' '{print $2}')"
else PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | awk -F"=env " '{print $2}')"
fi
--desktop)
kill -s SIGUSR1 $(pgrep -a yad | grep "\--key=${KEY_MENU}" | awk '{print $1}') > /dev/null 2>&1
PW_YAD_SET="${PORT_WINE_PATH}/${PW_YAD_SET//#@_@#/ }"
if [[ $PW_DESKTOP_FILES_REGEX == "1" ]] ; then
PW_YAD_SET="${PW_YAD_SET//#+_1#/\(}"
PW_YAD_SET="${PW_YAD_SET//#+_2#/\)}"
PW_YAD_SET="${PW_YAD_SET//#+_3#/\!}"
PW_YAD_SET="${PW_YAD_SET//#+_4#/\$}"
PW_YAD_SET="${PW_YAD_SET//#+_5#/\%}"
PW_YAD_SET="${PW_YAD_SET//#+_6#/\&}"
PW_YAD_SET="${PW_YAD_SET//#+_7#/\`}"
PW_YAD_SET="${PW_YAD_SET//#+_8#/\'}"
PW_YAD_SET="${PW_YAD_SET//#+_9#/\"}"
PW_YAD_SET="${PW_YAD_SET//#+_10#/\>}"
PW_YAD_SET="${PW_YAD_SET//#+_11#/\<}"
PW_YAD_SET="${PW_YAD_SET//#+_12#/\\}"
PW_YAD_SET="${PW_YAD_SET//#+_13#/\|}"
PW_YAD_SET="${PW_YAD_SET//#+_14#/\;}"
fi
if check_flatpak
then PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | sed 's|flatpak run ru.linux_gaming.PortProton|\"${PORT_SCRIPTS_PATH}/start.sh\"|' | awk -F'=' '{print $2}')"
else PW_EXEC_FROM_DESKTOP="$(grep Exec "$PW_YAD_SET" | head -n 1 | awk -F"=env " '{print $2}')"
fi
print_info "Restarting PP after choose desktop file..."
# stop_portwine
/usr/bin/env bash -c "${PW_EXEC_FROM_DESKTOP}" &
exit 0
fi
print_info "Restarting PP after choose desktop file..."
# stop_portwine
/usr/bin/env bash -c "${PW_EXEC_FROM_DESKTOP}" &
exit 0
;;
esac
}
export -f button_click
......
......@@ -156,6 +156,7 @@ source "${PORT_SCRIPTS_PATH}/var"
export STEAM_SCRIPTS="${PORT_WINE_PATH}/steam_scripts"
export PW_PLUGINS_PATH="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}"
export PW_CACHE_LANG_PATH="${PORT_WINE_TMP_PATH}/cache_lang/"
export PW_GUI_ICON_PATH="${PORT_WINE_PATH}/data/img/gui"
export PW_GUI_THEMES_PATH="${PORT_WINE_PATH}/data/themes"
export pw_yad="${PW_GUI_THEMES_PATH}/gui/yad_gui_pp"
......@@ -182,6 +183,21 @@ try_remove_file "${PW_TMPFS_PATH}/update_pfx_log"
# shellcheck source=/dev/null
source "${USER_CONF}"
if [[ ! -f "${PW_CACHE_LANG_PATH}/$LANGUAGE" ]] ; then
create_translations
fi
unset translations
# shellcheck source=/dev/null
source "${PW_CACHE_LANG_PATH}/$LANGUAGE"
if [[ $TRANSLATIONS_VER != "$scripts_install_ver" ]] ; then
try_remove_dir "${PW_CACHE_LANG_PATH}"
create_translations
# shellcheck source=/dev/null
source "${PW_CACHE_LANG_PATH}/$LANGUAGE"
fi
# check PortProton theme
if [[ -n "$GUI_THEME" ]] \
&& [[ -f "$PW_GUI_THEMES_PATH/$GUI_THEME.pptheme" ]]
......@@ -355,21 +371,6 @@ if [[ "${SKIP_CHECK_UPDATES}" != 1 ]] ; then
export PW_FILESYSTEM
fi
if [[ ! -f "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" ]] ; then
create_translations
fi
unset translations
# shellcheck source=/dev/null
source "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
if [[ $TRANSLATIONS_VER != "$scripts_install_ver" ]] ; then
try_remove_dir "${PORT_SCRIPTS_PATH}/translations"
create_translations
# shellcheck source=/dev/null
source "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE"
fi
# create lock file
if ! check_flatpak ; then
if [[ -f "${PW_TMPFS_PATH}/portproton.lock" ]] ; then
......@@ -756,7 +757,7 @@ else
else
PW_DESKTOP_FILES_SHOW="${PW_DESKTOP_FILES}"
fi
PW_GENERATE_BUTTONS+="--field= $(print_wrapped "${PW_DESKTOP_FILES_SHOW//".desktop"/""}" "20" "...")!${PW_NAME_D_ICON_48}.png!:FBTN%@bash -c \"button_click --desktop "${PW_DESKTOP_FILES// /#@_@#}"\"%"
PW_GENERATE_BUTTONS+="--field= $(print_wrapped "${PW_DESKTOP_FILES_SHOW//".desktop"/""}" "25" "...")!${PW_NAME_D_ICON_48}.png!:FBTN%@bash -c \"button_click --desktop "${PW_DESKTOP_FILES// /#@_@#}"\"%"
done
IFS="$orig_IFS"
......
#!/usr/bin/env bash
#Author: Castro-Fidel (linux-gaming.ru)
#SCRIPTS_NEXT_VERSION=2349
#SCRIPTS_NEXT_VERSION=2350
#SCRIPTS_STABLE_VERSION=2342
########################################################################
# export PROTON_USE_XALIA="1"
......@@ -55,9 +55,9 @@ export PW_VULKAN_USE="2"
export VKD3D_LIMIT_TESS_FACTORS="64"
export DXVK_LEGACY_VER="1.6.1"
export DXVK_STABLE_VER="1.10.3-28"
export DXVK_GIT_VER="2.4-41"
export DXVK_GIT_VER="2.4-94"
export VKD3D_STABLE_VER="1.1-2602"
export VKD3D_GIT_VER="1.1-4177"
export VKD3D_GIT_VER="1.1-4191"
###VKBASALT###
export PW_VKBASALT_EFFECTS="Curves:cas"
export PW_VKBASALT_FFX_CAS="0.66"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment