From 974549b1af7addc84b8012926f03188ec74b625d Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 8 Nov 2021 20:36:41 +0400 Subject: [PATCH 1/9] Removed technosoft2000 docker container --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index bfb4688d..666becdb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -31,7 +31,7 @@ If applicable, add screenshots to help explain your problem. - OS: [e.g. Windows 10/Raspberry Pi OS] - Python version: [e.g. python2.7] - Calibre-Web version: [e.g. 0.6.8 or 087c4c59 (git rev-parse --short HEAD)]: - - Docker container: [None/Technosoft2000/LinuxServer]: + - Docker container: [None/LinuxServer]: - Special Hardware: [e.g. Rasperry Pi Zero] - Browser: [e.g. Chrome 83.0.4103.97, Safari 13.3.7, Firefox 68.0.1 ESR] From 01cc97c1b2f8277b020c0212e024c9e3f208d4ff Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 11:32:43 +0100 Subject: [PATCH 2/9] =?UTF-8?q?Added=20langugae=20support=20for=20Chol?= =?UTF-8?q?=C3=B3n=20(fixes=20#2183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cps/isoLanguages.py | 8 ++++++- cps/iso_language_names.py | 20 ++++++++++++++++++ cps/translations/cs/LC_MESSAGES/messages.mo | Bin 39918 -> 39918 bytes cps/translations/cs/LC_MESSAGES/messages.po | 2 +- cps/translations/de/LC_MESSAGES/messages.mo | Bin 54015 -> 54015 bytes cps/translations/de/LC_MESSAGES/messages.po | 2 +- cps/translations/el/LC_MESSAGES/messages.mo | Bin 58278 -> 58278 bytes cps/translations/el/LC_MESSAGES/messages.po | 2 +- cps/translations/es/LC_MESSAGES/messages.mo | Bin 51719 -> 51719 bytes cps/translations/es/LC_MESSAGES/messages.po | 2 +- cps/translations/fi/LC_MESSAGES/messages.mo | Bin 27816 -> 27816 bytes cps/translations/fi/LC_MESSAGES/messages.po | 2 +- cps/translations/fr/LC_MESSAGES/messages.mo | Bin 54095 -> 54095 bytes cps/translations/fr/LC_MESSAGES/messages.po | 2 +- cps/translations/hu/LC_MESSAGES/messages.mo | Bin 25588 -> 25588 bytes cps/translations/hu/LC_MESSAGES/messages.po | 2 +- cps/translations/it/LC_MESSAGES/messages.mo | Bin 56691 -> 56691 bytes cps/translations/it/LC_MESSAGES/messages.po | 2 +- cps/translations/ja/LC_MESSAGES/messages.mo | Bin 20280 -> 20280 bytes cps/translations/ja/LC_MESSAGES/messages.po | 2 +- cps/translations/km/LC_MESSAGES/messages.mo | Bin 24788 -> 24788 bytes cps/translations/km/LC_MESSAGES/messages.po | 2 +- cps/translations/nl/LC_MESSAGES/messages.mo | Bin 50897 -> 50897 bytes cps/translations/nl/LC_MESSAGES/messages.po | 2 +- cps/translations/pl/LC_MESSAGES/messages.mo | Bin 52799 -> 52799 bytes cps/translations/pl/LC_MESSAGES/messages.po | 2 +- .../pt_BR/LC_MESSAGES/messages.mo | Bin 47339 -> 47339 bytes .../pt_BR/LC_MESSAGES/messages.po | 2 +- cps/translations/ru/LC_MESSAGES/messages.mo | Bin 48412 -> 48412 bytes cps/translations/ru/LC_MESSAGES/messages.po | 2 +- cps/translations/sv/LC_MESSAGES/messages.mo | Bin 49146 -> 49146 bytes cps/translations/sv/LC_MESSAGES/messages.po | 2 +- cps/translations/tr/LC_MESSAGES/messages.mo | Bin 23171 -> 23171 bytes cps/translations/tr/LC_MESSAGES/messages.po | 2 +- cps/translations/uk/LC_MESSAGES/messages.mo | Bin 18235 -> 18235 bytes cps/translations/uk/LC_MESSAGES/messages.po | 2 +- .../zh_Hans_CN/LC_MESSAGES/messages.mo | Bin 48933 -> 48933 bytes .../zh_Hans_CN/LC_MESSAGES/messages.po | 2 +- .../zh_Hant_TW/LC_MESSAGES/messages.mo | Bin 49256 -> 49256 bytes .../zh_Hant_TW/LC_MESSAGES/messages.po | 2 +- messages.pot | 2 +- 41 files changed, 47 insertions(+), 21 deletions(-) diff --git a/cps/isoLanguages.py b/cps/isoLanguages.py index 6c66a583..e220f63e 100644 --- a/cps/isoLanguages.py +++ b/cps/isoLanguages.py @@ -17,6 +17,9 @@ # along with this program. If not, see . from .iso_language_names import LANGUAGE_NAMES as _LANGUAGE_NAMES +from . import logger + +log = logger.create() try: @@ -50,7 +53,10 @@ def get_language_names(locale): def get_language_name(locale, lang_code): - return get_language_names(locale)[lang_code] + try: + return get_language_names(locale)[lang_code] + except KeyError: + log.error('Missing translation for language name: {}'.format(lang_code)) def get_language_codes(locale, language_names, remainder=None): diff --git a/cps/iso_language_names.py b/cps/iso_language_names.py index f30c078d..07848b9c 100644 --- a/cps/iso_language_names.py +++ b/cps/iso_language_names.py @@ -79,6 +79,7 @@ LANGUAGE_NAMES = { "cho": "choctawština", "chp": "čipeva", "chr": "čerokézština", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "čuvaština", "chy": "čejenština", @@ -499,6 +500,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyan", "chr": "Cherokee", + "cht": "Cholón", "chu": "Altkirchenslawisch", "chv": "Tschuwaschisch", "chy": "Cheyenne", @@ -916,6 +918,7 @@ LANGUAGE_NAMES = { "chn": "Chinook jargon", "chp": "Chipewyan", "cho": "Choctaw", + "cht": "Cholón", "chk": "Chuukese", "chv": "Chuvash", "cop": "Κοπτικά", @@ -1294,6 +1297,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyan", "chr": "Cheroqui", + "cht": "Cholón", "chu": "Eslavo antiguo", "chv": "Chuvasio", "chy": "Cheyenne", @@ -1714,6 +1718,7 @@ LANGUAGE_NAMES = { "cho": "choctaw", "chp": "chipewyan", "chr": "cherokee", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "tšuvassi", "chy": "cheyenne", @@ -2134,6 +2139,7 @@ LANGUAGE_NAMES = { "cho": "choctaw", "chp": "chipewyan", "chr": "cherokee", + "cht": "cholón", "chu": "slavon; ancien", "chv": "tchouvache", "chy": "cheyenne", @@ -2554,6 +2560,7 @@ LANGUAGE_NAMES = { "cho": "csoktó", "chp": "csippeva", "chr": "cserokí", + "cht": "Cholón", "chu": "szláv; ószláv", "chv": "csuvas", "chy": "csejen", @@ -2974,6 +2981,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyan", "chr": "Cherokee", + "cht": "Cholón", "chu": "Slavo antico", "chv": "Chuvash", "chy": "Cheyenne", @@ -3394,6 +3402,7 @@ LANGUAGE_NAMES = { "cho": "チョクトー語", "chp": "チペワイアン語", "chr": "チェロキー語", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "チュヴァシュ語", "chy": "シャイアン語", @@ -3814,6 +3823,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyan", "chr": "Cherokee", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "Chuvash", "chy": "Cheyenne", @@ -4234,6 +4244,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyaans", "chr": "Cherokee", + "cht": "Cholón", "chu": "Slavisch; oud (kerk)", "chv": "Tsjoevasjisch", "chy": "Cheyenne", @@ -4654,6 +4665,7 @@ LANGUAGE_NAMES = { "cho": "czoktaw", "chp": "chipewyan", "chr": "czerokeski", + "cht": "Cholón", "chu": "starosłowiański", "chv": "czuwaski", "chy": "czejeński", @@ -5071,6 +5083,7 @@ LANGUAGE_NAMES = { "chn": "Chinook jargon", "chp": "Chipewyan", "cho": "Choctaw", + "cht": "Cholón", "chk": "Chuukese", "chv": "Chuvash", "cop": "Coptic", @@ -5447,6 +5460,7 @@ LANGUAGE_NAMES = { "cho": "Чоктав", "chp": "Чипевианский", "chr": "Чероки", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "Чувашский", "chy": "Чейенн", @@ -5867,6 +5881,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chopi", "chr": "Cherokesiska", + "cht": "Cholón", "chu": "Slavonic; antik", "chv": "Tjuvasjiska", "chy": "Cheyenne", @@ -6284,6 +6299,7 @@ LANGUAGE_NAMES = { "chn": "Chinook lehçesi (Kuzey Batı Amerika kıyıları)", "chp": "Chipewyan (Kuzey Amerika yerlileri)", "cho": "Choctaw (Kuzey Amerika yerlileri)", + "cht": "Cholón", "chk": "Chuukese", "chv": "Çuvaş (Türkçe)", "cop": "Kıptice (Eski Mısır)", @@ -6660,6 +6676,7 @@ LANGUAGE_NAMES = { "cho": "чоктау", "chp": "чипев’ян", "chr": "черокі", + "cht": "чолон", "chu": "давньослов’янська", "chv": "чуваська", "chy": "шаєнн", @@ -7080,6 +7097,7 @@ LANGUAGE_NAMES = { "cho": "乔克托语", "chp": "奇佩维安语", "chr": "切罗基语", + "cht": "Cholón", "chu": "斯拉夫语(古教会)", "chv": "楚瓦什语", "chy": "夏延语", @@ -7497,6 +7515,7 @@ LANGUAGE_NAMES = { "chn": "Chinook jargon", "chp": "Chipewyan", "cho": "Choctaw", + "cht": "Cholón", "chk": "Chuukese", "chv": "Chuvash", "cop": "Coptic", @@ -7873,6 +7892,7 @@ LANGUAGE_NAMES = { "cho": "Choctaw", "chp": "Chipewyan", "chr": "Cherokee", + "cht": "Cholón", "chu": "Slavonic; Old", "chv": "Chuvash", "chy": "Cheyenne", diff --git a/cps/translations/cs/LC_MESSAGES/messages.mo b/cps/translations/cs/LC_MESSAGES/messages.mo index 25e96a8a796d89ce2c0c00fb1b4690e6aaeefe78..2168e8beed52c7e3b86d6f0a8383b40e93d27496 100644 GIT binary patch delta 28 kcmaF2o$1|nrVV={c@1@q3=|9vt&B{x4GcG*j8t_30HNjy%K!iX delta 28 kcmaF2o$1|nrVV={c@1=p4HOK`tc=aI4U9IQj8t_30HR9?)c^nh diff --git a/cps/translations/cs/LC_MESSAGES/messages.po b/cps/translations/cs/LC_MESSAGES/messages.po index aae4010a..3c8875ed 100644 --- a/cps/translations/cs/LC_MESSAGES/messages.po +++ b/cps/translations/cs/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-06-09 21:11+0100\n" "Last-Translator: Lukas Heroudek \n" "Language: cs_CZ\n" diff --git a/cps/translations/de/LC_MESSAGES/messages.mo b/cps/translations/de/LC_MESSAGES/messages.mo index 2ef8abd569813c27ccc74e32c2d4a3eb9552b3f9..4ad26e6b201e9adae0fa7e01569f612b5d1bb952 100644 GIT binary patch delta 28 kcmeyrl==Ts<_*)zc@1@q3=|9vt&B{x4GcFgE{}-@0HKKr3jhEB delta 28 kcmeyrl==Ts<_*)zc@1=p4HOK`tc=aI4U9G~E{}-@0HN**6#xJL diff --git a/cps/translations/de/LC_MESSAGES/messages.po b/cps/translations/de/LC_MESSAGES/messages.po index 36ac1f07..823c2aa7 100644 --- a/cps/translations/de/LC_MESSAGES/messages.po +++ b/cps/translations/de/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2021-08-01 17:24+0200\n" "Last-Translator: Ozzie Isaacs\n" "Language: de\n" diff --git a/cps/translations/el/LC_MESSAGES/messages.mo b/cps/translations/el/LC_MESSAGES/messages.mo index df183dd4ffdd038064d747302df7df36ad1d74b6..fe3cf95661e79caf882ba50d2a788ecf8a852cb1 100644 GIT binary patch delta 28 jcmZ2>oO#)C<_($gyoS0)1`39TRz@b;28Nr<;tg5=k0uEa delta 28 jcmZ2>oO#)C<_($gyau|)1`38|R>tPq21c99;tg5=kBbQ! diff --git a/cps/translations/el/LC_MESSAGES/messages.po b/cps/translations/el/LC_MESSAGES/messages.po index b342fe67..fad7c698 100644 --- a/cps/translations/el/LC_MESSAGES/messages.po +++ b/cps/translations/el/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Depountis Georgios\n" "Language: el\n" diff --git a/cps/translations/es/LC_MESSAGES/messages.mo b/cps/translations/es/LC_MESSAGES/messages.mo index 9b2bd54910f798a2db53faed4cd481d91536a863..99318bb3349c4f051e35a547b01ecdb816c3043a 100644 GIT binary patch delta 28 jcmZpl!rVTEdBeg2UPE0Y0|i4vD\n" "Language: es\n" diff --git a/cps/translations/fi/LC_MESSAGES/messages.mo b/cps/translations/fi/LC_MESSAGES/messages.mo index a18b2a07177e547f9ea53e50b8721e179cac13f6..1754e51a94d44f57457a6b1a14bd34fcd815478b 100644 GIT binary patch delta 28 jcmZ2+lX1mO#tmK$yoS0)1`39TRz@b;28Nr%9RhU#jNS-= delta 28 jcmZ2+lX1mO#tmK$yau|)1`38|R>tPq21c919RhU#jY9~F diff --git a/cps/translations/fi/LC_MESSAGES/messages.po b/cps/translations/fi/LC_MESSAGES/messages.po index ef6be878..58d16924 100644 --- a/cps/translations/fi/LC_MESSAGES/messages.po +++ b/cps/translations/fi/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-01-12 13:56+0100\n" "Last-Translator: Samuli Valavuo \n" "Language: fi\n" diff --git a/cps/translations/fr/LC_MESSAGES/messages.mo b/cps/translations/fr/LC_MESSAGES/messages.mo index a3a331ace51d9936e57233662e48eee967c4b14f..df93858a2e854a108a571de62748f19403193512 100644 GIT binary patch delta 28 kcmX@VjQRXB<_)0*yoS0)1`39TRz@b;28NrH3f?9G0FnC%wEzGB delta 28 kcmX@VjQRXB<_)0*yau|)1`38|R>tPq21c8c3f?9G0Fqz{zW@LL diff --git a/cps/translations/fr/LC_MESSAGES/messages.po b/cps/translations/fr/LC_MESSAGES/messages.po index d37e6a48..ad302c5f 100644 --- a/cps/translations/fr/LC_MESSAGES/messages.po +++ b/cps/translations/fr/LC_MESSAGES/messages.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-06-07 06:47+0200\n" "Last-Translator: \n" "Language: fr\n" diff --git a/cps/translations/hu/LC_MESSAGES/messages.mo b/cps/translations/hu/LC_MESSAGES/messages.mo index fe9d4ea4e29005d758f57dbc6d8712ce4ec8fa58..cd2790bb24ea546765b285bd6d8675ad8ffb6b4a 100644 GIT binary patch delta 28 kcmexzobk(X#tm)eyoS0)1`39TRz@b;28Np_ntPq21c7FntPq21c9pD_v3mm{bWg diff --git a/cps/translations/it/LC_MESSAGES/messages.po b/cps/translations/it/LC_MESSAGES/messages.po index 28fc1f55..879a4cba 100644 --- a/cps/translations/it/LC_MESSAGES/messages.po +++ b/cps/translations/it/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2017-04-04 15:09+0200\n" "Last-Translator: ElQuimm \n" "Language: it\n" diff --git a/cps/translations/ja/LC_MESSAGES/messages.mo b/cps/translations/ja/LC_MESSAGES/messages.mo index e2a31863c73592b54c826930586e884ccfdc8580..35e759cf8829599e4ba14d3d1f5c6d311bf42d9b 100644 GIT binary patch delta 28 kcmdlnk8#I5#tlB&yoS0)1`39TRz@b;28Np>weKqf0E5p6iU0rr delta 28 kcmdlnk8#I5#tlB&yau|)1`38|R>tPq21c7BweKqf0E9FMlmGw# diff --git a/cps/translations/ja/LC_MESSAGES/messages.po b/cps/translations/ja/LC_MESSAGES/messages.po index 51397ef3..ca070588 100644 --- a/cps/translations/ja/LC_MESSAGES/messages.po +++ b/cps/translations/ja/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2018-02-07 02:20-0500\n" "Last-Translator: white \n" "Language: ja\n" diff --git a/cps/translations/km/LC_MESSAGES/messages.mo b/cps/translations/km/LC_MESSAGES/messages.mo index db947f4717a46074a607b7e126b7f623d9a4e0fd..91e2659d302c2e52bf6d614fe149101f8d82dfdb 100644 GIT binary patch delta 28 kcmca|knzev#tovXyoS0)1`39TRz@b;28NrJR5w`z0E%e{c>n+a delta 28 kcmca|knzev#tovXyau|)1`38|R>tPq21c8eR5w`z0E*5Cg8%>k diff --git a/cps/translations/km/LC_MESSAGES/messages.po b/cps/translations/km/LC_MESSAGES/messages.po index 2ca8c703..1a1cc094 100644 --- a/cps/translations/km/LC_MESSAGES/messages.po +++ b/cps/translations/km/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2018-08-27 17:06+0700\n" "Last-Translator: \n" "Language: km_KH\n" diff --git a/cps/translations/nl/LC_MESSAGES/messages.mo b/cps/translations/nl/LC_MESSAGES/messages.mo index 6673b8ccb44d6f832b077baab4a7a1f9f9686b8c..fb07d0353c1ad74ae2308d875a1e52d672a6cdd7 100644 GIT binary patch delta 28 jcmccE%Y3nydBg4^UPE0Y0|i4vD\n" "Language: nl\n" diff --git a/cps/translations/pl/LC_MESSAGES/messages.mo b/cps/translations/pl/LC_MESSAGES/messages.mo index 154d674461c515f4d5d4dee7c7c04ab12c603738..d9f9d7a3c4bd2ef2284da1474c1db443f09e9dc0 100644 GIT binary patch delta 28 kcmdl#hk5@T<_$%~yoS0)1`39TRz@b;28NsKiw{Hr0FPw}i~s-t delta 28 kcmdl#hk5@T<_$%~yau|)1`38|R>tPq21c9fiw{Hr0FTNEmH+?% diff --git a/cps/translations/pl/LC_MESSAGES/messages.po b/cps/translations/pl/LC_MESSAGES/messages.po index ede1c2c6..e50d7f9b 100644 --- a/cps/translations/pl/LC_MESSAGES/messages.po +++ b/cps/translations/pl/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre Web - polski (POT: 2021-06-12 08:52)\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2021-06-12 15:35+0200\n" "Last-Translator: Radosław Kierznowski \n" "Language: pl\n" diff --git a/cps/translations/pt_BR/LC_MESSAGES/messages.mo b/cps/translations/pt_BR/LC_MESSAGES/messages.mo index f8c48f768e59886000c41d88381e6bd81cd3e24e..47fddac2753e77a66f8c6edf11b3745a65bb19f4 100644 GIT binary patch delta 28 jcmaF;k?HkErVT;qyoS0)1`39TRz@b;28NsC(|ZB|q?!r$ delta 28 jcmaF;k?HkErVT;qyau|)1`38|R>tPq21c9X(|ZB|r2h&5 diff --git a/cps/translations/pt_BR/LC_MESSAGES/messages.po b/cps/translations/pt_BR/LC_MESSAGES/messages.po index 98c7df5e..6a9a773b 100644 --- a/cps/translations/pt_BR/LC_MESSAGES/messages.po +++ b/cps/translations/pt_BR/LC_MESSAGES/messages.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: br\n" diff --git a/cps/translations/ru/LC_MESSAGES/messages.mo b/cps/translations/ru/LC_MESSAGES/messages.mo index c401e488d251bd9e8035346c284e180ed6ea613b..f712f2a541cffea1d7704e20898ba082b316f46a 100644 GIT binary patch delta 28 kcmbR9i)qd;rVSs1cnx)p3=|9vt&B{x4GcH`3zEwM0HW&(DgXcg delta 28 kcmbR9i)qd;rVSs1cnx%o4HOK`tc=aI4U9Jb3zEwM0HaU}Gynhq diff --git a/cps/translations/ru/LC_MESSAGES/messages.po b/cps/translations/ru/LC_MESSAGES/messages.po index 3d3aa11b..705c61ff 100644 --- a/cps/translations/ru/LC_MESSAGES/messages.po +++ b/cps/translations/ru/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-04-29 01:20+0400\n" "Last-Translator: ZIZA\n" "Language: ru\n" diff --git a/cps/translations/sv/LC_MESSAGES/messages.mo b/cps/translations/sv/LC_MESSAGES/messages.mo index b662a3229a88ffaea62006873127fa169db644e2..209d5f4ae401ae71509b2bc7d2fc59642e3d674e 100644 GIT binary patch delta 28 kcmezMpXt|srVU#Qcnx)p3=|9vt&B{x4GcFQDzNYe0JKjEvj6}9 delta 28 kcmezMpXt|srVU#Qcnx%o4HOK`tc=aI4U9G)DzNYe0JO9Uy#N3J diff --git a/cps/translations/sv/LC_MESSAGES/messages.po b/cps/translations/sv/LC_MESSAGES/messages.po index cd398e1e..a2e8c72f 100644 --- a/cps/translations/sv/LC_MESSAGES/messages.po +++ b/cps/translations/sv/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2021-05-13 11:00+0000\n" "Last-Translator: Jonatan Nyberg \n" "Language: sv\n" diff --git a/cps/translations/tr/LC_MESSAGES/messages.mo b/cps/translations/tr/LC_MESSAGES/messages.mo index 6e6eeb2be11dad4b958d5899542e9edc2a427dce..410fa7199435ba50882cf72a8e19a0f76440869b 100644 GIT binary patch delta 28 kcmZqP%GkV>al?8OUPE0Y0|i4vDal?8OUISfY0|i4fD`RtQ1EbA*OpdDp0Eiq38UO$Q diff --git a/cps/translations/tr/LC_MESSAGES/messages.po b/cps/translations/tr/LC_MESSAGES/messages.po index 730ac1a7..d108c2c3 100644 --- a/cps/translations/tr/LC_MESSAGES/messages.po +++ b/cps/translations/tr/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-04-23 22:47+0300\n" "Last-Translator: iz \n" "Language: tr\n" diff --git a/cps/translations/uk/LC_MESSAGES/messages.mo b/cps/translations/uk/LC_MESSAGES/messages.mo index f9ac2a902fe245d6ccebb72588b8a76efeeca1a6..1e4731af8aaa839d8ee730f1c15b02d98111642a 100644 GIT binary patch delta 28 jcmdnp$GE$Xal;pRUPE0Y0|i4vDi%$p$ delta 28 jcmdnp$GE$Xal;pRUISfY0|i4fD`RtQ1EbB13Rda>i?j$5 diff --git a/cps/translations/uk/LC_MESSAGES/messages.po b/cps/translations/uk/LC_MESSAGES/messages.po index 7adf1820..131da18f 100644 --- a/cps/translations/uk/LC_MESSAGES/messages.po +++ b/cps/translations/uk/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2017-04-30 00:47+0300\n" "Last-Translator: ABIS Team \n" "Language: uk\n" diff --git a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo index 36b2219185d3bb91d216762f27095b65af4138f4..b529a3588cb1595e29d364d348fac7c51f03b325 100644 GIT binary patch delta 28 kcmZ4bk7?;YrVU0FyoS0)1`39TRz@b;28NsME1tOl0GGoFwg3PC delta 28 kcmZ4bk7?;YrVU0Fyau|)1`38|R>tPq21c9hE1tOl0GKEVzyJUM diff --git a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po index 1e6a39f2..bf46df41 100644 --- a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po +++ b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Calibre-Web\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: 2020-09-27 22:18+0800\n" "Last-Translator: xlivevil \n" "Language: zh_CN\n" diff --git a/cps/translations/zh_Hant_TW/LC_MESSAGES/messages.mo b/cps/translations/zh_Hant_TW/LC_MESSAGES/messages.mo index 38527976b08e17d3b3310e20a141accd55ae5c33..c3dea789fbd5233a95d206d957702bea67c6fd84 100644 GIT binary patch delta 28 kcmaFS!2F_tdBc$kUPE0Y0|i4vD\n" "Language: zh_TW\n" diff --git a/messages.pot b/messages.pot index a84a2abe..b180986a 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-10-30 16:37+0200\n" +"POT-Creation-Date: 2021-11-20 11:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From d624b67e93ab76356afb352bdb8eeb536b28fcff Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 11:57:51 +0100 Subject: [PATCH 3/9] Fix #2174 (default sorting order now is timestamp again) --- cps/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/web.py b/cps/web.py index 94688e47..ea6faf19 100644 --- a/cps/web.py +++ b/cps/web.py @@ -339,7 +339,7 @@ def get_matching_tags(): def get_sort_function(sort, data): - order = [db.Books.sort] + order = [db.Books.timestamp.desc()] if sort == 'stored': sort = current_user.get_view_property(data, 'stored') else: @@ -369,7 +369,7 @@ def get_sort_function(sort, data): if sort == 'hotasc': order = [func.count(ub.Downloads.book_id).asc()] if sort is None: - sort = "abc" + sort = "new" return order, sort From 6f5390ead5df9779ac81fadefffb476e03f93548 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 12:17:03 +0100 Subject: [PATCH 4/9] Changed error message in case of trying to delete a shelf unauthorized Removed outcommented text --- cps/db.py | 9 --------- cps/shelf.py | 8 ++++---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cps/db.py b/cps/db.py index 06a42b8e..800fb3dd 100644 --- a/cps/db.py +++ b/cps/db.py @@ -807,15 +807,6 @@ class CalibreDB(): .group_by(text('books_languages_link.lang_code')).all() for lang in languages: lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code) - #try: - # if lang.lang_code.lower() == "und": - # lang.name = isoLanguages.get_language_name(get_locale(), lang.lang_code) - # # lang.name = _("Undetermined") - # else: - # cur_l = LC.parse(lang.lang_code) - # lang.name = cur_l.get_language_name(get_locale()) - #except UnknownLocaleError: - # lang.name = _(isoLanguages.get(part3=lang.lang_code).name) return languages def update_title_sort(self, config, conn=None): diff --git a/cps/shelf.py b/cps/shelf.py index 09fe8dd4..2c6a17a2 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -122,8 +122,8 @@ def search_to_shelf(shelf_id): return redirect(url_for('web.index')) if not check_shelf_edit_permissions(shelf): - log.warning("You are not allowed to add a book to the the shelf: {}".format(shelf.name)) - flash(_(u"You are not allowed to add a book to the the shelf: %(name)s", name=shelf.name), category="error") + log.warning("You are not allowed to add a book to the shelf".format(shelf.name)) + flash(_(u"You are not allowed to add a book to the shelf"), category="error") return redirect(url_for('web.index')) if current_user.id in ub.searched_ids and ub.searched_ids[current_user.id]: @@ -215,10 +215,10 @@ def remove_from_shelf(shelf_id, book_id): else: if not xhr: log.warning("You are not allowed to remove a book from shelf: {}".format(shelf.name)) - flash(_(u"Sorry you are not allowed to remove a book from this shelf: %(sname)s", sname=shelf.name), + flash(_(u"Sorry you are not allowed to remove a book from this shelf"), category="error") return redirect(url_for('web.index')) - return "Sorry you are not allowed to remove a book from this shelf: %s" % shelf.name, 403 + return "Sorry you are not allowed to remove a book from this shelf", 403 @shelf.route("/shelf/create", methods=["GET", "POST"]) From 6aad9378b8fc8d0edf1b8754593024325d8fe456 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 12:44:34 +0100 Subject: [PATCH 5/9] Fix visiblility upload right on enabled upload feature --- cps/admin.py | 9 +++++++-- cps/templates/admin.html | 4 ++-- cps/templates/config_view_edit.html | 2 +- cps/templates/user_edit.html | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index 557d0255..068ac356 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -1348,7 +1348,9 @@ def _handle_new_user(to_save, content, languages, translations, kobo_support): raise Exception(_(u"E-mail is not from valid domain")) except Exception as ex: flash(str(ex), category="error") - return render_title_template("user_edit.html", new_user=1, content=content, translations=translations, + return render_title_template("user_edit.html", new_user=1, content=content, + config=config, + translations=translations, languages=languages, title=_(u"Add new user"), page="newuser", kobo_support=kobo_support, registered_oauth=oauth_check) try: @@ -1463,6 +1465,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support): kobo_support=kobo_support, new_user=0, content=content, + config=config, registered_oauth=oauth_check, title=_(u"Edit User %(nick)s", nick=content.name), page="edituser") @@ -1496,7 +1499,8 @@ def new_user(): content.sidebar_view = config.config_default_show content.locale = config.config_default_locale content.default_language = config.config_default_language - return render_title_template("user_edit.html", new_user=1, content=content, translations=translations, + return render_title_template("user_edit.html", new_user=1, content=content, + config=config, translations=translations, languages=languages, title=_(u"Add new user"), page="newuser", kobo_support=kobo_support, registered_oauth=oauth_check) @@ -1584,6 +1588,7 @@ def edit_user(user_id): languages=languages, new_user=0, content=content, + config=config, registered_oauth=oauth_check, mail_configured=config.get_mail_server_configured(), kobo_support=kobo_support, diff --git a/cps/templates/admin.html b/cps/templates/admin.html index f99c0938..9728cb6d 100644 --- a/cps/templates/admin.html +++ b/cps/templates/admin.html @@ -16,7 +16,7 @@ {{_('Downloads')}} {{_('Admin')}} {{_('Password')}} - {% if config.config_upload %} + {% if config.config_uploading %} {{_('Upload')}} {% endif %} {{_('Download')}} @@ -34,7 +34,7 @@ {{user.downloads.count()}} {{ display_bool_setting(user.role_admin()) }} {{ display_bool_setting(user.role_passwd()) }} - {% if config.config_upload %} + {% if config.config_uploading %} {{ display_bool_setting(user.role_upload()) }} {% endif %} {{ display_bool_setting(user.role_download()) }} diff --git a/cps/templates/config_view_edit.html b/cps/templates/config_view_edit.html index 32509e88..1dc02a5e 100644 --- a/cps/templates/config_view_edit.html +++ b/cps/templates/config_view_edit.html @@ -95,7 +95,7 @@ - {% if config.config_upload %} + {% if conf.config_uploading %}
diff --git a/cps/templates/user_edit.html b/cps/templates/user_edit.html index 2729a168..edecbaf2 100644 --- a/cps/templates/user_edit.html +++ b/cps/templates/user_edit.html @@ -101,7 +101,7 @@
- {% if config.config_upload %} + {% if config.config_uploading %}
From bcdc97641447965af486964537f3821f47b28874 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 13:00:54 +0100 Subject: [PATCH 6/9] Added missing check for creating public shelfs --- cps/shelf.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cps/shelf.py b/cps/shelf.py index 2c6a17a2..97147a71 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -224,8 +224,13 @@ def remove_from_shelf(shelf_id, book_id): @shelf.route("/shelf/create", methods=["GET", "POST"]) @login_required def create_shelf(): - shelf = ub.Shelf() - return create_edit_shelf(shelf, page_title=_(u"Create a Shelf"), page="shelfcreate") + if not current_user.role_edit_shelfs() and request.method == 'POST': + flash(_(u"Sorry you are not allowed to create a public shelf"), category="error") + return redirect(url_for('web.index')) + else: + shelf = ub.Shelf() + return create_edit_shelf(shelf, page_title=_(u"Create a Shelf"), page="shelfcreate") + @shelf.route("/shelf/edit/", methods=["GET", "POST"]) From 7ad419dc8c12180e842a82118f4866ac3d074bc5 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 13:40:23 +0100 Subject: [PATCH 7/9] Fix upload of cover and book formats containing html characters --- cps/static/js/edit_books.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index ddc7a3e7..0bfe078c 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -248,7 +248,7 @@ $("#btn-upload-format").on("change", function () { if (filename.substring(3, 11) === "fakepath") { filename = filename.substring(12); } // Remove c:\fake at beginning from localhost chrome - $("#upload-format").html(filename); + $("#upload-format").text(filename); }); $("#btn-upload-cover").on("change", function () { @@ -256,7 +256,7 @@ $("#btn-upload-cover").on("change", function () { if (filename.substring(3, 11) === "fakepath") { filename = filename.substring(12); } // Remove c:\fake at beginning from localhost chrome - $("#upload-cover").html(filename); + $("#upload-cover").text(filename); }); $("#xchange").click(function () { From 5ede0794018bfb54af58aaa7b08bd7d6a3972d9a Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Nov 2021 13:45:41 +0100 Subject: [PATCH 8/9] Handling of invalid cover files on upload --- cps/helper.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index df7019e6..08970d0f 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -63,7 +63,7 @@ log = logger.create() try: from wand.image import Image - from wand.exceptions import MissingDelegateError + from wand.exceptions import MissingDelegateError, BlobError use_IM = True except (ImportError, RuntimeError) as e: log.debug('Cannot import Image, generating covers from non jpg files will not work: %s', e) @@ -638,13 +638,17 @@ def save_cover(img, book_path): return False, _("Only jpg/jpeg/png/webp/bmp files are supported as coverfile") # convert to jpg because calibre only supports jpg if content_type != 'image/jpg': - if hasattr(img, 'stream'): - imgc = Image(blob=img.stream) - else: - imgc = Image(blob=io.BytesIO(img.content)) - imgc.format = 'jpeg' - imgc.transform_colorspace("rgb") - img = imgc + try: + if hasattr(img, 'stream'): + imgc = Image(blob=img.stream) + else: + imgc = Image(blob=io.BytesIO(img.content)) + imgc.format = 'jpeg' + imgc.transform_colorspace("rgb") + img = imgc + except BlobError: + log.error("Invalid cover file content") + return False, _("Invalid cover file content") else: if content_type not in 'image/jpeg': log.error("Only jpg/jpeg files are supported as coverfile") From 927384306223e1be94b1fc205bee2b69a67b32cf Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 21 Nov 2021 09:13:26 +0100 Subject: [PATCH 9/9] Removed double declared functions --- cps/ub.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/cps/ub.py b/cps/ub.py index 69ea55f6..405b0865 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -62,27 +62,13 @@ searched_ids = {} logged_in = dict() -def store_user_session(): - if flask_session.get('_user_id', ""): - if logged_in.get(flask_session.get('_user_id', "")): - logged_in[flask_session.get('_user_id', "")].append(flask_session.get('_id', "")) - else: - logged_in[flask_session.get('_user_id', "")] = [flask_session.get('_id', "")] - log.info(flask_session.get('_id', "")) - -def delete_user_session(user_id, session_key): - try: - logged_in.get(str(user_id), []).remove(session_key) - except ValueError: - pass - -def check_user_session(user_id, session_key): - return session_key in logged_in.get(str(user_id), []) def signal_store_user_session(object, user): store_user_session() def store_user_session(): + if flask_session.get('user_id', ""): + flask_session['_user_id'] = flask_session.get('user_id', "") if flask_session.get('_user_id', ""): try: if not check_user_session(flask_session.get('_user_id', ""), flask_session.get('_id', "")):