From f70fd02e935eb6a3ae3b40605abd10e944986075 Mon Sep 17 00:00:00 2001 From: Htylol Date: Thu, 19 Sep 2024 23:38:26 +0500 Subject: [PATCH] changes... --- data_from_portwine/locales/PortProton.pot | 17 ++++---- .../locales/es/LC_MESSAGES/PortProton.po | 30 +++++++------- .../locales/ru/LC_MESSAGES/PortProton.po | 39 +++++++++---------- data_from_portwine/scripts/functions_helper | 16 ++++---- data_from_portwine/scripts/start.sh | 35 ++++++++--------- 5 files changed, 67 insertions(+), 70 deletions(-) diff --git a/data_from_portwine/locales/PortProton.pot b/data_from_portwine/locales/PortProton.pot index acb0b62..6338027 100644 --- a/data_from_portwine/locales/PortProton.pot +++ b/data_from_portwine/locales/PortProton.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" - "POT-Creation-Date: 2024-09-19 21:02+0500\n" + "POT-Creation-Date: 2024-09-20 17:00+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1245,11 +1245,10 @@ msgstr "" msgid "Change settings gamescope for" msgstr "" -#, sh-format msgid "Gamescope is not detected on the system, to install it, run the " "command in the terminal:\\nflatpak install -y runtime/org." - "freedesktop.Platform.VulkanLayer.gamescope/x86_64/" - "${GAMESCOPE_VERSION}\\n(Can be selected and copied)" + "freedesktop.Platform.VulkanLayer.gamescope/x86_64/$" + "%{GAMESCOPE_VERSION}%\\n(Can be selected and copied)" msgstr "" msgid "Gamescope is not detected on the system, please contact the " @@ -1548,11 +1547,12 @@ msgstr "" msgid "SAVE" msgstr "" -msgid "scripts" +#, sh-format +msgid "PortProton v. ${install_ver}\n" + "scripts v. ${scripts_install_ver}" msgstr "" -#, sh-format -msgid "Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)" +msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)" msgstr "" msgid "This program comes with absolutely no warranty.\n" @@ -1564,10 +1564,9 @@ msgid "Author: Casro-Fidel (Mikhail Tergoev)\n" "Developer assistants and testers:" msgstr "" -#, sh-format msgid "MIT License\n" "\n" - "Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)\n" + "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)\n" "\n" "Permission is hereby granted, free of charge, to any person " "obtaining a copy\n" diff --git a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po index c87604c..267015f 100644 --- a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-19 20:52+0500\n" -"PO-Revision-Date: 2024-09-15 15:29+0500\n" +"POT-Creation-Date: 2024-09-19 23:26+0500\n" +"PO-Revision-Date: 2024-09-19 23:35+0500\n" "Last-Translator: \n" "Language-Team: \n" "Language: es_ES\n" @@ -1627,16 +1627,15 @@ msgstr "" msgid "Change settings gamescope for" msgstr "Cambiar ajustes gamescope para" -#, fuzzy, sh-format msgid "" "Gamescope is not detected on the system, to install it, run the command " "in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform." -"VulkanLayer.gamescope/x86_64/${GAMESCOPE_VERSION}\\n(Can be selected and " +"VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be selected and " "copied)" msgstr "" " Gamescope no se detecta en el sistema, para instalarlo, ejecute el " "comando en el terminal:\\n flatpak install -y runtime/org.freedesktop." -"Platform.VulkanLayer.gamescope/x86_64/${GAMESCOPE_VERSION}\\n (Se puede " +"Platform.VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n (Se puede " "seleccionar y copiar)." #, fuzzy @@ -2006,12 +2005,13 @@ msgstr "ATRÁS" msgid "SAVE" msgstr "AHORRAR" -#, fuzzy -msgid "scripts" -msgstr "Actualizar scripts:" - #, sh-format -msgid "Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)" +msgid "" +"PortProton v. ${install_ver}\n" +"scripts v. ${scripts_install_ver}" +msgstr "" + +msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)" msgstr "" msgid "" @@ -2025,11 +2025,10 @@ msgid "" "Developer assistants and testers:" msgstr "" -#, sh-format msgid "" "MIT License\n" "\n" -"Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)\n" +"Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)\n" "\n" "Permission is hereby granted, free of charge, to any person obtaining a " "copy\n" @@ -2098,9 +2097,8 @@ msgstr "" msgid "ABOUT PORTPROTON" msgstr "" -#, fuzzy msgid "AUTORS" -msgstr "EMULADORES" +msgstr "" msgid "LICENSE" msgstr "" @@ -2114,6 +2112,10 @@ msgstr "" msgid "THIRD PARTY LIBRARIES" msgstr "" +#, fuzzy +#~ msgid "scripts" +#~ msgstr "Actualizar scripts:" + #~ msgid "" #~ "Fixes artifacts on AMD and Intel video cards. (Use only when necessary)." #~ msgstr "" diff --git a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po index 12b9517..11b0848 100644 --- a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-19 20:52+0500\n" -"PO-Revision-Date: 2024-09-19 21:03+0500\n" +"POT-Creation-Date: 2024-09-19 23:26+0500\n" +"PO-Revision-Date: 2024-09-19 23:32+0500\n" "Last-Translator: \n" "Language-Team: \n" "Language: ru_RU\n" @@ -1596,16 +1596,15 @@ msgstr "" msgid "Change settings gamescope for" msgstr "Изменить настройки Gamescope для" -#, sh-format msgid "" "Gamescope is not detected on the system, to install it, run the command " "in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform." -"VulkanLayer.gamescope/x86_64/${GAMESCOPE_VERSION}\\n(Can be selected and " +"VulkanLayer.gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Can be selected and " "copied)" msgstr "" "Gamescope не найден в системе, для его установки выполните команду в " "терминале:\\nflatpak install -y runtime/org.freedesktop.Platform.VulkanLayer." -"gamescope/x86_64/${GAMESCOPE_VERSION}\\n(Данный текст можно выделить и " +"gamescope/x86_64/$%{GAMESCOPE_VERSION}%\\n(Данный текст можно выделить и " "скопировать)" msgid "" @@ -1973,12 +1972,16 @@ msgstr "НАЗАД" msgid "SAVE" msgstr "СОХРАНИТЬ" -msgid "scripts" -msgstr "версия" - #, sh-format -msgid "Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)" -msgstr "Авторские права © ${DATE} Castro-Fidel (linux-gaming.ru)" +msgid "" +"PortProton v. ${install_ver}\n" +"scripts v. ${scripts_install_ver}" +msgstr "" +"PortProton v. ${install_ver}\n" +"версия v. ${scripts_install_ver}" + +msgid "Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)" +msgstr "Авторские права © $%DATE% Castro-Fidel (linux-gaming.ru)" msgid "" "This program comes with absolutely no warranty.\n" @@ -1996,11 +1999,10 @@ msgstr "" "\n" "Помощники разработчика и тестировщики:" -#, sh-format msgid "" "MIT License\n" "\n" -"Copyright © ${DATE} Castro-Fidel (linux-gaming.ru)\n" +"Copyright © $%DATE% Castro-Fidel (linux-gaming.ru)\n" "\n" "Permission is hereby granted, free of charge, to any person obtaining a " "copy\n" @@ -2028,7 +2030,7 @@ msgid "" msgstr "" "Лицензия Массачусетского технологического института (MIT License)\n" "\n" -"Авторские права © ${DATE} Castro-Fidel (linux-gaming.ru)\n" +"Авторские права © $%DATE% Castro-Fidel (linux-gaming.ru)\n" "\n" "Настоящим предоставляется бесплатное разрешение любому лицу, получившему " "копию данного\n" @@ -2137,6 +2139,9 @@ msgstr "ПРИСОЕДЕНИТЬСЯ" msgid "THIRD PARTY LIBRARIES" msgstr "БИБЛИОТЕКИ" +#~ msgid "scripts" +#~ msgstr "версия" + #~ msgid "MIT License" #~ msgstr "Лицензия Массачусетского технологического института (MIT License)" @@ -2146,14 +2151,6 @@ msgstr "БИБЛИОТЕКИ" #~ msgid "Copyright" #~ msgstr "Авторские права" -#, sh-format -#~ msgid "" -#~ "PortProton v. ${install_ver}\n" -#~ "scripts v. ${scripts_install_ver}" -#~ msgstr "" -#~ "PortProton v. ${install_ver}\n" -#~ "версия v. ${scripts_install_ver}" - #~ msgid "Open game folder" #~ msgstr "Открыть папку с игрой" diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index f5126fe..d445903 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -143,11 +143,11 @@ export -f generate_pot eval_translations () { # Для того чтобы раскрывать переменную уже после создания массива - # Вместо {translations[\$TEST text]} нужно (eval_translations "\${TEST} text" "TEST=test") в переводе переменная должна быть в {} + # Вместо {translations[\$TEST text]} нужно (eval_translations "\$%TEST% text" "TEST=test"), перевод должен быть с %% тоже # В остальных случаях можно использовать {translations[\$TEST text]} ,но переменную нужно обьявлять до создания массива # до source "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" или можно использовать команды {translations[\$(cat file.txt) text]} # но тогда выполнение команды будет происходить во время создания массива всегда, а не там где это требуется - echo "${translations[$1]//\$*"}"/${2//*=/}}" + echo "${translations[$1]//\$*"%"/${2//*=/}}" } create_translations () { @@ -213,7 +213,7 @@ EOF fi if [[ $msgid =~ "\$" ]] ; then msgid=${msgid//"\$"/\\$} - if [[ $msgstr =~ "\${" ]] ; then + if [[ $msgstr =~ "\$%" ]] ; then msgstr=${msgstr//"\$"/\\$} fi fi @@ -4716,7 +4716,7 @@ gui_gamescope () { else if check_flatpak ; then GAMESCOPE_VERSION="$(grep 'VERSION_ID=' /etc/os-release)" - GAMESCOPE_NEED_INSTALL=$(eval_translations "Gamescope is not detected on the system, to install it, run the command in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/\${GAMESCOPE_VERSION}\\n(Can be selected and copied)" "GAMESCOPE_VERSION=${GAMESCOPE_VERSION//VERSION_ID=/}") + GAMESCOPE_NEED_INSTALL=$(eval_translations "Gamescope is not detected on the system, to install it, run the command in the terminal:\\nflatpak install -y runtime/org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/\$%{GAMESCOPE_VERSION}%\\n(Can be selected and copied)" "GAMESCOPE_VERSION=${GAMESCOPE_VERSION//VERSION_ID=/}") YAD_TEXT_SELECTION="--selectable-labels" else GAMESCOPE_NEED_INSTALL="${translations[Gamescope is not detected on the system, please contact the manufacturer of your distribution\\nor search the Internet for information on how to install gamescope on your system.]}" @@ -5857,10 +5857,10 @@ gui_credits () { source "${PORT_WINE_PATH}/data/scripts/thanks" "${pw_yad}" --plug="${KEY_CREDITS}" --tabnum=1 --show-uri --scroll \ - --text-align=center --text="PortProton v. ${install_ver} -${translations[scripts]} v. ${scripts_install_ver}" --text-info <<< "https://linux-gaming.ru + --text-align=center --text="${translations[PortProton v. \${install_ver} +scripts v. \${scripts_install_ver}]}" --text-info <<< "https://linux-gaming.ru -$(eval_translations "Copyright © \${DATE} Castro-Fidel (linux-gaming.ru)" "DATE=$(date +%Y)") +$(eval_translations "Copyright © \$%DATE% Castro-Fidel (linux-gaming.ru)" "DATE=$(date +%Y)") ${translations[This program comes with absolutely no warranty. See the License for details.]}" 2>/dev/null & @@ -5873,7 +5873,7 @@ $(credits_devel)" 2>/dev/null & "${pw_yad}" --plug="${KEY_CREDITS}" --tabnum=3 --text-info --scroll <<< "$(eval_translations "MIT License -Copyright © \${DATE} Castro-Fidel (linux-gaming.ru) +Copyright © \$%DATE% Castro-Fidel (linux-gaming.ru) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal diff --git a/data_from_portwine/scripts/start.sh b/data_from_portwine/scripts/start.sh index 951a3be..d3d09c8 100755 --- a/data_from_portwine/scripts/start.sh +++ b/data_from_portwine/scripts/start.sh @@ -161,30 +161,14 @@ export pw_yad="${PW_GUI_THEMES_PATH}/gui/yad_gui_pp" change_locale -scripts_install_ver=$(<"${PORT_WINE_TMP_PATH}/scripts_ver") -export scripts_install_ver - -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 - export urlg="https://linux-gaming.ru/portproton/" export url_cloud="https://cloud.linux-gaming.ru/portproton" export PW_WINELIB="${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}" try_remove_dir "${PW_WINELIB}/var" install_ver="$(<"${PORT_WINE_TMP_PATH}/PortProton_ver")" export install_ver +scripts_install_ver=$(<"${PORT_WINE_TMP_PATH}/scripts_ver") +export scripts_install_ver export WINETRICKS_DOWNLOADER="curl" export USER_CONF="${PORT_WINE_PATH}/data/user.conf" check_user_conf @@ -370,6 +354,21 @@ 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