diff --git a/locale/zh_Hans/LC_MESSAGES/django.mo b/locale/zh_Hans/LC_MESSAGES/django.mo index 4af6186..386cfcf 100644 Binary files a/locale/zh_Hans/LC_MESSAGES/django.mo and b/locale/zh_Hans/LC_MESSAGES/django.mo differ diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po index dcc4239..27b70ec 100644 --- a/locale/zh_Hans/LC_MESSAGES/django.po +++ b/locale/zh_Hans/LC_MESSAGES/django.po @@ -342,22 +342,23 @@ msgstr "超过此数量的事件将会被丢弃。" msgid "DSN (read-only)" msgstr "DSN (只读)" +#. Translators: {link} will be replaced with an HTML link; place it where it reads naturally. +#, python-brace-format +msgid "Use the DSN to {link}." +msgstr "使用 DSN 来{link}。" + #: projects/forms.py:103 -#, python-format -msgid "" -"Use the DSN to set up the " -"SDK." -msgstr "" -"设置SDK以使用DSN。" +msgid "set up the SDK" +msgstr "设置 SDK" #: projects/forms.py:115 -#, fuzzy, python-format -msgid "" -"You don't have any teams yet; Create a team first." -msgstr "" -"你没有任何可用团队。创建一个" -"新团队。" +#. Translators: This text is followed by a clickable link. Adjust punctuation/spacing naturally. +msgid "You don't have any teams yet; " +msgstr "你还没有任何团队;" + +#: projects/forms.py:115 +msgid "Create a team first." +msgstr "先创建一个团队。" #: projects/models.py:50 teams/models.py:9 msgid "Member" diff --git a/projects/forms.py b/projects/forms.py index 7fbd460..fcc08fc 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -4,6 +4,7 @@ from django.template.defaultfilters import yesno from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.utils.translation import pgettext_lazy +from django.utils.html import format_html from bugsink.utils import assert_ from teams.models import TeamMembership @@ -100,8 +101,11 @@ class ProjectForm(forms.ModelForm): self.fields["dsn"].initial = self.instance.dsn self.fields["dsn"].label = _("DSN (read-only)") href = reverse('project_sdk_setup', kwargs={'project_pk': self.instance.pk}) - self.fields["dsn"].help_text = _( - "Use the DSN to set up the SDK.") % href + + self.fields["dsn"].help_text = format_html( + _("Use the DSN to {link}."), + link=format_html('{}', href, _("set up the SDK")), + ) # if we ever push slug to the form, editing it should probably be disallowed as well (but mainly because it # has consequences on the issue's short identifier) @@ -113,9 +117,10 @@ class ProjectForm(forms.ModelForm): self.fields["team"].queryset = team_qs if team_qs.count() == 0: href = reverse("team_new") - self.fields["team"].help_text = _( - 'You don\'t have any teams yet; ' - 'Create a team first.') % href + self.fields["team"].help_text = format_html( + "{}{}", _("You don't have any teams yet; "), + format_html('{}', href, _("Create a team first."))) + elif team_qs.count() == 1: self.fields["team"].initial = team_qs.first()