Skip to content

Commit

Permalink
Admin translation tweaks (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp authored Sep 24, 2023
1 parent c2c79d2 commit a2e37a7
Show file tree
Hide file tree
Showing 48 changed files with 13,879 additions and 1,433 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/options/edit-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default class extends React.Component {
}

onSuccess = () => {
snackbar.info(pgettext("edit details", "Your details have been updated."))
snackbar.info(
pgettext("profile details form", "Your details have been updated.")
)
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/profile/moderation/avatar-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class extends Form {
label={pgettext("profile avatar moderation field", "User message")}
helpText={pgettext(
"profile avatar moderation field",
"Optional message for user explaining why he/she is prohibited form changing avatar."
"Optional message for user explaining why they are prohibited from changing their avatar."
)}
for="id_avatar_lock_user_message"
>
Expand All @@ -124,7 +124,7 @@ export default class extends Form {
label={pgettext("profile avatar moderation field", "Staff message")}
helpText={pgettext(
"profile avatar moderation field",
"Optional message for forum team members explaining why user is prohibited form changing avatar."
"Optional message for forum team members explaining why the user is prohibited form changing their avatar."
)}
for="id_avatar_lock_staff_message"
>
Expand Down
2 changes: 1 addition & 1 deletion misago/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def ColorField(**kwargs):
flags=re.IGNORECASE,
message=pgettext_lazy(
"admin color field",
"Value must be a 7-character string specifying an RGB color in a hexadecimal format.",
'Value must be a 7-character string specifying an RGB color in a hexadecimal format (eg.: "#F5A9B8").',
),
)
],
Expand Down
4 changes: 2 additions & 2 deletions misago/categories/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CategoryFormBase(forms.ModelForm):
required=False,
help_text=pgettext_lazy(
"admin category form",
"Optional CSS class used to customize this category's appearance from templates.",
"Optional CSS class used to customize this category's appearance from themes.",
),
)
is_closed = YesNoSwitch(
Expand Down Expand Up @@ -250,7 +250,7 @@ def clean(self):
if moving_to_child and not data.get("move_children_to"):
message = pgettext_lazy(
"admin category form",
"You are trying to move this category threads to a child category that will be deleted together with this category.",
"You are trying to move this category threads to a child category that will also be deleted.",
)
raise forms.ValidationError(message)

Expand Down
8 changes: 4 additions & 4 deletions misago/conf/admin/forms/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class AnalyticsSettingsForm(SettingsForm):
required=False,
)
google_site_verification = forms.CharField(
label=pgettext_lazy("admin analytics settings form", "Site verification token"),
label=pgettext_lazy("admin analytics settings form", "Site verification code"),
help_text=pgettext_lazy(
"admin analytics settings form",
"This token was extracted from uploaded site verification file. To change it, upload new verification file.",
"This code was extracted from the uploaded site verification file. To change it, upload new verification file.",
),
required=False,
disabled=True,
Expand All @@ -49,7 +49,7 @@ def clean_google_site_verification_file(self):
if upload.content_type != "text/html":
raise forms.ValidationError(
pgettext_lazy(
"admin analytics settings form", "Submitted file type is not HTML."
"admin analytics settings form", "Uploaded file type is not HTML."
)
)

Expand All @@ -59,7 +59,7 @@ def clean_google_site_verification_file(self):
raise forms.ValidationError(
pgettext_lazy(
"admin analytics settings form",
"Submitted file doesn't contain a verification code.",
"Uploaded file doesn't contain a verification code.",
)
)

Expand Down
2 changes: 1 addition & 1 deletion misago/conf/admin/forms/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class GeneralSettingsForm(SettingsForm):
),
help_text=pgettext_lazy(
"admin general settings form",
"Hiding the link to the ACP from user menus reduces risk of malicious actors gaining access to admin session for admin users who are sharing their PC with others or who are logging in to the site in public spaces.",
"Hiding the link to the ACP from user menus reduces risk of malicious actors gaining access to admin session for admin users who are sharing their device with others or who are logging in to the site in public spaces.",
),
)

Expand Down
4 changes: 2 additions & 2 deletions misago/conf/admin/forms/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NotificationsSettingsForm(SettingsForm):
watch_started_threads = forms.TypedChoiceField(
label=pgettext_lazy(
"admin notifications settings form",
"Notify about new replies in threads started by the user",
"Notify about new replies in threads started by them",
),
choices=ThreadNotifications.choices,
widget=forms.RadioSelect(),
Expand All @@ -28,7 +28,7 @@ class NotificationsSettingsForm(SettingsForm):
watch_replied_threads = forms.TypedChoiceField(
label=pgettext_lazy(
"admin notifications settings form",
"Notify about new replies in threads replied to by the user",
"Notify about new replies in threads replied to by them",
),
choices=ThreadNotifications.choices,
widget=forms.RadioSelect(),
Expand Down
2 changes: 1 addition & 1 deletion misago/conf/admin/forms/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class OAuth2SettingsForm(SettingsForm):
label=pgettext_lazy("admin oauth2 settings form", "Login form URL"),
help_text=pgettext_lazy(
"admin oauth2 settings form",
"Address to login form on provider's server that users will be redirected to.",
"Address of the login form on provider's server that users will be redirected to.",
),
max_length=500,
required=False,
Expand Down
2 changes: 1 addition & 1 deletion misago/conf/admin/forms/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ThreadsSettingsForm(SettingsForm):
label=pgettext_lazy("admin threads settings form", "Maximum orphans"),
help_text=pgettext_lazy(
"admin threads settings form",
"If number of posts to be displayed on the last page is less or equal to number specified in this setting, those posts will instead be displayed on previous page, reducing the total number of pages in thread.",
"This setting prevents situations when the last page of a thread contains very few items. If number of posts to be displayed on the last page is less or equal to number specified in this setting, those posts will instead be appended to the previous page, reducing number of thread's pages.",
),
min_value=0,
)
Expand Down
16 changes: 9 additions & 7 deletions misago/conf/admin/forms/users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django import forms
from django.utils.translation import pgettext_lazy
from django.utils.translation import npgettext_lazy, pgettext_lazy

from ....admin.forms import YesNoSwitch
from ....core.validators import validate_image_square
Expand Down Expand Up @@ -100,7 +100,7 @@ class UsersSettingsForm(SettingsForm):
label=pgettext_lazy("admin users settings form", "Allow custom avatar uploads"),
help_text=pgettext_lazy(
"admin users settings form",
"Turning this option off will forbid forum users from uploading custom avatars. Good for forums adressed at young users.",
"Turning this option off will forbid forum users from uploading custom avatars.",
),
)
avatar_upload_limit = forms.IntegerField(
Expand Down Expand Up @@ -142,11 +142,11 @@ class UsersSettingsForm(SettingsForm):
)
default_gravatar_fallback = forms.ChoiceField(
label=pgettext_lazy(
"admin users settings form", "Fallback for default gravatar"
"admin users settings form", "Fallback for default Gravatar"
),
help_text=pgettext_lazy(
"admin users settings form",
"Select which avatar to use when user has no gravatar associated with their e-mail address.",
"Select which avatar to use when user has no Gravatar associated with their e-mail address.",
),
choices=[
(
Expand Down Expand Up @@ -236,15 +236,15 @@ class UsersSettingsForm(SettingsForm):
label=pgettext_lazy("admin users settings form", "Maximum orphans"),
help_text=pgettext_lazy(
"admin users settings form",
"If number of users to be displayed on the last page is less or equal to number specified in this setting, those users will instead be displayed on previous page, reducing the total number of pages on the list.",
"This setting prevents situations when the last page of a users list contains very few items. If number of users to be displayed on the last page is less or equal to number specified in this setting, those users will instead be appended to the previous page, reducing number of list's pages.",
),
min_value=0,
)

top_posters_ranking_length = forms.IntegerField(
label=pgettext_lazy(
"admin users settings form",
"Maximum age in days of posts that should count to the ranking",
"Maximum age in days of posts that should count to the ranking position",
),
min_value=1,
)
Expand Down Expand Up @@ -307,9 +307,11 @@ def clean_blank_avatar(self):
min_size = max(settings.MISAGO_AVATARS_SIZES)
if upload.image.width < min_size:
raise forms.ValidationError(
pgettext_lazy(
npgettext_lazy(
"admin users settings form",
"Uploaded image's edge should be at least %(size)s pixel long.",
"Uploaded image's edge should be at least %(size)s pixels long.",
min_size,
)
% {"size": min_size}
)
Expand Down
4 changes: 2 additions & 2 deletions misago/graphql/admin/versioncheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_unreleased_error():
),
"description": pgettext(
"admin version check",
"Unreleased versions of Misago can lack security features and there is no supported way to upgrade them to release versions later.",
"Unreleased versions of Misago can contain serious breaking bugs or miss security features. They are also unsupported and it may be impossible to upgrade them to released version later.",
),
}

Expand All @@ -48,7 +48,7 @@ def check_version_with_api():
),
"description": pgettext(
"admin version check",
"Version check feature relies on the API operated by the Python Package Index (pypi.org) API to retrieve latest Misago release version.",
"Version check feature relies on the API operated by the Python Package Index (pypi.org) to retrieve the latest Misago release version.",
),
}

Expand Down
Loading

0 comments on commit a2e37a7

Please sign in to comment.