mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-09 23:51:20 +00:00
Pull markup out of translation files
it's bad enough that we do markup in views.py See #161
This commit is contained in:
Binary file not shown.
@@ -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 <a href=\"%s\" class=\"text-cyan-800 font-bold\">set up the "
|
||||
"SDK</a>."
|
||||
msgstr ""
|
||||
"<a href=\"%s\" class=\"text-cyan-800 font-bold\">设置SDK</a>以使用DSN。"
|
||||
msgid "set up the SDK"
|
||||
msgstr "设置 SDK"
|
||||
|
||||
#: projects/forms.py:115
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"You don't have any teams yet; <a href=\"%s\" class=\"text-cyan-800 font-"
|
||||
"bold\">Create a team first.</a>"
|
||||
msgstr ""
|
||||
"你没有任何可用团队。<a href=\"%s\" class=\"text-cyan-800 font-bold\">创建一个"
|
||||
"新团队。</a>"
|
||||
#. 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"
|
||||
|
||||
@@ -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 <a href=\"%s\" class=\"text-cyan-800 font-bold\">set up the SDK</a>.") % href
|
||||
|
||||
self.fields["dsn"].help_text = format_html(
|
||||
_("Use the DSN to {link}."),
|
||||
link=format_html('<a href="{}" class="text-cyan-800 font-bold">{}</a>', 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; '
|
||||
'<a href="%s" class="text-cyan-800 font-bold">Create a team first.</a>') % href
|
||||
self.fields["team"].help_text = format_html(
|
||||
"{}{}", _("You don't have any teams yet; "),
|
||||
format_html('<a href="{}" class="text-cyan-800 font-bold">{}</a>', href, _("Create a team first.")))
|
||||
|
||||
elif team_qs.count() == 1:
|
||||
self.fields["team"].initial = team_qs.first()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user