diff --git a/data_from_portwine/locales/PortProton.pot b/data_from_portwine/locales/PortProton.pot index ab6490f..c5d5699 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-10-07 07:15+0500\n" + "POT-Creation-Date: 2024-10-07 11:18+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -239,6 +239,9 @@ msgstr "" msgid "hours" msgstr "" +msgid "not known yet" +msgstr "" + msgid "minute" msgstr "" diff --git a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po index 4c4fbfa..c8691e7 100644 --- a/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po +++ b/data_from_portwine/locales/es/LC_MESSAGES/PortProton.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 07:15+0500\n" +"POT-Creation-Date: 2024-10-07 10:51+0500\n" "PO-Revision-Date: 2024-09-19 23:35+0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -262,6 +262,9 @@ msgstr "" msgid "hours" msgstr "" +msgid "not known yet" +msgstr "" + msgid "minute" msgstr "" diff --git a/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po b/data_from_portwine/locales/ru/LC_MESSAGES/PortProton.po index 09ac0ae..99087bf 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-10-07 07:15+0500\n" -"PO-Revision-Date: 2024-10-07 07:16+0500\n" +"POT-Creation-Date: 2024-10-07 10:51+0500\n" +"PO-Revision-Date: 2024-10-07 11:18+0500\n" "Last-Translator: \n" "Language-Team: \n" "Language: ru_RU\n" @@ -263,6 +263,9 @@ msgstr "и" msgid "hours" msgstr "часов" +msgid "not known yet" +msgstr "пока неизвестно" + msgid "minute" msgstr "минута" diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index bd22e56..5c52a53 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -836,10 +836,10 @@ seconds_to_time () { local days= elif [[ $days =~ ^1$ ]] ; then local days="$days ${translations[day]}, " - elif [[ $days =~ ^([2-9]1|[1-9][0-9]+1)$ ]] && [[ $LANGUAGE = ru ]] ; then + elif [[ $days =~ ^([2-9]1|[1-9][0-9]+1)$ ]] && [[ $LANGUAGE == ru ]] ; then local days="$days ${translations[day]}, " elif [[ $days =~ ^([2-4]|[2-9][2-4]|[1-9][0-9]+[2-4])$ ]] \ - && [[ $LANGUAGE = ru ]] ; then + && [[ $LANGUAGE == ru ]] ; then local days="$days дня, " else local days="$days ${translations[days]}, " @@ -849,19 +849,28 @@ seconds_to_time () { local hours= elif [[ $hours =~ ^1$ ]] ; then local hours="$hours ${translations[hour]} ${translations[and]} " - elif [[ $hours =~ ^([2-4]|2[2-4])$ ]] && [[ $LANGUAGE = ru ]] ; then + elif [[ $hours =~ ^([2-4]|2[2-4])$ ]] && [[ $LANGUAGE == ru ]] ; then local hours="$hours часа ${translations[and]} " - elif [[ $hours =~ ^21$ ]] && [[ $LANGUAGE = ru ]] ; then + elif [[ $hours =~ ^21$ ]] && [[ $LANGUAGE == ru ]] ; then local hours="$hours ${translations[hour]} ${translations[and]} " else local hours="$hours ${translations[hours]} ${translations[and]} " fi - if [[ $minutes =~ ^1$ ]] ; then + if [[ $minutes =~ ^0$ ]] ; then + local hours=${hours//" ${translations[and]} "/} + local minutes= + if [[ $days == "" ]] || [[ $hours == "" ]] ; then + local days=${days//","/} + fi + if [[ $days == "" ]] && [[ $hours == "" ]] ; then + local minutes="${translations[not known yet]}" + fi + elif [[ $minutes =~ ^1$ ]] ; then local minutes="$minutes ${translations[minute]}" - elif [[ $minutes =~ ^[2-5]1$ ]] && [[ $LANGUAGE = ru ]] ; then + elif [[ $minutes =~ ^[2-5]1$ ]] && [[ $LANGUAGE == ru ]] ; then local minutes="$minutes ${translations[minute]}" - elif [[ $minutes =~ ^([2-4]|[2-5][2-4])$ ]] && [[ $LANGUAGE = ru ]] ; then + elif [[ $minutes =~ ^([2-4]|[2-5][2-4])$ ]] && [[ $LANGUAGE == ru ]] ; then local minutes="$minutes минуты" else local minutes="$minutes ${translations[minutes]}"