Fix spelling of add-on(s) in strings (#19138)
* Fix spelling of add-on(s) in strings * Update tests
This commit is contained in:
Родитель
d904e6a87f
Коммит
86ea69d96b
|
@ -37,7 +37,7 @@ class AbuseReportTypeFilter(admin.SimpleListFilter):
|
|||
"""
|
||||
return (
|
||||
('user', gettext('Users')),
|
||||
('addon', gettext('Addons')),
|
||||
('addon', gettext('Add-ons')),
|
||||
)
|
||||
|
||||
def queryset(self, request, queryset):
|
||||
|
|
|
@ -408,7 +408,7 @@ class TestAbuse(TestCase):
|
|||
# (because of the "All" default choice) but since 'created' is actually
|
||||
# 2 fields, and we have submitted both, we now have 6 expected items.
|
||||
assert len(lis) == 6
|
||||
assert lis.text().split() == ['Addons', 'All', 'Other', 'From:', 'To:', 'All']
|
||||
assert lis.text().split() == ['Add-ons', 'All', 'Other', 'From:', 'To:', 'All']
|
||||
assert lis.eq(3).find('#id_created__range__gte')
|
||||
assert lis.eq(4).find('#id_created__range__lte')
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ class TestReviewNotesSerializerOutput(TestCase, LogMixin):
|
|||
# Comments should be the santized text rather than the actual content.
|
||||
assert result['comments'] == amo.LOG.REQUEST_ADMIN_REVIEW_CODE.sanitize
|
||||
assert result['comments'].startswith(
|
||||
'The addon has been flagged for Admin Review.'
|
||||
'The add-on has been flagged for Admin Review.'
|
||||
)
|
||||
|
||||
def test_log_entry_without_details(self):
|
||||
|
|
|
@ -2322,7 +2322,7 @@ class ReplacementAddon(ModelBase):
|
|||
path = models.CharField(
|
||||
max_length=255,
|
||||
null=True,
|
||||
help_text=_('Addon and collection paths need to end with "/"'),
|
||||
help_text=_('Add-on and collection paths need to end with "/"'),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
|
@ -489,7 +489,7 @@ class DeveloperVersionSerializer(VersionSerializer):
|
|||
if missing_addon_metadata:
|
||||
raise exceptions.ValidationError(
|
||||
gettext(
|
||||
'Addon metadata is required to be set to create a listed '
|
||||
'Add-on metadata is required to be set to create a listed '
|
||||
'version: {missing_addon_metadata}.'
|
||||
).format(missing_addon_metadata=missing_addon_metadata),
|
||||
code='required',
|
||||
|
@ -932,7 +932,7 @@ class AddonSerializer(serializers.ModelSerializer):
|
|||
if channel == amo.RELEASE_CHANNEL_LISTED:
|
||||
# This is replicating what Addon.get_required_metadata does
|
||||
required_msg = gettext(
|
||||
'This field is required for addons with listed versions.'
|
||||
'This field is required for add-ons with listed versions.'
|
||||
)
|
||||
missing_metadata = {
|
||||
field: required_msg
|
||||
|
|
|
@ -603,7 +603,7 @@ class TestAddonModels(TestCase):
|
|||
log = AddonLog.objects.order_by('-id').first().activity_log
|
||||
assert log.action == amo.LOG.DELETE_ADDON.id
|
||||
assert log.to_string() == (
|
||||
f'Addon id {addon_id} with GUID {guid} has been deleted'
|
||||
f'Add-on id {addon_id} with GUID {guid} has been deleted'
|
||||
)
|
||||
|
||||
def test_delete(self):
|
||||
|
|
|
@ -940,8 +940,8 @@ class TestAddonViewSetCreate(UploadMixin, AddonViewSetCreateUpdateMixin, TestCas
|
|||
)
|
||||
assert response.status_code == 400, response.content
|
||||
assert response.data == {
|
||||
'categories': ['This field is required for addons with listed versions.'],
|
||||
'name': ['This field is required for addons with listed versions.'],
|
||||
'categories': ['This field is required for add-ons with listed versions.'],
|
||||
'name': ['This field is required for add-ons with listed versions.'],
|
||||
# 'summary': summary was provided via POST, so we're good
|
||||
}
|
||||
|
||||
|
@ -2580,7 +2580,7 @@ class TestVersionViewSetCreate(UploadMixin, VersionViewSetCreateUpdateMixin, Tes
|
|||
assert response.status_code == 400, response.content
|
||||
assert response.data == {
|
||||
'non_field_errors': [
|
||||
'Addon metadata is required to be set to create a listed version: '
|
||||
'Add-on metadata is required to be set to create a listed version: '
|
||||
"['categories']."
|
||||
],
|
||||
}
|
||||
|
@ -3065,7 +3065,7 @@ class TestVersionViewSetUpdate(UploadMixin, VersionViewSetCreateUpdateMixin, Tes
|
|||
data={'license': self.version.license.slug},
|
||||
)
|
||||
assert response.status_code == 400, response.content
|
||||
assert response.data == {'license': ['Wrong addon type for this license.']}
|
||||
assert response.data == {'license': ['Wrong add-on type for this license.']}
|
||||
|
||||
self.addon.update(type=amo.ADDON_EXTENSION)
|
||||
self.version.license.update(builtin=12)
|
||||
|
@ -3074,7 +3074,7 @@ class TestVersionViewSetUpdate(UploadMixin, VersionViewSetCreateUpdateMixin, Tes
|
|||
data={'license': self.version.license.slug},
|
||||
)
|
||||
assert response.status_code == 400, response.content
|
||||
assert response.data == {'license': ['Wrong addon type for this license.']}
|
||||
assert response.data == {'license': ['Wrong add-on type for this license.']}
|
||||
|
||||
def test_cannot_supply_both_custom_and_license_id(self):
|
||||
license_data = {
|
||||
|
|
|
@ -87,7 +87,7 @@ class ValidateVersionLicense:
|
|||
is_theme = addon_type == amo.ADDON_STATICTHEME
|
||||
if isinstance(license_, License) and license_.creative_commons != is_theme:
|
||||
raise exceptions.ValidationError(
|
||||
{'license': gettext('Wrong addon type for this license.')},
|
||||
{'license': gettext('Wrong add-on type for this license.')},
|
||||
code='required',
|
||||
)
|
||||
if is_custom and is_theme:
|
||||
|
|
|
@ -60,7 +60,7 @@ class MultiAddForm(MultiGUIDInputForm):
|
|||
if not blk and not Block.get_addons_for_guids_qs((guid,)).exists():
|
||||
errors.append(
|
||||
ValidationError(
|
||||
_('Addon with GUID %(guid)s does not exist'),
|
||||
_('Add-on with GUID %(guid)s does not exist'),
|
||||
params={'guid': guid},
|
||||
)
|
||||
)
|
||||
|
|
|
@ -86,7 +86,7 @@ class TestBlockAdmin(TestCase):
|
|||
# A single invalid guid should redirect back to the page too (for now)
|
||||
response = self.client.post(self.add_url, {'guids': 'guid@'}, follow=False)
|
||||
assert b'Add-on GUIDs (one per line)' in response.content
|
||||
assert b'Addon with GUID guid@ does not exist' in response.content
|
||||
assert b'Add-on with GUID guid@ does not exist' in response.content
|
||||
|
||||
addon = addon_factory(guid='guid@')
|
||||
# But should continue to the django admin add page if it exists
|
||||
|
|
|
@ -221,7 +221,7 @@ class REQUEST_SUPER_REVIEW(_LOG):
|
|||
keep = True
|
||||
review_queue = True
|
||||
sanitize = _(
|
||||
"The addon has been flagged for Admin Review. It's still "
|
||||
"The add-on has been flagged for Admin Review. It's still "
|
||||
'in our review queue, but it will need to be checked by one '
|
||||
'of our admin reviewers. The review might take longer than '
|
||||
'usual.'
|
||||
|
@ -527,7 +527,7 @@ class DELETE_ADDON(_LOG):
|
|||
id = 133
|
||||
action_class = 'delete'
|
||||
# L10n: {0} is the add-on GUID.
|
||||
format = _('Addon id {0} with GUID {1} has been deleted')
|
||||
format = _('Add-on id {0} with GUID {1} has been deleted')
|
||||
keep = True
|
||||
show_user_to_developer = True
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ UPLOAD_SOURCE_GENERATED = 4
|
|||
UPLOAD_SOURCE_CHOICES = (
|
||||
(UPLOAD_SOURCE_DEVHUB, _('Developer Hub')),
|
||||
(UPLOAD_SOURCE_SIGNING_API, _('Signing API')),
|
||||
(UPLOAD_SOURCE_ADDON_API, _('Addon API')),
|
||||
(UPLOAD_SOURCE_ADDON_API, _('Add-on API')),
|
||||
(UPLOAD_SOURCE_GENERATED, _('Automatically generated by AMO')),
|
||||
)
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@
|
|||
{{ _('Whiteboard') }}
|
||||
</abbr>
|
||||
<span class="tip tooltip" title="{% trans -%}The whiteboard is
|
||||
the place to provide information relevant to your addon,
|
||||
the place to provide information relevant to your add-on,
|
||||
whatever the version, to the reviewers. Use it to provide ways
|
||||
to test the addon, and any additional information that may
|
||||
to test the add-on, and any additional information that may
|
||||
help. This whiteboard is also editable by reviewers.
|
||||
{%- endtrans %}">?</span>
|
||||
</th>
|
||||
|
|
|
@ -291,7 +291,7 @@
|
|||
<p class="promoted-version-warning">
|
||||
{# will be hidden by default, shown by javascript if data-can-be-disabled is falsey #}
|
||||
{% trans promoted_group_name = addon.promoted_group().name %}
|
||||
The latest approved version of this {{ promoted_group_name }} addon cannot be deleted or disabled
|
||||
The latest approved version of this {{ promoted_group_name }} add-on cannot be deleted or disabled
|
||||
because the previous version was not approved for {{ promoted_group_name }} promotion.
|
||||
Please contact AMO Admins if you need help with this.
|
||||
{% endtrans %}
|
||||
|
|
|
@ -1282,7 +1282,7 @@ def version_delete(request, addon_id, addon):
|
|||
# of a promoted approved add-on.
|
||||
group = addon.promoted_group()
|
||||
msg = gettext(
|
||||
'The latest approved version of this %s addon cannot '
|
||||
'The latest approved version of this %s add-on cannot '
|
||||
'be deleted or disabled because the previous version was not '
|
||||
'approved for %s promotion. '
|
||||
'Please contact AMO Admins if you need help with this.'
|
||||
|
|
|
@ -664,7 +664,7 @@ class AutoApprovalSummary(ModelBase):
|
|||
is_promoted_prereview = models.BooleanField(
|
||||
default=False,
|
||||
null=True, # TODO: remove this once code has deployed to prod.
|
||||
help_text=_('Is in a promoted addon group that requires pre-review'),
|
||||
help_text=_('Is in a promoted add-on group that requires pre-review'),
|
||||
)
|
||||
should_be_delayed = models.BooleanField(
|
||||
default=False, help_text=_("Delayed because it's the first listed version")
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
<label for="{{ whiteboard_form.public.auto_id }}">{{ whiteboard_form.public.label }}</label>
|
||||
{{ whiteboard_form.public }}
|
||||
<p>{{ _('The whiteboard is the place to exchange information relevant to '
|
||||
'this addon (whatever the version), between the developer and the '
|
||||
'this add-on (whatever the version), between the developer and the '
|
||||
'reviewer. This is visible and editable by both.') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2016,7 +2016,7 @@ class TestAutoApprovalSummary(TestCase):
|
|||
'Has auto-approval disabled/delayed flag set',
|
||||
'Version string and guid match a blocklist Block',
|
||||
'Is locked by a reviewer',
|
||||
'Is in a promoted addon group that requires pre-review',
|
||||
'Is in a promoted add-on group that requires pre-review',
|
||||
"Delayed because it's the first listed version",
|
||||
]
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
self.api_key = self.create_api_key(self.user, 'bar')
|
||||
response = self.request('PUT', self.url(self.guid, '3.0'))
|
||||
assert response.status_code == 403
|
||||
assert response.data['error'] == 'You do not own this addon.'
|
||||
assert response.data['error'] == 'You do not own this add-on.'
|
||||
|
||||
def test_admin_does_not_own_addon(self):
|
||||
self.user = UserProfile.objects.create(
|
||||
|
@ -178,7 +178,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
self.make_admin(self.user)
|
||||
response = self.request('PUT', self.url(self.guid, '3.0'))
|
||||
assert response.status_code == 403
|
||||
assert response.data['error'] == 'You do not own this addon.'
|
||||
assert response.data['error'] == 'You do not own this add-on.'
|
||||
|
||||
def test_version_does_not_match_manifest_file(self):
|
||||
response = self.request('PUT', self.url(self.guid, '2.5'))
|
||||
|
@ -430,7 +430,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
|
||||
response = self.request('PUT', self.url(self.guid, '3.0'), version='3.0')
|
||||
assert response.status_code == 400
|
||||
error_msg = 'cannot add versions to an addon that has status: %s.' % (
|
||||
error_msg = 'cannot add versions to an add-on that has status: %s.' % (
|
||||
amo.STATUS_CHOICES_ADDON[amo.STATUS_DISABLED]
|
||||
)
|
||||
assert error_msg in response.data['error']
|
||||
|
@ -442,7 +442,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
|
||||
response = self.request('PUT', self.url(self.guid, '3.0'), version='3.0')
|
||||
assert response.status_code == 400
|
||||
error_msg = 'cannot add listed versions to an addon set to "Invisible"'
|
||||
error_msg = 'cannot add listed versions to an add-on set to "Invisible"'
|
||||
assert error_msg in response.data['error']
|
||||
|
||||
response = self.request(
|
||||
|
@ -520,7 +520,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
|
||||
response = self.request('PUT', self.url(self.guid, '3.0'), channel='listed')
|
||||
assert response.status_code == 400
|
||||
error_msg = 'You cannot add a listed version to this addon via the API'
|
||||
error_msg = 'You cannot add a listed version to this add-on via the API'
|
||||
assert error_msg in response.data['error']
|
||||
|
||||
def test_invalid_guid_in_package_post(self):
|
||||
|
@ -1302,7 +1302,7 @@ class TestCheckVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
self.api_key = self.create_api_key(self.user, 'bar')
|
||||
response = self.get(self.url(self.guid, '3.0'))
|
||||
assert response.status_code == 403
|
||||
assert response.data['error'] == 'You do not own this addon.'
|
||||
assert response.data['error'] == 'You do not own this add-on.'
|
||||
|
||||
def test_admin_can_view(self):
|
||||
self.create_version('3.0')
|
||||
|
@ -1318,7 +1318,7 @@ class TestCheckVersion(BaseUploadVersionTestMixin, TestCase):
|
|||
def test_version_does_not_exist(self):
|
||||
response = self.get(self.url(self.guid, '2.5'))
|
||||
assert response.status_code == 404
|
||||
assert response.data['error'] == 'No uploaded file for that addon and version.'
|
||||
assert response.data['error'] == 'No uploaded file for that add-on and version.'
|
||||
|
||||
def test_version_exists(self):
|
||||
self.create_version('3.0')
|
||||
|
|
|
@ -68,7 +68,7 @@ def with_addon(allow_missing=False):
|
|||
return fn(view, request, addon=addon, **kwargs)
|
||||
else:
|
||||
return Response(
|
||||
{'error': gettext('You do not own this addon.')},
|
||||
{'error': gettext('You do not own this add-on.')},
|
||||
status=status.HTTP_403_FORBIDDEN,
|
||||
)
|
||||
|
||||
|
@ -138,7 +138,7 @@ class VersionView(APIView):
|
|||
|
||||
if addon is not None and addon.status == amo.STATUS_DISABLED:
|
||||
msg = gettext(
|
||||
'You cannot add versions to an addon that has status: %s.'
|
||||
'You cannot add versions to an add-on that has status: %s.'
|
||||
% amo.STATUS_CHOICES_ADDON[amo.STATUS_DISABLED]
|
||||
)
|
||||
raise forms.ValidationError(msg, status.HTTP_400_BAD_REQUEST)
|
||||
|
@ -226,7 +226,7 @@ class VersionView(APIView):
|
|||
|
||||
if addon.disabled_by_user and channel == amo.RELEASE_CHANNEL_LISTED:
|
||||
msg = gettext(
|
||||
'You cannot add listed versions to an addon set to '
|
||||
'You cannot add listed versions to an add-on set to '
|
||||
'"Invisible" state.'
|
||||
)
|
||||
raise forms.ValidationError(msg, status.HTTP_400_BAD_REQUEST)
|
||||
|
@ -235,7 +235,7 @@ class VersionView(APIView):
|
|||
if not addon.has_complete_metadata(has_listed_versions=will_have_listed):
|
||||
raise forms.ValidationError(
|
||||
gettext(
|
||||
'You cannot add a listed version to this addon '
|
||||
'You cannot add a listed version to this add-on '
|
||||
'via the API due to missing metadata. '
|
||||
'Please submit via the website'
|
||||
),
|
||||
|
@ -282,7 +282,7 @@ class VersionView(APIView):
|
|||
)
|
||||
)
|
||||
except FileUpload.DoesNotExist:
|
||||
msg = gettext('No uploaded file for that addon and version.')
|
||||
msg = gettext('No uploaded file for that add-on and version.')
|
||||
return Response({'error': msg}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
try:
|
||||
|
|
|
@ -501,7 +501,7 @@ class UserAdmin(CommaSearchInAdminMixin, admin.ModelAdmin):
|
|||
),
|
||||
)
|
||||
|
||||
addons_authorship.short_description = _('Addons')
|
||||
addons_authorship.short_description = _('Add-ons')
|
||||
|
||||
def ratings_authorship(self, obj):
|
||||
return related_content_link(obj, Rating, 'user')
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name author_role=author.get_role_display %}The following author has been added to your addon {{ addon_name }} ( {{ addon_url }} ):
|
||||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name author_role=author.get_role_display %}The following author has been added to your add-on {{ addon_name }} ( {{ addon_url }} ):
|
||||
|
||||
{{ author_name }} ( {{ author_url }} ): {{ author_role }}{% endblocktrans %}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name author_role=author.get_role_display %}The following author has been changed on your addon {{ addon_name }} ( {{ addon_url }} ):
|
||||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name author_role=author.get_role_display %}The following author has been changed on your add-on {{ addon_name }} ( {{ addon_url }} ):
|
||||
|
||||
{{ author_name }} ( {{ author_url }} ): {{ author_role }}{% endblocktrans %}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name %}The following author has been removed from addon {{ addon_name }} ( {{ addon_url }} ):
|
||||
{% load i18n %}{# L10n: This is an email. Whitespace matters! #}{% blocktrans with addon_url=addon.get_absolute_url addon_name=addon.name author_url=author.user.get_absolute_url author_name=author.user.name %}The following author has been removed from add-on {{ addon_name }} ( {{ addon_url }} ):
|
||||
|
||||
{{ author_name }} ( {{ author_url }} ){% endblocktrans %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче