forked from CastroFidel/PortWINE
		
	Added the ability to expand variables in translations
This commit is contained in:
		| @@ -7,13 +7,13 @@ | ||||
| msgid   "" | ||||
| msgstr  "Project-Id-Version: PACKAGE VERSION\n" | ||||
|         "Report-Msgid-Bugs-To: \n" | ||||
|         "POT-Creation-Date: 2024-09-18 01:14+0500\n" | ||||
|         "POT-Creation-Date: 2024-09-18 22:54+0500\n" | ||||
|         "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||||
|         "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||||
|         "Language-Team: LANGUAGE <LL@li.org>\n" | ||||
|         "Language: \n" | ||||
|         "MIME-Version: 1.0\n" | ||||
|         "Content-Type: text/plain; charset=CHARSET\n" | ||||
|         "Content-Type: text/plain; charset=UTF-8\n" | ||||
|         "Content-Transfer-Encoding: 8bit\n" | ||||
|  | ||||
| msgid   "A running PortProton session was detected.\\nDo you want to end the " | ||||
| @@ -1245,12 +1245,11 @@ msgstr  "" | ||||
| msgid   "Change settings gamescope for" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "Gamescope is not detected on the system, to install it, run the " | ||||
| #, sh-format | ||||
| msgid   "<b>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/" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "(Can be selected and copied)" | ||||
|         "${GAMESCOPE_VERSION}\\n(Can be selected and copied)</b>" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "<b>Gamescope is not detected on the system, please contact the " | ||||
| @@ -1552,7 +1551,8 @@ msgstr  "" | ||||
| msgid   "scripts" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "Copyright" | ||||
| #, sh-format | ||||
| msgid   "Copyright © $DATE Castro-Fidel (linux-gaming.ru)" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "This program comes with absolutely no warranty.\n" | ||||
| @@ -1567,7 +1567,10 @@ msgstr  "" | ||||
| msgid   "MIT License" | ||||
| msgstr  "" | ||||
|  | ||||
| msgid   "Permission is hereby granted, free of charge, to any person " | ||||
| #, sh-format | ||||
| msgid   "Copyright © $DATE Castro-Fidel (linux-gaming.ru)\n" | ||||
|         "\n" | ||||
|         "Permission is hereby granted, free of charge, to any person " | ||||
|         "obtaining a copy\n" | ||||
|         "of this software and associated documentation files (the " | ||||
|         "\"Software\"), to deal\n" | ||||
|   | ||||
| @@ -8,7 +8,7 @@ msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: \n" | ||||
| "Report-Msgid-Bugs-To: \n" | ||||
| "POT-Creation-Date: 2024-09-18 01:14+0500\n" | ||||
| "POT-Creation-Date: 2024-09-18 22:44+0500\n" | ||||
| "PO-Revision-Date: 2024-09-15 15:29+0500\n" | ||||
| "Last-Translator: \n" | ||||
| "Language-Team: \n" | ||||
| @@ -1627,20 +1627,18 @@ msgstr "" | ||||
| msgid "Change settings gamescope for" | ||||
| msgstr "Cambiar ajustes gamescope para" | ||||
|  | ||||
| #, fuzzy | ||||
| #, 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/" | ||||
| "<b>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)</b>" | ||||
| msgstr "" | ||||
| " <b>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 " | ||||
| "seleccionar y copiar)</b>." | ||||
|  | ||||
| msgid "(Can be selected and copied)" | ||||
| msgstr "" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "" | ||||
| "<b>Gamescope is not detected on the system, please contact the manufacturer " | ||||
| @@ -2012,7 +2010,8 @@ msgstr "AHORRAR" | ||||
| msgid "scripts" | ||||
| msgstr "Actualizar scripts:" | ||||
|  | ||||
| msgid "Copyright" | ||||
| #, sh-format | ||||
| msgid "Copyright © $DATE Castro-Fidel (linux-gaming.ru)" | ||||
| msgstr "" | ||||
|  | ||||
| msgid "" | ||||
| @@ -2029,7 +2028,10 @@ msgstr "" | ||||
| msgid "MIT License" | ||||
| msgstr "" | ||||
|  | ||||
| #, sh-format | ||||
| msgid "" | ||||
| "Copyright © $DATE Castro-Fidel (linux-gaming.ru)\n" | ||||
| "\n" | ||||
| "Permission is hereby granted, free of charge, to any person obtaining a " | ||||
| "copy\n" | ||||
| "of this software and associated documentation files (the \"Software\"), to " | ||||
|   | ||||
| @@ -7,8 +7,8 @@ msgid "" | ||||
| msgstr "" | ||||
| "Project-Id-Version: \n" | ||||
| "Report-Msgid-Bugs-To: \n" | ||||
| "POT-Creation-Date: 2024-09-18 01:14+0500\n" | ||||
| "PO-Revision-Date: 2024-09-17 20:12+0500\n" | ||||
| "POT-Creation-Date: 2024-09-18 22:44+0500\n" | ||||
| "PO-Revision-Date: 2024-09-18 22:48+0500\n" | ||||
| "Last-Translator: \n" | ||||
| "Language-Team: \n" | ||||
| "Language: ru_RU\n" | ||||
| @@ -1176,7 +1176,6 @@ msgstr "" | ||||
| msgid "Show temperature in Fahrenheit" | ||||
| msgstr "Показывать температуру в градусах Фаренгейта" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "" | ||||
| "Show if GPU is throttling based on Power, current, temp or other (Only shows " | ||||
| "if throttling is currently happening). Currently disabled by default for " | ||||
| @@ -1377,7 +1376,6 @@ msgstr "" | ||||
| "Включение данной опции помогает исправить зависание или вылетание в " | ||||
| "некоторых играх при сворачивании окна (Glide)" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "" | ||||
| "dgVoodoo2 settings\\n<b>NOTE:</b> To display help for each item, simply " | ||||
| "hover over the text" | ||||
| @@ -1598,27 +1596,25 @@ msgstr "" | ||||
| msgid "Change settings gamescope for" | ||||
| msgstr "Изменить настройки Gamescope для" | ||||
|  | ||||
| #, 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/" | ||||
| "<b>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)</b>" | ||||
| msgstr "" | ||||
| "Gamescope не найден в системе, для его установки выполните команду в " | ||||
| "терминале:\\n flatpak install -y runtime/org.freedesktop.Platform." | ||||
| "VulkanLayer.gamescope/x86_64/" | ||||
| "<b>Gamescope не найден в системе, для его установки выполните команду в " | ||||
| "терминале:\\nflatpak install -y runtime/org.freedesktop.Platform.VulkanLayer." | ||||
| "gamescope/x86_64/${GAMESCOPE_VERSION}\\n(Данный текст можно выделить и " | ||||
| "скопировать)</b>" | ||||
|  | ||||
| msgid "(Can be selected and copied)" | ||||
| msgstr "(можно выделить и скопировать)" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "" | ||||
| "<b>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.</b>" | ||||
| msgstr "" | ||||
| "<b>Gamescope не найден в системе, обратитесь к производителю вашего " | ||||
| "дистрибутива\\n или поищите в Интернете информацию о том, как установить " | ||||
| "дистрибутива\\nили поищите в Интернете информацию о том, как установить " | ||||
| "gamescope в вашей системе</b>" | ||||
|  | ||||
| msgid "Show resolution" | ||||
| @@ -1648,7 +1644,6 @@ msgstr "Ограничение частоты кадров (кадров в се | ||||
| msgid "Mesa vulkan WSI" | ||||
| msgstr "Режим работы окна" | ||||
|  | ||||
| #, fuzzy | ||||
| msgid "" | ||||
| "Overrides the WSI present mode:\n" | ||||
| "fifo - First in, first out. Limits the frame rate + no tearing. (VSync)\n" | ||||
| @@ -1981,8 +1976,9 @@ msgstr "СОХРАНИТЬ" | ||||
| msgid "scripts" | ||||
| msgstr "версия" | ||||
|  | ||||
| msgid "Copyright" | ||||
| msgstr "Авторские права" | ||||
| #, sh-format | ||||
| msgid "Copyright © $DATE Castro-Fidel (linux-gaming.ru)" | ||||
| msgstr "Авторские права © $DATE Castro-Fidel (linux-gaming.ru)" | ||||
|  | ||||
| msgid "" | ||||
| "This program comes with absolutely no warranty.\n" | ||||
| @@ -2003,7 +1999,10 @@ msgstr "" | ||||
| msgid "MIT License" | ||||
| msgstr "Лицензия Массачусетского технологического института (MIT License)" | ||||
|  | ||||
| #, sh-format | ||||
| msgid "" | ||||
| "Copyright © $DATE Castro-Fidel (linux-gaming.ru)\n" | ||||
| "\n" | ||||
| "Permission is hereby granted, free of charge, to any person obtaining a " | ||||
| "copy\n" | ||||
| "of this software and associated documentation files (the \"Software\"), to " | ||||
| @@ -2028,6 +2027,8 @@ msgid "" | ||||
| "THE\n" | ||||
| "SOFTWARE." | ||||
| msgstr "" | ||||
| "Авторские права © $DATE Castro-Fidel (linux-gaming.ru)\n" | ||||
| "\n" | ||||
| "Настоящим предоставляется бесплатное разрешение любому лицу, получившему " | ||||
| "копию данного\n" | ||||
| "программного обеспечения и связанных с ним файлов документации (Программное\n" | ||||
| @@ -2135,6 +2136,12 @@ msgstr "ПРИСОЕДЕНИТЬСЯ" | ||||
| msgid "THIRD PARTY LIBRARIES" | ||||
| msgstr "БИБЛИОТЕКИ" | ||||
|  | ||||
| #~ msgid "(Can be selected and copied)" | ||||
| #~ msgstr "(можно выделить и скопировать)" | ||||
|  | ||||
| #~ msgid "Copyright" | ||||
| #~ msgstr "Авторские права" | ||||
|  | ||||
| #, sh-format | ||||
| #~ msgid "" | ||||
| #~ "PortProton v. ${install_ver}\n" | ||||
|   | ||||
| @@ -196,11 +196,13 @@ EOF | ||||
|         msgid=${msgid//#*/} | ||||
|         msgid=${msgid//"*"/#_#} | ||||
|         if [[ $msgid != "" ]] ; then | ||||
|             if [[ -n $msgstr ]] ; then | ||||
|                 echo \["$msgid"\]="$msgstr" >> "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" | ||||
|             else | ||||
|                 echo \["$msgid"\]="$msgid" >> "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" | ||||
|             if [[ -z $msgstr ]] ; then | ||||
|                 msgstr="$msgid" | ||||
|             fi | ||||
|             if [[ $msgid =~ "\$" ]] ; then | ||||
|                 msgid=${msgid//"\$"/\\$} | ||||
|             fi | ||||
|             echo \["$msgid"\]="$msgstr" >> "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" | ||||
|         fi | ||||
|         done | ||||
|     done < "$po_file" | ||||
| @@ -4698,9 +4700,7 @@ gui_gamescope () { | ||||
|         done | ||||
|     else | ||||
|         if check_flatpak ; then | ||||
|             GAMESCOPE_VERSION="$(grep 'VERSION_ID=' /etc/os-release)" | ||||
|             GAMESCOPE_VERSION="${GAMESCOPE_VERSION//VERSION_ID=/}" | ||||
|             GAMESCOPE_NEED_INSTALL="<b>${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${translations[(Can be selected and copied)]}</b>" | ||||
|             GAMESCOPE_NEED_INSTALL="${translations[<b>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)</b>]}" | ||||
|             YAD_TEXT_SELECTION="--selectable-labels" | ||||
|         else | ||||
|             GAMESCOPE_NEED_INSTALL="${translations[<b>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.</b>]}" | ||||
| @@ -5836,7 +5836,6 @@ gui_credits () { | ||||
|     # grep ';subscription;' stat-subscriptions.csv | awk -F';' '{print $1}' | sort -u | sed "s/\"//g" > thanks | ||||
|     ######################################################################## | ||||
|     KEY_CREDITS=$RANDOM | ||||
|     DATE=$(date +'%Y') | ||||
|  | ||||
|     # shellcheck source=/dev/null | ||||
|     source "${PORT_WINE_PATH}/data/scripts/thanks" | ||||
| @@ -5845,7 +5844,7 @@ gui_credits () { | ||||
|     --text-align=center --text="PortProton v. ${install_ver} | ||||
| ${translations[scripts]} v. ${scripts_install_ver}" --text-info <<< "https://linux-gaming.ru | ||||
|  | ||||
| ${translations[Copyright]} © $DATE Castro-Fidel (linux-gaming.ru) | ||||
| ${translations[Copyright © \$DATE Castro-Fidel (linux-gaming.ru)]} | ||||
|  | ||||
| ${translations[This program comes with absolutely no warranty. | ||||
| See the License for details.]}" 2>/dev/null & | ||||
| @@ -5858,9 +5857,9 @@ $(credits_devel)" 2>/dev/null & | ||||
|  | ||||
|     "${pw_yad}" --plug="${KEY_CREDITS}" --tabnum=3 --text-info --scroll <<< "${translations[MIT License]} | ||||
|  | ||||
| ${translations[Copyright]} © $DATE Castro-Fidel (linux-gaming.ru) | ||||
| ${translations[Copyright © \$DATE Castro-Fidel (linux-gaming.ru) | ||||
|  | ||||
| ${translations[Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the \"Software\"), to deal | ||||
| in the Software without restriction, including without limitation the rights | ||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|   | ||||
| @@ -168,6 +168,11 @@ if [[ ! -f "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" ]] ; then | ||||
|     create_translations | ||||
| fi | ||||
|  | ||||
| # для переводов нужно экспортировать переменные заранее | ||||
| DATE=$(date +'%Y') | ||||
| GAMESCOPE_VERSION="$(grep 'VERSION_ID=' /etc/os-release)" | ||||
| GAMESCOPE_VERSION="${GAMESCOPE_VERSION//VERSION_ID=/}" | ||||
|  | ||||
| unset translations | ||||
| # shellcheck source=/dev/null | ||||
| source "${PORT_SCRIPTS_PATH}/translations/$LANGUAGE" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user