Fix spelling of add-on(s) in strings (#19138)

* Fix spelling of add-on(s) in strings

* Update tests
This commit is contained in:
Francesco Lodolo 2022-04-21 12:21:38 +02:00 коммит произвёл GitHub
Родитель d904e6a87f
Коммит 86ea69d96b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
24 изменённых файлов: 41 добавлений и 41 удалений

Просмотреть файл

@ -37,7 +37,7 @@ class AbuseReportTypeFilter(admin.SimpleListFilter):
""" """
return ( return (
('user', gettext('Users')), ('user', gettext('Users')),
('addon', gettext('Addons')), ('addon', gettext('Add-ons')),
) )
def queryset(self, request, queryset): def queryset(self, request, queryset):

Просмотреть файл

@ -408,7 +408,7 @@ class TestAbuse(TestCase):
# (because of the "All" default choice) but since 'created' is actually # (because of the "All" default choice) but since 'created' is actually
# 2 fields, and we have submitted both, we now have 6 expected items. # 2 fields, and we have submitted both, we now have 6 expected items.
assert len(lis) == 6 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(3).find('#id_created__range__gte')
assert lis.eq(4).find('#id_created__range__lte') 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. # Comments should be the santized text rather than the actual content.
assert result['comments'] == amo.LOG.REQUEST_ADMIN_REVIEW_CODE.sanitize assert result['comments'] == amo.LOG.REQUEST_ADMIN_REVIEW_CODE.sanitize
assert result['comments'].startswith( 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): def test_log_entry_without_details(self):

Просмотреть файл

@ -2322,7 +2322,7 @@ class ReplacementAddon(ModelBase):
path = models.CharField( path = models.CharField(
max_length=255, max_length=255,
null=True, 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: class Meta:

Просмотреть файл

@ -489,7 +489,7 @@ class DeveloperVersionSerializer(VersionSerializer):
if missing_addon_metadata: if missing_addon_metadata:
raise exceptions.ValidationError( raise exceptions.ValidationError(
gettext( 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}.' 'version: {missing_addon_metadata}.'
).format(missing_addon_metadata=missing_addon_metadata), ).format(missing_addon_metadata=missing_addon_metadata),
code='required', code='required',
@ -932,7 +932,7 @@ class AddonSerializer(serializers.ModelSerializer):
if channel == amo.RELEASE_CHANNEL_LISTED: if channel == amo.RELEASE_CHANNEL_LISTED:
# This is replicating what Addon.get_required_metadata does # This is replicating what Addon.get_required_metadata does
required_msg = gettext( required_msg = gettext(
'This field is required for addons with listed versions.' 'This field is required for add-ons with listed versions.'
) )
missing_metadata = { missing_metadata = {
field: required_msg field: required_msg

Просмотреть файл

@ -603,7 +603,7 @@ class TestAddonModels(TestCase):
log = AddonLog.objects.order_by('-id').first().activity_log log = AddonLog.objects.order_by('-id').first().activity_log
assert log.action == amo.LOG.DELETE_ADDON.id assert log.action == amo.LOG.DELETE_ADDON.id
assert log.to_string() == ( 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): def test_delete(self):

Просмотреть файл

@ -940,8 +940,8 @@ class TestAddonViewSetCreate(UploadMixin, AddonViewSetCreateUpdateMixin, TestCas
) )
assert response.status_code == 400, response.content assert response.status_code == 400, response.content
assert response.data == { assert response.data == {
'categories': ['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 addons with listed versions.'], 'name': ['This field is required for add-ons with listed versions.'],
# 'summary': summary was provided via POST, so we're good # '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.status_code == 400, response.content
assert response.data == { assert response.data == {
'non_field_errors': [ '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']." "['categories']."
], ],
} }
@ -3065,7 +3065,7 @@ class TestVersionViewSetUpdate(UploadMixin, VersionViewSetCreateUpdateMixin, Tes
data={'license': self.version.license.slug}, data={'license': self.version.license.slug},
) )
assert response.status_code == 400, response.content 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.addon.update(type=amo.ADDON_EXTENSION)
self.version.license.update(builtin=12) self.version.license.update(builtin=12)
@ -3074,7 +3074,7 @@ class TestVersionViewSetUpdate(UploadMixin, VersionViewSetCreateUpdateMixin, Tes
data={'license': self.version.license.slug}, data={'license': self.version.license.slug},
) )
assert response.status_code == 400, response.content 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): def test_cannot_supply_both_custom_and_license_id(self):
license_data = { license_data = {

Просмотреть файл

@ -87,7 +87,7 @@ class ValidateVersionLicense:
is_theme = addon_type == amo.ADDON_STATICTHEME is_theme = addon_type == amo.ADDON_STATICTHEME
if isinstance(license_, License) and license_.creative_commons != is_theme: if isinstance(license_, License) and license_.creative_commons != is_theme:
raise exceptions.ValidationError( raise exceptions.ValidationError(
{'license': gettext('Wrong addon type for this license.')}, {'license': gettext('Wrong add-on type for this license.')},
code='required', code='required',
) )
if is_custom and is_theme: 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(): if not blk and not Block.get_addons_for_guids_qs((guid,)).exists():
errors.append( errors.append(
ValidationError( ValidationError(
_('Addon with GUID %(guid)s does not exist'), _('Add-on with GUID %(guid)s does not exist'),
params={'guid': guid}, params={'guid': guid},
) )
) )

Просмотреть файл

@ -86,7 +86,7 @@ class TestBlockAdmin(TestCase):
# A single invalid guid should redirect back to the page too (for now) # A single invalid guid should redirect back to the page too (for now)
response = self.client.post(self.add_url, {'guids': 'guid@'}, follow=False) response = self.client.post(self.add_url, {'guids': 'guid@'}, follow=False)
assert b'Add-on GUIDs (one per line)' in response.content 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@') addon = addon_factory(guid='guid@')
# But should continue to the django admin add page if it exists # But should continue to the django admin add page if it exists

Просмотреть файл

@ -221,7 +221,7 @@ class REQUEST_SUPER_REVIEW(_LOG):
keep = True keep = True
review_queue = True review_queue = True
sanitize = _( 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 ' 'in our review queue, but it will need to be checked by one '
'of our admin reviewers. The review might take longer than ' 'of our admin reviewers. The review might take longer than '
'usual.' 'usual.'
@ -527,7 +527,7 @@ class DELETE_ADDON(_LOG):
id = 133 id = 133
action_class = 'delete' action_class = 'delete'
# L10n: {0} is the add-on GUID. # 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 keep = True
show_user_to_developer = True show_user_to_developer = True

Просмотреть файл

@ -84,7 +84,7 @@ UPLOAD_SOURCE_GENERATED = 4
UPLOAD_SOURCE_CHOICES = ( UPLOAD_SOURCE_CHOICES = (
(UPLOAD_SOURCE_DEVHUB, _('Developer Hub')), (UPLOAD_SOURCE_DEVHUB, _('Developer Hub')),
(UPLOAD_SOURCE_SIGNING_API, _('Signing API')), (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')), (UPLOAD_SOURCE_GENERATED, _('Automatically generated by AMO')),
) )

Просмотреть файл

@ -61,9 +61,9 @@
{{ _('Whiteboard') }} {{ _('Whiteboard') }}
</abbr> </abbr>
<span class="tip tooltip" title="{% trans -%}The whiteboard is <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 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. help. This whiteboard is also editable by reviewers.
{%- endtrans %}">?</span> {%- endtrans %}">?</span>
</th> </th>

Просмотреть файл

@ -291,7 +291,7 @@
<p class="promoted-version-warning"> <p class="promoted-version-warning">
{# will be hidden by default, shown by javascript if data-can-be-disabled is falsey #} {# will be hidden by default, shown by javascript if data-can-be-disabled is falsey #}
{% trans promoted_group_name = addon.promoted_group().name %} {% 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. because the previous version was not approved for {{ promoted_group_name }} promotion.
Please contact AMO Admins if you need help with this. Please contact AMO Admins if you need help with this.
{% endtrans %} {% endtrans %}

Просмотреть файл

@ -1282,7 +1282,7 @@ def version_delete(request, addon_id, addon):
# of a promoted approved add-on. # of a promoted approved add-on.
group = addon.promoted_group() group = addon.promoted_group()
msg = gettext( 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 ' 'be deleted or disabled because the previous version was not '
'approved for %s promotion. ' 'approved for %s promotion. '
'Please contact AMO Admins if you need help with this.' 'Please contact AMO Admins if you need help with this.'

Просмотреть файл

@ -664,7 +664,7 @@ class AutoApprovalSummary(ModelBase):
is_promoted_prereview = models.BooleanField( is_promoted_prereview = models.BooleanField(
default=False, default=False,
null=True, # TODO: remove this once code has deployed to prod. 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( should_be_delayed = models.BooleanField(
default=False, help_text=_("Delayed because it's the first listed version") 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> <label for="{{ whiteboard_form.public.auto_id }}">{{ whiteboard_form.public.label }}</label>
{{ whiteboard_form.public }} {{ whiteboard_form.public }}
<p>{{ _('The whiteboard is the place to exchange information relevant to ' <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> 'reviewer. This is visible and editable by both.') }}</p>
</div> </div>
</div> </div>

Просмотреть файл

@ -2016,7 +2016,7 @@ class TestAutoApprovalSummary(TestCase):
'Has auto-approval disabled/delayed flag set', 'Has auto-approval disabled/delayed flag set',
'Version string and guid match a blocklist Block', 'Version string and guid match a blocklist Block',
'Is locked by a reviewer', '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", "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') self.api_key = self.create_api_key(self.user, 'bar')
response = self.request('PUT', self.url(self.guid, '3.0')) response = self.request('PUT', self.url(self.guid, '3.0'))
assert response.status_code == 403 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): def test_admin_does_not_own_addon(self):
self.user = UserProfile.objects.create( self.user = UserProfile.objects.create(
@ -178,7 +178,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
self.make_admin(self.user) self.make_admin(self.user)
response = self.request('PUT', self.url(self.guid, '3.0')) response = self.request('PUT', self.url(self.guid, '3.0'))
assert response.status_code == 403 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): def test_version_does_not_match_manifest_file(self):
response = self.request('PUT', self.url(self.guid, '2.5')) 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') response = self.request('PUT', self.url(self.guid, '3.0'), version='3.0')
assert response.status_code == 400 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] amo.STATUS_CHOICES_ADDON[amo.STATUS_DISABLED]
) )
assert error_msg in response.data['error'] 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') response = self.request('PUT', self.url(self.guid, '3.0'), version='3.0')
assert response.status_code == 400 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'] assert error_msg in response.data['error']
response = self.request( response = self.request(
@ -520,7 +520,7 @@ class TestUploadVersion(BaseUploadVersionTestMixin, TestCase):
response = self.request('PUT', self.url(self.guid, '3.0'), channel='listed') response = self.request('PUT', self.url(self.guid, '3.0'), channel='listed')
assert response.status_code == 400 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'] assert error_msg in response.data['error']
def test_invalid_guid_in_package_post(self): 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') self.api_key = self.create_api_key(self.user, 'bar')
response = self.get(self.url(self.guid, '3.0')) response = self.get(self.url(self.guid, '3.0'))
assert response.status_code == 403 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): def test_admin_can_view(self):
self.create_version('3.0') self.create_version('3.0')
@ -1318,7 +1318,7 @@ class TestCheckVersion(BaseUploadVersionTestMixin, TestCase):
def test_version_does_not_exist(self): def test_version_does_not_exist(self):
response = self.get(self.url(self.guid, '2.5')) response = self.get(self.url(self.guid, '2.5'))
assert response.status_code == 404 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): def test_version_exists(self):
self.create_version('3.0') self.create_version('3.0')

Просмотреть файл

@ -68,7 +68,7 @@ def with_addon(allow_missing=False):
return fn(view, request, addon=addon, **kwargs) return fn(view, request, addon=addon, **kwargs)
else: else:
return Response( return Response(
{'error': gettext('You do not own this addon.')}, {'error': gettext('You do not own this add-on.')},
status=status.HTTP_403_FORBIDDEN, status=status.HTTP_403_FORBIDDEN,
) )
@ -138,7 +138,7 @@ class VersionView(APIView):
if addon is not None and addon.status == amo.STATUS_DISABLED: if addon is not None and addon.status == amo.STATUS_DISABLED:
msg = gettext( 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] % amo.STATUS_CHOICES_ADDON[amo.STATUS_DISABLED]
) )
raise forms.ValidationError(msg, status.HTTP_400_BAD_REQUEST) 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: if addon.disabled_by_user and channel == amo.RELEASE_CHANNEL_LISTED:
msg = gettext( 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.' '"Invisible" state.'
) )
raise forms.ValidationError(msg, status.HTTP_400_BAD_REQUEST) 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): if not addon.has_complete_metadata(has_listed_versions=will_have_listed):
raise forms.ValidationError( raise forms.ValidationError(
gettext( 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. ' 'via the API due to missing metadata. '
'Please submit via the website' 'Please submit via the website'
), ),
@ -282,7 +282,7 @@ class VersionView(APIView):
) )
) )
except FileUpload.DoesNotExist: 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) return Response({'error': msg}, status=status.HTTP_404_NOT_FOUND)
try: 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): def ratings_authorship(self, obj):
return related_content_link(obj, Rating, 'user') 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 %} {{ 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 %} {{ 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 %} {{ author_name }} ( {{ author_url }} ){% endblocktrans %}