From b3335f673370a4956af31a94c2d520217440a19d Mon Sep 17 00:00:00 2001 From: Josh O'Brien Date: Wed, 4 Jan 2023 13:30:13 +1100 Subject: [PATCH] English Language Updates - V3 --- cps/admin.py | 22 +++++------ cps/helper.py | 60 ++++++++++++++--------------- cps/render_template.py | 18 ++++----- cps/templates/admin.html | 26 ++++++------- cps/templates/config_edit.html | 2 +- cps/templates/detail.html | 6 +-- cps/templates/email_edit.html | 12 +++--- cps/templates/register.html | 4 +- cps/templates/schedule_edit.html | 8 ++-- cps/templates/shelfdown.html | 0 cps/templates/user_edit.html | 4 +- cps/templates/user_table.html | 26 ++++++------- cps/web.py | 66 ++++++++++++++++---------------- 13 files changed, 127 insertions(+), 127 deletions(-) mode change 100755 => 100644 cps/helper.py mode change 100755 => 100644 cps/templates/admin.html mode change 100755 => 100644 cps/templates/detail.html mode change 100755 => 100644 cps/templates/shelfdown.html mode change 100755 => 100644 cps/templates/user_edit.html mode change 100755 => 100644 cps/templates/user_table.html mode change 100755 => 100644 cps/web.py diff --git a/cps/admin.py b/cps/admin.py index b415f412..148ddb9c 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -145,9 +145,9 @@ def shutdown(): ub.dispose() if task == 0: - show_text['text'] = _(u'Server restarted, please reload page') + show_text['text'] = _(u'Server restarted, please reload page.') else: - show_text['text'] = _(u'Performing shutdown of server, please close window') + show_text['text'] = _(u'Performing Server shutdown, please close window.') # stop gevent/tornado server web_server.stop(task == 0) return json.dumps(show_text) @@ -155,7 +155,7 @@ def shutdown(): if task == 2: log.warning("reconnecting to calibre database") calibre_db.reconnect_db(config, ub.app_DB_path) - show_text['text'] = _(u'Reconnect successful') + show_text['text'] = _(u'Success! Database Reconnected') return json.dumps(show_text) show_text['text'] = _(u'Unknown command') @@ -169,7 +169,7 @@ def queue_metadata_backup(): show_text = {} log.warning("Queuing all books for metadata backup") helper.set_all_metadata_dirty() - show_text['text'] = _(u'Books successfully queued for Metadata Backup') + show_text['text'] = _(u'Success! Books queued for Metadata Backup') return json.dumps(show_text) @@ -1256,7 +1256,7 @@ def new_user(): content.default_language = config.config_default_language 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", + languages=languages, title=_(u"Add New User"), page="newuser", kobo_support=kobo_support, registered_oauth=oauth_check) @@ -1265,7 +1265,7 @@ def new_user(): @admin_required def edit_mailsettings(): content = config.get_mail_settings() - return render_title_template("email_edit.html", content=content, title=_(u"Edit E-mail Server Settings"), + return render_title_template("email_edit.html", content=content, title=_(u"Edit Email Server Settings"), page="mailset", feature_support=feature_support) @@ -1284,7 +1284,7 @@ def update_mailsettings(): elif to_save.get("gmail"): try: config.mail_gmail_token = services.gmail.setup_gmail(config.mail_gmail_token) - flash(_(u"Gmail Account Verification Successful"), category="success") + flash(_(u"Success! Gmail Account Verified."), category="success") except Exception as ex: flash(str(ex), category="error") log.error(ex) @@ -1425,13 +1425,13 @@ def reset_user_password(user_id): ret, message = reset_password(user_id) if ret == 1: log.debug(u"Password for user %s reset", message) - flash(_(u"Password for user %(user)s reset", user=message), category="success") + flash(_(u"Success! Password for user %(user)s reset", user=message), category="success") elif ret == 0: log.error(u"An unknown error occurred. Please try again later.") - flash(_(u"An unknown error occurred. Please try again later."), category="error") + flash(_(u"Oops! An unknown error occurred. Please try again later."), category="error") else: - log.error(u"Please configure the SMTP mail settings first...") - flash(_(u"Please configure the SMTP mail settings first..."), category="error") + log.error(u"Please configure the SMTP mail settings.") + flash(_(u"Oops! Please configure the SMTP mail settings."), category="error") return redirect(url_for('admin.admin')) diff --git a/cps/helper.py b/cps/helper.py old mode 100755 new mode 100644 index 212ce142..c0ad594b --- a/cps/helper.py +++ b/cps/helper.py @@ -94,8 +94,8 @@ def convert_book_format(book_id, calibre_path, old_book_format, new_book_format, # read settings and append converter task to queue if ereader_mail: settings = config.get_mail_settings() - settings['subject'] = _('Send to E-Reader') # pretranslate Subject for e-mail - settings['body'] = _(u'This e-mail has been sent via Calibre-Web.') + settings['subject'] = _('Send to eReader') # pretranslate Subject for Email + settings['body'] = _(u'This Email has been sent via Calibre-Web.') else: settings = dict() link = '{}'.format(url_for('web.show_book', book_id=book.id), escape(book.title)) # prevent xss @@ -111,30 +111,30 @@ def convert_book_format(book_id, calibre_path, old_book_format, new_book_format, # Texts are not lazy translated as they are supposed to get send out as is def send_test_mail(ereader_mail, user_name): - WorkerThread.add(user_name, TaskEmail(_(u'Calibre-Web test e-mail'), None, None, - config.get_mail_settings(), ereader_mail, N_(u"Test e-mail"), - _(u'This e-mail has been sent via Calibre-Web.'))) + WorkerThread.add(user_name, TaskEmail(_(u'Calibre-Web Test Email'), None, None, + config.get_mail_settings(), ereader_mail, N_(u"Test Email"), + _(u'This Email has been sent via Calibre-Web.'))) return # Send registration email or password reset email, depending on parameter resend (False means welcome email) def send_registration_mail(e_mail, user_name, default_password, resend=False): - txt = "Hello %s!\r\n" % user_name + txt = "Hi %s!\r\n" % user_name if not resend: - txt += "Your new account at Calibre-Web has been created. Thanks for joining us!\r\n" - txt += "Please log in to your account using the following information:\r\n" - txt += "User name: %s\r\n" % user_name + txt += "Your account at Calibre-Web has been created.\r\n" + txt += "Please log in using the following information:\r\n" + txt += "Username: %s\r\n" % user_name txt += "Password: %s\r\n" % default_password - txt += "Don't forget to change your password after first login.\r\n" - txt += "Sincerely\r\n\r\n" - txt += "Your Calibre-Web team" + txt += "Don't forget to change your password after your first login.\r\n" + txt += "Regards,\r\n\r\n" + txt += "Calibre-Web" WorkerThread.add(None, TaskEmail( subject=_(u'Get Started with Calibre-Web'), filepath=None, attachment=None, settings=config.get_mail_settings(), recipient=e_mail, - task_message=N_(u"Registration e-mail for user: %(name)s", name=user_name), + task_message=N_(u"Registration Email for user: %(name)s", name=user_name), text=txt )) return @@ -145,13 +145,13 @@ def check_send_to_ereader_with_converter(formats): if 'MOBI' in formats and 'EPUB' not in formats: book_formats.append({'format': 'Epub', 'convert': 1, - 'text': _('Convert %(orig)s to %(format)s and send to E-Reader', + 'text': _('Convert %(orig)s to %(format)s and send to eReader', orig='Mobi', format='Epub')}) if 'AZW3' in formats and 'EPUB' not in formats: book_formats.append({'format': 'Epub', 'convert': 2, - 'text': _('Convert %(orig)s to %(format)s and send to E-Reader', + 'text': _('Convert %(orig)s to %(format)s and send to eReader', orig='Azw3', format='Epub')}) return book_formats @@ -159,7 +159,7 @@ def check_send_to_ereader_with_converter(formats): def check_send_to_ereader(entry): """ - returns all available book formats for sending to E-Reader + returns all available book formats for sending to eReader """ formats = list() book_formats = list() @@ -170,19 +170,19 @@ def check_send_to_ereader(entry): if 'EPUB' in formats: book_formats.append({'format': 'Epub', 'convert': 0, - 'text': _('Send %(format)s to E-Reader', format='Epub')}) + 'text': _('Send %(format)s to eReader', format='Epub')}) if 'MOBI' in formats: book_formats.append({'format': 'Mobi', 'convert': 0, - 'text': _('Send %(format)s to E-Reader', format='Mobi')}) + 'text': _('Send %(format)s to eReader', format='Mobi')}) if 'PDF' in formats: book_formats.append({'format': 'Pdf', 'convert': 0, - 'text': _('Send %(format)s to E-Reader', format='Pdf')}) + 'text': _('Send %(format)s to eReader', format='Pdf')}) if 'AZW' in formats: book_formats.append({'format': 'Azw', 'convert': 0, - 'text': _('Send %(format)s to E-Reader', format='Azw')}) + 'text': _('Send %(format)s to eReader', format='Azw')}) if config.config_converterpath: book_formats.extend(check_send_to_ereader_with_converter(formats)) return book_formats @@ -204,9 +204,9 @@ def check_read_formats(entry): # Files are processed in the following order/priority: -# 1: If Mobi file is existing, it's directly send to E-Reader email, -# 2: If Epub file is existing, it's converted and send to E-Reader email, -# 3: If Pdf file is existing, it's directly send to E-Reader email +# 1: If Mobi file is existing, it's directly send to eReader email, +# 2: If Epub file is existing, it's converted and send to eReader email, +# 3: If Pdf file is existing, it's directly send to eReader email def send_mail(book_id, book_format, convert, ereader_mail, calibrepath, user_id): """Send email with attachments""" book = calibre_db.get_book(book_id) @@ -222,10 +222,10 @@ def send_mail(book_id, book_format, convert, ereader_mail, calibrepath, user_id) if entry.format.upper() == book_format.upper(): converted_file_name = entry.name + '.' + book_format.lower() link = '{}'.format(url_for('web.show_book', book_id=book_id), escape(book.title)) - email_text = N_(u"%(book)s send to E-Reader", book=link) - WorkerThread.add(user_id, TaskEmail(_(u"Send to E-Reader"), book.path, converted_file_name, + email_text = N_(u"%(book)s send to eReader", book=link) + WorkerThread.add(user_id, TaskEmail(_(u"Send to eReader"), book.path, converted_file_name, config.get_mail_settings(), ereader_mail, - email_text, _(u'This e-mail has been sent via Calibre-Web.'))) + email_text, _(u'This Email has been sent via Calibre-Web.'))) return return _(u"The requested file could not be read. Maybe wrong permissions?") @@ -640,8 +640,8 @@ def uniq(inpt): def check_email(email): email = valid_email(email) if ub.session.query(ub.User).filter(func.lower(ub.User.email) == email.lower()).first(): - log.error(u"Found an existing account for this e-mail address") - raise Exception(_(u"Found an existing account for this e-mail address")) + log.error(u"Found an existing account for this Email address") + raise Exception(_(u"Found an existing account for this Email address")) return email @@ -660,8 +660,8 @@ def valid_email(email): # Regex according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation if not re.search(r"^[\w.!#$%&'*+\\/=?^_`{|}~-]+@[\w](?:[\w-]{0,61}[\w])?(?:\.[\w](?:[\w-]{0,61}[\w])?)*$", email): - log.error(u"Invalid e-mail address format") - raise Exception(_(u"Invalid e-mail address format")) + log.error(u"Invalid Email address format") + raise Exception(_(u"Invalid Email address format")) return email # ################################# External interface ################################# diff --git a/cps/render_template.py b/cps/render_template.py index 04a50bbb..74462f9f 100644 --- a/cps/render_template.py +++ b/cps/render_template.py @@ -59,7 +59,7 @@ def get_sidebar_config(kwargs=None): "show_text": _('Show Top Rated Books'), "config_show": True}) sidebar.append({"glyph": "glyphicon-eye-open", "text": _('Read Books'), "link": 'web.books_list', "id": "read", "visibility": constants.SIDEBAR_READ_AND_UNREAD, 'public': (not g.user.is_anonymous), - "page": "read", "show_text": _('Show read and unread'), "config_show": content}) + "page": "read", "show_text": _('Show Read and Unread'), "config_show": content}) sidebar.append( {"glyph": "glyphicon-eye-close", "text": _('Unread Books'), "link": 'web.books_list', "id": "unread", "visibility": constants.SIDEBAR_READ_AND_UNREAD, 'public': (not g.user.is_anonymous), "page": "unread", @@ -69,31 +69,31 @@ def get_sidebar_config(kwargs=None): "show_text": _('Show Random Books'), "config_show": True}) sidebar.append({"glyph": "glyphicon-inbox", "text": _('Categories'), "link": 'web.category_list', "id": "cat", "visibility": constants.SIDEBAR_CATEGORY, 'public': True, "page": "category", - "show_text": _('Show category selection'), "config_show": True}) + "show_text": _('Show Category Section'), "config_show": True}) sidebar.append({"glyph": "glyphicon-bookmark", "text": _('Series'), "link": 'web.series_list', "id": "serie", "visibility": constants.SIDEBAR_SERIES, 'public': True, "page": "series", - "show_text": _('Show series selection'), "config_show": True}) + "show_text": _('Show Series Section'), "config_show": True}) sidebar.append({"glyph": "glyphicon-user", "text": _('Authors'), "link": 'web.author_list', "id": "author", "visibility": constants.SIDEBAR_AUTHOR, 'public': True, "page": "author", - "show_text": _('Show author selection'), "config_show": True}) + "show_text": _('Show Author Section'), "config_show": True}) sidebar.append( {"glyph": "glyphicon-text-size", "text": _('Publishers'), "link": 'web.publisher_list', "id": "publisher", "visibility": constants.SIDEBAR_PUBLISHER, 'public': True, "page": "publisher", - "show_text": _('Show publisher selection'), "config_show":True}) + "show_text": _('Show Publisher Section'), "config_show":True}) sidebar.append({"glyph": "glyphicon-flag", "text": _('Languages'), "link": 'web.language_overview', "id": "lang", "visibility": constants.SIDEBAR_LANGUAGE, 'public': (g.user.filter_language() == 'all'), "page": "language", - "show_text": _('Show language selection'), "config_show": True}) + "show_text": _('Show Language Section'), "config_show": True}) sidebar.append({"glyph": "glyphicon-star-empty", "text": _('Ratings'), "link": 'web.ratings_list', "id": "rate", "visibility": constants.SIDEBAR_RATING, 'public': True, - "page": "rating", "show_text": _('Show ratings selection'), "config_show": True}) + "page": "rating", "show_text": _('Show Ratings Section'), "config_show": True}) sidebar.append({"glyph": "glyphicon-file", "text": _('File formats'), "link": 'web.formats_list', "id": "format", "visibility": constants.SIDEBAR_FORMAT, 'public': True, - "page": "format", "show_text": _('Show file formats selection'), "config_show": True}) + "page": "format", "show_text": _('Show File Formats Section'), "config_show": True}) sidebar.append( {"glyph": "glyphicon-trash", "text": _('Archived Books'), "link": 'web.books_list', "id": "archived", "visibility": constants.SIDEBAR_ARCHIVED, 'public': (not g.user.is_anonymous), "page": "archived", - "show_text": _('Show archived books'), "config_show": content}) + "show_text": _('Show Archived Books'), "config_show": content}) if not simple: sidebar.append( {"glyph": "glyphicon-th-list", "text": _('Books List'), "link": 'web.books_table', "id": "list", diff --git a/cps/templates/admin.html b/cps/templates/admin.html old mode 100755 new mode 100644 index 4d6eff95..1199b21f --- a/cps/templates/admin.html +++ b/cps/templates/admin.html @@ -11,8 +11,8 @@ - - + + @@ -59,7 +59,7 @@
-

{{_('E-mail Server Settings')}}

+

{{_('Email Server Settings')}}

{% if config.get_mail_server_configured() %} {% if email.mail_server_type == 0 %}
@@ -80,24 +80,24 @@
{{email.mail_login}}
-
{{_('From E-mail')}}
+
{{_('From Email')}}
{{email.mail_from}}
{% else %}
-
{{_('E-Mail Service')}}
+
{{_('Email Service')}}
{{_('Gmail via Oauth2')}}
-
{{_('From E-mail')}}
+
{{_('From Email')}}
{{email.mail_gmail_token['email']}}
{% endif %} {% endif %} - {{_('Edit E-mail Server Settings')}} + {{_('Edit Email Server Settings')}}
@@ -167,15 +167,15 @@

{{_('Scheduled Tasks')}}

-
{{_('Time at which tasks start to run')}}
+
{{_('Start Time')}}
{{schedule_time}}
-
{{_('Maximum tasks duration')}}
+
{{_('Maximum Duration')}}
{{schedule_duration}}
-
{{_('Generate book cover thumbnails')}}
+
{{_('Generate Thumbnails')}}
{{ display_bool_setting(config.schedule_generate_book_covers) }}
-
{{_('Reconnect to Calibre Library')}}
+
{{_('Reconnect Calibre Database')}}
{{ display_bool_setting(config.schedule_reconnect) }}
{{_('Edit Scheduled Tasks Settings')}} {% if config.schedule_generate_book_covers %} - {{_('Refresh Thumbnail Cover Cache')}} + {{_('Refresh Thumbnail Cache')}} {% endif %} @@ -224,7 +224,7 @@ - +
{{_('Username')}}{{_('E-mail Address')}}{{_('Send to E-Reader E-mail Address')}}{{_('Email')}}{{_('Send to eReader Email')}} {{_('Downloads')}}
{{commit}} {{_('Current version')}}{{_('Current Version')}}
diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index f61ca9a5..815fb162 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -124,7 +124,7 @@
- +
diff --git a/cps/templates/detail.html b/cps/templates/detail.html old mode 100755 new mode 100644 index 50151603..d6c8f42f --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -10,7 +10,7 @@