From 3f25318471b0a8bbe54f35c938de5ed8a14cb173 Mon Sep 17 00:00:00 2001 From: Htylol Date: Tue, 15 Oct 2024 10:36:00 +0500 Subject: [PATCH 1/2] Added translations for disabled --- data_from_portwine/locales/PortProton.pot | 12 +++++ .../locales/es/LC_MESSAGES/PortProton.po | 16 +++++++ .../locales/ru/LC_MESSAGES/PortProton.po | 13 ++++++ data_from_portwine/scripts/functions_helper | 46 +++++++++++++------ 4 files changed, 74 insertions(+), 13 deletions(-) diff --git a/data_from_portwine/locales/PortProton.pot b/data_from_portwine/locales/PortProton.pot index 3fbb167..7bdac69 100644 --- a/data_from_portwine/locales/PortProton.pot +++ b/data_from_portwine/locales/PortProton.pot @@ -251,6 +251,18 @@ msgstr "" msgid "Time spent" msgstr "" +msgid "disabled" +msgstr "" + +msgid "enable" +msgstr "" + +msgid "disable" +msgstr "" + +msgid "enabled" +msgstr "" + msgid "Do you really want to reinstall PortProton?\\nFor this, an internet " "connection will be required." msgstr "" diff --git a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po index bf9f738..9b82180 100644 --- a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po @@ -274,6 +274,22 @@ msgstr "" msgid "Time spent" msgstr "" +#, fuzzy +msgid "disabled" +msgstr "Desactivar" + +#, fuzzy +msgid "enable" +msgstr "Permitir" + +#, fuzzy +msgid "disable" +msgstr "Desactivar" + +#, fuzzy +msgid "enabled" +msgstr "Permitir" + msgid "" "Do you really want to reinstall PortProton?\\nFor this, an internet " "connection will be required." diff --git a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po index 2a24f6e..e46f5b3 100644 --- a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po @@ -273,6 +273,19 @@ msgstr "минут" msgid "Time spent" msgstr "Проведено времени" +msgid "disabled" +msgstr "Отключено" + +#, fuzzy +msgid "enable" +msgstr "Включить" + +msgid "disable" +msgstr "Отключить" + +msgid "enabled" +msgstr "Включено" + msgid "" "Do you really want to reinstall PortProton?\\nFor this, an internet " "connection will be required." diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index 10f8181..a4f9620 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -918,7 +918,7 @@ combobox_fix () { local name1 name2 if [[ "$1" == "--disabled" ]] ; then if [[ -z "$3" ]] ; then - echo "disabled" + echo "${translations[disabled]}" return 0 fi name1="$2" @@ -947,8 +947,16 @@ combobox_fix () { then name3="${name3%\!"${name1}"}" fi if [[ "$1" == "--disabled" ]] ; then - if [[ ${name1} != "disabled" ]] - then fix_disabled="!disabled" + if [[ ${name1} == "disabled" ]] ; then + name1="${translations[disabled]}" + if [[ ${name3} =~ enabled ]] ; then + name3="${name3//enabled/${translations[enable]}}" + fi + elif [[ ${name1} != "disabled" ]] ; then + fix_disabled="!${translations[disable]}" + if [[ ${name1} == "enabled" ]] ; then + name1="${translations[enabled]}" + fi fi echo "${name1}${name3}${fix_disabled}" elif [[ "$1" == "--empty" ]] ; then @@ -2230,9 +2238,15 @@ edit_db_from_gui () { && [[ -f "$PORTWINE_DB_FILE" ]] then for mod_db in $@ ; do + proxy_mod_db="${!mod_db}" + if [[ $proxy_mod_db =~ (${translations[disabled]}|${translations[disable]}) ]] ; then + proxy_mod_db=disabled + elif [[ $proxy_mod_db =~ (${translations[enabled]}|${translations[enable]}) ]] ; then + proxy_mod_db=enabled + fi if [[ $(<"${PORTWINE_DB_FILE}") =~ export\ ${mod_db}= ]] - then sed -i "s|export ${mod_db}=.*|export ${mod_db}=\"${!mod_db}\"|g" "${PORTWINE_DB_FILE}" - else echo "export ${mod_db}=\"${!mod_db}\"" >> "${PORTWINE_DB_FILE}" + then sed -i "s|export ${mod_db}=.*|export ${mod_db}=\"$proxy_mod_db\"|g" "${PORTWINE_DB_FILE}" + else echo "export ${mod_db}=\"$proxy_mod_db\"" >> "${PORTWINE_DB_FILE}" fi done fi @@ -2241,15 +2255,21 @@ edit_db_from_gui () { edit_user_conf_from_gui () { for mod_db in $@ ; do + proxy_mod_db="${!mod_db}" + if [[ $proxy_mod_db =~ (${translations[disabled]}|${translations[disable]}) ]] ; then + proxy_mod_db=disabled + elif [[ $proxy_mod_db =~ (${translations[enabled]}|${translations[enable]}) ]] ; then + proxy_mod_db=enabled + fi if ! grep "export ${mod_db}=" "${USER_CONF}" &>/dev/null - then echo "export ${mod_db}=\"${!mod_db}\"" >> "${USER_CONF}" + then echo "export ${mod_db}=\"$proxy_mod_db\"" >> "${USER_CONF}" elif grep "export ${mod_db}=" "${USER_CONF}" | grep -v "#" &>/dev/null then - if [[ "$(grep "export ${mod_db}=" "${USER_CONF}" | grep -v "#")" != "export ${mod_db}=\"${!mod_db}\"" ]] - then sed -ri "s/^export ${mod_db}=.*/export ${mod_db}=\"${!mod_db}\"/" "${USER_CONF}" + if [[ "$(grep "export ${mod_db}=" "${USER_CONF}" | grep -v "#")" != "export ${mod_db}=\"$proxy_mod_db\"" ]] + then sed -ri "s/^export ${mod_db}=.*/export ${mod_db}=\"$proxy_mod_db\"/" "${USER_CONF}" fi - elif [[ "$(grep "export ${mod_db}=" "${USER_CONF}")" != "export ${mod_db}=${!mod_db}" ]] - then sed -ri "s/.*export ${mod_db}=.*/export ${mod_db}=\"${!mod_db}\"/g" "${USER_CONF}" + elif [[ "$(grep "export ${mod_db}=" "${USER_CONF}")" != "export ${mod_db}=$proxy_mod_db" ]] + then sed -ri "s/.*export ${mod_db}=.*/export ${mod_db}=\"$proxy_mod_db\"/g" "${USER_CONF}" fi done return 0 @@ -4460,7 +4480,7 @@ A brief instruction: PW_VKD3D_FEATURE_LEVEL="${PW_ADD_SETTINGS[8]}" PW_LOCALE_SELECT="${PW_ADD_SETTINGS[9]}" - if [[ "${CPU_LIMIT}" != "disabled" ]] ; then + if [[ "${CPU_LIMIT}" =~ [0-9]+ ]] ; then PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $(( CPU_LIMIT - 1 )))" else PW_WINE_CPU_TOPOLOGY="disabled" @@ -5272,8 +5292,8 @@ gui_userconf () { --field="${translations[Choose a graphics card to run the game]}!${translations[Select which video card will be used to run the game (used for all running games and programs in PortProton)]} :CB" "$(combobox_fix --disabled "$GPU_VAR" "$GET_GPU_NAMES")" \ --field="${translations[Choice wine audio driver]}!${translations[Fixes sound popling if choice alsa]} :CB" "$(combobox_fix --disabled "$SOUND_DRIVER_VAR" "alsa!oss!pulse")" \ --field="${translations[Choice gui themes]}!${translations[Allows you to select a theme for PortProton]} :CB" "$(combobox_fix "$GUI_THEME" "default!compact!classic")" \ - --field="${translations[Time display]}!${translations[Displays time spent in an application or game]} :CB" "$(combobox_fix "$DESKTOP_WITH_TIME" "enabled!disabled")" \ - --field="${translations[Sort shortcuts by time]}!${translations[This setting sorts the shortcuts in the main menu depending on the time spent in the application or game]} :CB" "$(combobox_fix "$SORT_WITH_TIME" "enabled!disabled")" \ + --field="${translations[Time display]}!${translations[Displays time spent in an application or game]} :CB" "$(combobox_fix --disabled "$DESKTOP_WITH_TIME" "enabled")" \ + --field="${translations[Sort shortcuts by time]}!${translations[This setting sorts the shortcuts in the main menu depending on the time spent in the application or game]} :CB" "$(combobox_fix --disabled "$SORT_WITH_TIME" "enabled")" \ 1> "${PW_TMPFS_PATH}/tmp_yad_userconf_set_cb" 2>/dev/null & "${pw_yad}" --key=$KEY_USERCONF_GUI --paned --sensitive \ From 8faa35cf99229fe64a1ee8407468f83a7d7141c1 Mon Sep 17 00:00:00 2001 From: Htylol Date: Tue, 15 Oct 2024 13:55:29 +0500 Subject: [PATCH 2/2] Update locales --- data_from_portwine/locales/PortProton.pot | 8 ++++---- .../locales/es/LC_MESSAGES/PortProton.po | 18 ++++++------------ .../locales/ru/LC_MESSAGES/PortProton.po | 15 ++++----------- data_from_portwine/scripts/functions_helper | 18 +++++++++--------- 4 files changed, 23 insertions(+), 36 deletions(-) diff --git a/data_from_portwine/locales/PortProton.pot b/data_from_portwine/locales/PortProton.pot index 7bdac69..cb5b89f 100644 --- a/data_from_portwine/locales/PortProton.pot +++ b/data_from_portwine/locales/PortProton.pot @@ -251,16 +251,16 @@ msgstr "" msgid "Time spent" msgstr "" -msgid "disabled" +msgid "Disabled" msgstr "" -msgid "enable" +msgid "Enable" msgstr "" -msgid "disable" +msgid "Disable" msgstr "" -msgid "enabled" +msgid "Enabled" msgstr "" msgid "Do you really want to reinstall PortProton?\\nFor this, an internet " diff --git a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po index 9b82180..3baf2d0 100644 --- a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po @@ -275,20 +275,20 @@ msgid "Time spent" msgstr "" #, fuzzy -msgid "disabled" -msgstr "Desactivar" +msgid "Disabled" +msgstr "Desactivada" #, fuzzy -msgid "enable" +msgid "Enable" msgstr "Permitir" #, fuzzy -msgid "disable" +msgid "Disable" msgstr "Desactivar" #, fuzzy -msgid "enabled" -msgstr "Permitir" +msgid "Enabled" +msgstr "Activada" msgid "" "Do you really want to reinstall PortProton?\\nFor this, an internet " @@ -1765,12 +1765,6 @@ msgstr "" msgid "Disable GameScope and go to the previous menu" msgstr "Desactivar GameScope e ir al menú anterior" -msgid "Disable" -msgstr "Desactivar" - -msgid "Enable" -msgstr "Permitir" - #, fuzzy msgid "Change global settings" msgstr "Cambiar la configuración de" diff --git a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po index e46f5b3..371805a 100644 --- a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po @@ -273,17 +273,16 @@ msgstr "минут" msgid "Time spent" msgstr "Проведено времени" -msgid "disabled" +msgid "Disabled" msgstr "Отключено" -#, fuzzy -msgid "enable" +msgid "Enable" msgstr "Включить" -msgid "disable" +msgid "Disable" msgstr "Отключить" -msgid "enabled" +msgid "Enabled" msgstr "Включено" msgid "" @@ -1735,12 +1734,6 @@ msgstr "" msgid "Disable GameScope and go to the previous menu" msgstr "Отключить Gamescope и перейти в предыдущее меню" -msgid "Disable" -msgstr "Выключить" - -msgid "Enable" -msgstr "Включить" - msgid "Change global settings" msgstr "Изменить глобальные настройки" diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index a4f9620..5ba0421 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -918,7 +918,7 @@ combobox_fix () { local name1 name2 if [[ "$1" == "--disabled" ]] ; then if [[ -z "$3" ]] ; then - echo "${translations[disabled]}" + echo "${translations[Disabled]}" return 0 fi name1="$2" @@ -948,14 +948,14 @@ combobox_fix () { fi if [[ "$1" == "--disabled" ]] ; then if [[ ${name1} == "disabled" ]] ; then - name1="${translations[disabled]}" + name1="${translations[Disabled]}" if [[ ${name3} =~ enabled ]] ; then - name3="${name3//enabled/${translations[enable]}}" + name3="${name3//enabled/${translations[Enable]}}" fi elif [[ ${name1} != "disabled" ]] ; then - fix_disabled="!${translations[disable]}" + fix_disabled="!${translations[Disable]}" if [[ ${name1} == "enabled" ]] ; then - name1="${translations[enabled]}" + name1="${translations[Enabled]}" fi fi echo "${name1}${name3}${fix_disabled}" @@ -2239,9 +2239,9 @@ edit_db_from_gui () { then for mod_db in $@ ; do proxy_mod_db="${!mod_db}" - if [[ $proxy_mod_db =~ (${translations[disabled]}|${translations[disable]}) ]] ; then + if [[ $proxy_mod_db =~ (${translations[Disabled]}|${translations[Disable]}) ]] ; then proxy_mod_db=disabled - elif [[ $proxy_mod_db =~ (${translations[enabled]}|${translations[enable]}) ]] ; then + elif [[ $proxy_mod_db =~ (${translations[Enabled]}|${translations[Enable]}) ]] ; then proxy_mod_db=enabled fi if [[ $(<"${PORTWINE_DB_FILE}") =~ export\ ${mod_db}= ]] @@ -2256,9 +2256,9 @@ edit_db_from_gui () { edit_user_conf_from_gui () { for mod_db in $@ ; do proxy_mod_db="${!mod_db}" - if [[ $proxy_mod_db =~ (${translations[disabled]}|${translations[disable]}) ]] ; then + if [[ $proxy_mod_db =~ (${translations[Disabled]}|${translations[Disable]}) ]] ; then proxy_mod_db=disabled - elif [[ $proxy_mod_db =~ (${translations[enabled]}|${translations[enable]}) ]] ; then + elif [[ $proxy_mod_db =~ (${translations[Enabled]}|${translations[Enable]}) ]] ; then proxy_mod_db=enabled fi if ! grep "export ${mod_db}=" "${USER_CONF}" &>/dev/null