Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ade172e

Browse files
Standardize spelling to American English in documentation (#9804)
* Standardize spelling to American English (only in .md files) * Update remaining British english spell words to American english style * Configures the codespell pre-commit hook to enforce US English consistency changes: - Activates the `en-GB_to_en-US` built-in dictionary to flag British spellings - Created codespell-ignore-words.txt file to ignore specific words - include `code` and `names` for comprehensive typo checking in technical contexts. - changed the 'lets' to 'let's'.
1 parent 0653a63 commit ade172e

34 files changed

+82
-71
lines changed

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ repos:
2929
rev: v2.4.1
3030
hooks:
3131
- id: codespell
32+
args: [
33+
"--builtin", "clear,rare,code,names,en-GB_to_en-US",
34+
"--ignore-words", "codespell-ignore-words.txt",
35+
"--skip", "*.css",
36+
]
3237
exclude: locale|kickstarter-announcement.md|coreapi-0.1.1.js
3338
additional_dependencies:
3439
# python doesn't come with a toml parser prior to 3.11

‎codespell-ignore-words.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Tim
2+
assertIn
3+
IAM
4+
endcode
5+
deque
6+
thead

‎docs/api-guide/authentication.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ JSON Web Token is a fairly new standard which can be used for token-based authen
416416

417417
## Hawk HTTP Authentication
418418

419-
The [HawkREST][hawkrest] library builds on the [Mohawk][mohawk] library to let you work with [Hawk][hawk] signed requests and responses in your API. [Hawk][hawk] lets two parties securely communicate with each other using messages signed by a shared key. It is based on [HTTP MAC access authentication][mac] (which was based on parts of [OAuth 1.0][oauth-1.0a]).
419+
The [HawkREST][hawkrest] library builds on the [Mohawk][mohawk] library to let you work with [Hawk][hawk] signed requests and responses in your API. [Hawk][hawk] let's two parties securely communicate with each other using messages signed by a shared key. It is based on [HTTP MAC access authentication][mac] (which was based on parts of [OAuth 1.0][oauth-1.0a]).
420420

421421
## HTTP Signature Authentication
422422

‎docs/api-guide/fields.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ The `allow_null` option is also available for string fields, although its usage
180180

181181
## EmailField
182182

183-
A text representation, validates the text to be a valid e-mail address.
183+
A text representation, validates the text to be a valid email address.
184184

185185
Corresponds to `django.db.models.fields.EmailField`
186186

@@ -762,7 +762,7 @@ suitable for updating our target object. With `source='*'`, the return from
762762
('y_coordinate', 4),
763763
('x_coordinate', 3)])
764764

765-
For completeness lets do the same thing again but with the nested serializer
765+
For completeness let's do the same thing again but with the nested serializer
766766
approach suggested above:
767767

768768
class NestedCoordinateSerializer(serializers.Serializer):

‎docs/api-guide/relations.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ For example, the following serializer:
300300

301301
Would serialize to a nested representation like this:
302302

303-
>>> album = Album.objects.create(album_name="The Grey Album", artist='Danger Mouse')
303+
>>> album = Album.objects.create(album_name="The Gray Album", artist='Danger Mouse')
304304
>>> Track.objects.create(album=album, order=1, title='Public Service Announcement', duration=245)
305305
<Track: Track object>
306306
>>> Track.objects.create(album=album, order=2, title='What More Can I Say', duration=264)
@@ -310,7 +310,7 @@ Would serialize to a nested representation like this:
310310
>>> serializer = AlbumSerializer(instance=album)
311311
>>> serializer.data
312312
{
313-
'album_name': 'The Grey Album',
313+
'album_name': 'The Gray Album',
314314
'artist': 'Danger Mouse',
315315
'tracks': [
316316
{'order': 1, 'title': 'Public Service Announcement', 'duration': 245},
@@ -344,7 +344,7 @@ By default nested serializers are read-only. If you want to support write-operat
344344
return album
345345

346346
>>> data = {
347-
'album_name': 'The Grey Album',
347+
'album_name': 'The Gray Album',
348348
'artist': 'Danger Mouse',
349349
'tracks': [
350350
{'order': 1, 'title': 'Public Service Announcement', 'duration': 245},

‎docs/api-guide/renderers.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ An example of a view that uses `TemplateHTMLRenderer`:
134134

135135
You can use `TemplateHTMLRenderer` either to return regular HTML pages using REST framework, or to return both HTML and API responses from a single endpoint.
136136

137-
If you're building websites that use `TemplateHTMLRenderer` along with other renderer classes, you should consider listing `TemplateHTMLRenderer` as the first class in the `renderer_classes` list, so that it will be prioritised first even for browsers that send poorly formed `ACCEPT:` headers.
137+
If you're building websites that use `TemplateHTMLRenderer` along with other renderer classes, you should consider listing `TemplateHTMLRenderer` as the first class in the `renderer_classes` list, so that it will be prioritized first even for browsers that send poorly formed `ACCEPT:` headers.
138138

139139
See the [_HTML & Forms_ Topic Page][html-and-forms] for further examples of `TemplateHTMLRenderer` usage.
140140

‎docs/api-guide/responses.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source:
1111
1212
REST framework supports HTTP content negotiation by providing a `Response` class which allows you to return content that can be rendered into multiple content types, depending on the client request.
1313

14-
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
14+
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialized with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
1515

1616
There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` or `StreamingHttpResponse` objects from your views if required. Using the `Response` class simply provides a nicer interface for returning content-negotiated Web API responses, that can be rendered to multiple formats.
1717

‎docs/api-guide/schemas.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package and then subsequently retired over the next releases.
2020

2121
As a full-fledged replacement, we recommend the [drf-spectacular] package.
2222
It has extensive support for generating OpenAPI 3 schemas from
23-
REST framework APIs, with both automatic and customisable options available.
23+
REST framework APIs, with both automatic and customizable options available.
2424
For further information please refer to
2525
[Documenting your API](../topics/documenting-your-api.md#drf-spectacular).
2626

‎docs/api-guide/serializers.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ We can now use `CommentSerializer` to serialize a comment, or list of comments.
4848
serializer.data
4949
# {'email': 'leila@example.com', 'content': 'foo bar', 'created': '2016年01月27日T15:17:10.375877'}
5050

51-
At this point we've translated the model instance into Python native datatypes. To finalise the serialization process we render the data into `json`.
51+
At this point we've translated the model instance into Python native datatypes. To finalize the serialization process we render the data into `json`.
5252

5353
from rest_framework.renderers import JSONRenderer
5454

@@ -155,7 +155,7 @@ When deserializing data, you always need to call `is_valid()` before attempting
155155
serializer.is_valid()
156156
# False
157157
serializer.errors
158-
# {'email': ['Enter a valid e-mail address.'], 'created': ['This field is required.']}
158+
# {'email': ['Enter a valid email address.'], 'created': ['This field is required.']}
159159

160160
Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The `non_field_errors` key may also be present, and will list any general validation errors. The name of the `non_field_errors` key may be customized using the `NON_FIELD_ERRORS_KEY` REST framework setting.
161161

@@ -298,7 +298,7 @@ When dealing with nested representations that support deserializing the data, an
298298
serializer.is_valid()
299299
# False
300300
serializer.errors
301-
# {'user': {'email': ['Enter a valid e-mail address.']}, 'created': ['This field is required.']}
301+
# {'user': {'email': ['Enter a valid email address.']}, 'created': ['This field is required.']}
302302

303303
Similarly, the `.validated_data` property will include nested data structures.
304304

@@ -430,7 +430,7 @@ The context dictionary can be used within any serializer field logic, such as a
430430

431431
Often you'll want serializer classes that map closely to Django model definitions.
432432

433-
The `ModelSerializer` class provides a shortcut that lets you automatically create a `Serializer` class with fields that correspond to the Model fields.
433+
The `ModelSerializer` class provides a shortcut that let's you automatically create a `Serializer` class with fields that correspond to the Model fields.
434434

435435
**The `ModelSerializer` class is the same as a regular `Serializer` class, except that**:
436436

‎docs/api-guide/testing.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ For example...
264264
csrftoken = response.cookies['csrftoken']
265265

266266
# Interact with the API.
267-
response = client.post('http://testserver/organisations/', json={
267+
response = client.post('http://testserver/organizations/', json={
268268
'name': 'MegaCorp',
269269
'status': 'active'
270270
}, headers={'X-CSRFToken': csrftoken})
@@ -292,12 +292,12 @@ The CoreAPIClient allows you to interact with your API using the Python
292292
client = CoreAPIClient()
293293
schema = client.get('http://testserver/schema/')
294294

295-
# Create a new organisation
295+
# Create a new organization
296296
params = {'name': 'MegaCorp', 'status': 'active'}
297-
client.action(schema, ['organisations', 'create'], params)
297+
client.action(schema, ['organizations', 'create'], params)
298298

299-
# Ensure that the organisation exists in the listing
300-
data = client.action(schema, ['organisations', 'list'])
299+
# Ensure that the organization exists in the listing
300+
data = client.action(schema, ['organizations', 'list'])
301301
assert(len(data) == 1)
302302
assert(data == [{'name': 'MegaCorp', 'status': 'active'}])
303303

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /