Skip to content

Commit 0ea2b5d

Browse files
Changed translations notification to use language name instead of code and made it so that the language names are also translatable strings
1 parent d69ed68 commit 0ea2b5d

29 files changed

Lines changed: 3030 additions & 29 deletions

File tree

cps/constants.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,34 @@ def selected_roles(dictionary):
194194

195195
# clean-up the module namespace
196196
del sys, os, namedtuple
197+
198+
# Mapping of language codes to full language names
199+
LANGUAGE_NAMES = {
200+
"cs": _("Czech"),
201+
"de": _("German"),
202+
"el": _("Greek"),
203+
"es": _("Spanish"),
204+
"fi": _("Finnish"),
205+
"fr": _("French"),
206+
"gl": _("Galician"),
207+
"hu": _("Hungarian"),
208+
"id": _("Indonesian"),
209+
"it": _("Italian"),
210+
"ja": _("Japanese"),
211+
"km": _("Khmer"),
212+
"ko": _("Korean"),
213+
"nl": _("Dutch"),
214+
"no": _("Norwegian"),
215+
"pl": _("Polish"),
216+
"pt": _("Portuguese"),
217+
"pt_BR": _("Portuguese (Brazil)"),
218+
"ru": _("Russian"),
219+
"sk": _("Slovak"),
220+
"sl": _("Slovenian"),
221+
"sv": _("Swedish"),
222+
"tr": _("Turkish"),
223+
"uk": _("Ukrainian"),
224+
"vi": _("Vietnamese"),
225+
"zh_Hans_CN": _("Chinese (Simplified, China)"),
226+
"zh_Hant_TW": _("Chinese (Traditional, Taiwan)"),
227+
}

cps/render_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def cwa_update_notification() -> None:
153153

154154
update_available, current_version, tag_name = cwa_update_available()
155155
if update_available:
156-
message = f"⚡🚨 CWA UPDATE AVAILABLE! 🚨⚡ Current - {current_version} | Newest - {tag_name} | To update, just re-pull the image! This message will only display once per day |"
156+
message = _(f"⚡🚨 CWA UPDATE AVAILABLE! 🚨⚡ Current - {current_version} | Newest - {tag_name} | To update, just re-pull the image! This message will only display once per day |")
157157
flash(_(message), category="cwa_update")
158158
print(f"[cwa-update-notification-service] {message}", flush=True)
159159

@@ -191,7 +191,7 @@ def translations_missing_notification() -> None:
191191
with open(notice_file, 'r') as f:
192192
last_notification = f.read().strip()
193193
if last_notification != current_date:
194-
message = _(f"🌐 Help improve {lang} translations! {missing_count} strings in your language need translation. ")
194+
message = _(f"🌐 Help improve CWA's {constants.LANGUAGE_NAMES.get(lang, lang)} translations! {missing_count} strings in your language need translation. ")
195195
flash(message, category="translation_missing")
196196
print(f"[translation-notification-service] {message}", flush=True)
197197
with open(notice_file, 'w') as f:

cps/translations/cs/LC_MESSAGES/messages.po

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: Calibre-Web Automated\n"
88
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
9-
"POT-Creation-Date: 2025-08-06 11:34+0200\n"
9+
"POT-Creation-Date: 2025-08-06 18:17+0200\n"
1010
"PO-Revision-Date: 2020-06-09 21:11+0100\n"
1111
"Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n"
1212
"Language-Team: \n"
@@ -554,6 +554,116 @@ msgstr ""
554554
msgid "User '%(nick)s' updated"
555555
msgstr "Uživatel '%(nick)s' aktualizován"
556556

557+
#: cps/constants.py:200
558+
msgid "Czech"
559+
msgstr ""
560+
561+
#: cps/constants.py:201
562+
msgid "German"
563+
msgstr ""
564+
565+
#: cps/constants.py:202
566+
msgid "Greek"
567+
msgstr ""
568+
569+
#: cps/constants.py:203
570+
msgid "Spanish"
571+
msgstr ""
572+
573+
#: cps/constants.py:204
574+
#, fuzzy
575+
msgid "Finnish"
576+
msgstr "Dokončeno"
577+
578+
#: cps/constants.py:205
579+
msgid "French"
580+
msgstr ""
581+
582+
#: cps/constants.py:206
583+
msgid "Galician"
584+
msgstr ""
585+
586+
#: cps/constants.py:207
587+
msgid "Hungarian"
588+
msgstr ""
589+
590+
#: cps/constants.py:208
591+
msgid "Indonesian"
592+
msgstr ""
593+
594+
#: cps/constants.py:209
595+
msgid "Italian"
596+
msgstr ""
597+
598+
#: cps/constants.py:210
599+
msgid "Japanese"
600+
msgstr ""
601+
602+
#: cps/constants.py:211
603+
msgid "Khmer"
604+
msgstr ""
605+
606+
#: cps/constants.py:212
607+
msgid "Korean"
608+
msgstr ""
609+
610+
#: cps/constants.py:213
611+
msgid "Dutch"
612+
msgstr ""
613+
614+
#: cps/constants.py:214
615+
msgid "Norwegian"
616+
msgstr ""
617+
618+
#: cps/constants.py:215
619+
#, fuzzy
620+
msgid "Polish"
621+
msgstr "Vydavatel"
622+
623+
#: cps/constants.py:216
624+
msgid "Portuguese"
625+
msgstr ""
626+
627+
#: cps/constants.py:217
628+
msgid "Portuguese (Brazil)"
629+
msgstr ""
630+
631+
#: cps/constants.py:218
632+
msgid "Russian"
633+
msgstr ""
634+
635+
#: cps/constants.py:219
636+
msgid "Slovak"
637+
msgstr ""
638+
639+
#: cps/constants.py:220
640+
msgid "Slovenian"
641+
msgstr ""
642+
643+
#: cps/constants.py:221
644+
msgid "Swedish"
645+
msgstr ""
646+
647+
#: cps/constants.py:222
648+
msgid "Turkish"
649+
msgstr ""
650+
651+
#: cps/constants.py:223
652+
msgid "Ukrainian"
653+
msgstr ""
654+
655+
#: cps/constants.py:224
656+
msgid "Vietnamese"
657+
msgstr ""
658+
659+
#: cps/constants.py:225
660+
msgid "Chinese (Simplified, China)"
661+
msgstr ""
662+
663+
#: cps/constants.py:226
664+
msgid "Chinese (Traditional, Taiwan)"
665+
msgstr ""
666+
557667
#: cps/converter.py:31
558668
msgid "not installed"
559669
msgstr "není nainstalováno"

cps/translations/de/LC_MESSAGES/messages.po

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: Calibre-Web Automated\n"
44
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
5-
"POT-Creation-Date: 2025-08-06 11:34+0200\n"
5+
"POT-Creation-Date: 2025-08-06 18:17+0200\n"
66
"PO-Revision-Date: 2025-08-05 13:11+0000\n"
77
"Last-Translator: Crocodilestick\n"
88
"Language-Team: German\n"
@@ -565,6 +565,116 @@ msgstr "E-Mail kann nicht leer sein und muss gültig sein"
565565
msgid "User '%(nick)s' updated"
566566
msgstr "Benutzer '%(nick)s' aktualisiert"
567567

568+
#: cps/constants.py:200
569+
msgid "Czech"
570+
msgstr ""
571+
572+
#: cps/constants.py:201
573+
msgid "German"
574+
msgstr ""
575+
576+
#: cps/constants.py:202
577+
msgid "Greek"
578+
msgstr ""
579+
580+
#: cps/constants.py:203
581+
msgid "Spanish"
582+
msgstr ""
583+
584+
#: cps/constants.py:204
585+
#, fuzzy
586+
msgid "Finnish"
587+
msgstr "Fertiggestellt"
588+
589+
#: cps/constants.py:205
590+
msgid "French"
591+
msgstr ""
592+
593+
#: cps/constants.py:206
594+
msgid "Galician"
595+
msgstr ""
596+
597+
#: cps/constants.py:207
598+
msgid "Hungarian"
599+
msgstr ""
600+
601+
#: cps/constants.py:208
602+
msgid "Indonesian"
603+
msgstr ""
604+
605+
#: cps/constants.py:209
606+
msgid "Italian"
607+
msgstr ""
608+
609+
#: cps/constants.py:210
610+
msgid "Japanese"
611+
msgstr ""
612+
613+
#: cps/constants.py:211
614+
msgid "Khmer"
615+
msgstr ""
616+
617+
#: cps/constants.py:212
618+
msgid "Korean"
619+
msgstr ""
620+
621+
#: cps/constants.py:213
622+
msgid "Dutch"
623+
msgstr ""
624+
625+
#: cps/constants.py:214
626+
msgid "Norwegian"
627+
msgstr ""
628+
629+
#: cps/constants.py:215
630+
#, fuzzy
631+
msgid "Polish"
632+
msgstr "Herausgeber"
633+
634+
#: cps/constants.py:216
635+
msgid "Portuguese"
636+
msgstr ""
637+
638+
#: cps/constants.py:217
639+
msgid "Portuguese (Brazil)"
640+
msgstr ""
641+
642+
#: cps/constants.py:218
643+
msgid "Russian"
644+
msgstr ""
645+
646+
#: cps/constants.py:219
647+
msgid "Slovak"
648+
msgstr ""
649+
650+
#: cps/constants.py:220
651+
msgid "Slovenian"
652+
msgstr ""
653+
654+
#: cps/constants.py:221
655+
msgid "Swedish"
656+
msgstr ""
657+
658+
#: cps/constants.py:222
659+
msgid "Turkish"
660+
msgstr ""
661+
662+
#: cps/constants.py:223
663+
msgid "Ukrainian"
664+
msgstr ""
665+
666+
#: cps/constants.py:224
667+
msgid "Vietnamese"
668+
msgstr ""
669+
670+
#: cps/constants.py:225
671+
msgid "Chinese (Simplified, China)"
672+
msgstr ""
673+
674+
#: cps/constants.py:226
675+
msgid "Chinese (Traditional, Taiwan)"
676+
msgstr ""
677+
568678
#: cps/converter.py:31
569679
msgid "not installed"
570680
msgstr "Nicht installiert"

0 commit comments

Comments
 (0)