Fixes #8970. Python 3.7 incorrectly opens the stream for writing in text mode (be6dbfb43b), so work around this by writing the unicode string back rather than encoding back to bytes.
This will probably fail if we're on Windows AND Python 3.7 AND encounter non-ASCII characters (because in that case it'll be open for writing as Windows-1252 encoding), but it's probably the best we can do without abandoning the fileinput library entirely.
`./manage.py compilemessages` does not allow variables to differ between the singular and plural forms - it fails with
a format specification for argument 'snippet_type_name', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
It's not possible to use the gettext pluralisation mechanism properly here, because we're using Django's verbose_name and verbose_name_plural properties which don't cover the requirements of languages with complex pluralisation rules. Since we can only hope to support English-style (`if n == 1`) pluralisation, use an n==1 test directly (as we have elsewhere in the template) rather than trying to shoehorn this into gettext pluralisation.
While we're at it, remove the capitalisation of the snippet name - it makes no sense here (especially when only done for the plural).
Fixes #9019
* The `[data-field]` element (not the input) should be queried to find the `[data-field-errors]` element
* The code should not assume the presence of an icon element
Fixes #9010. `wagtail.documents.widgets` is no longer reliably imported on startup now that the chooser widget is constructed within wagtail.documents.views.chooser instead, so the telepath adapter wasn't getting register. This meant that DocumentChooserBlocks in StreamField were using the base chooser implementation, which didn't include customisations such as populating the title field from the file upload field. Fix this by making ChooserViewSet responsible for registering the telepath adapter.
Fixes #8989. The previous fix #9004 failed for custom document models because ChooserViewset assigns an internal name for the ChooserBlock class based on the model name, and if this is anything other than Document it won't match the name DocumentChooserBlock that it's exposed under in wagtail.documents.blocks. Fix this by replacing the `block_class` property with a `get_block_class` method that lets us specify the class name. As a bonus, user code that defines chooser blocks no longer has to directly hack the `__module__` attribute.
- fix some broken refs that were lost in the migration to markdown files
- use lower_snake_case for all internal refs (most follow this convention)
- release process sub-section in docs should be named release schedule instead
- Use inline code for `Locale` and `TranslatableMixin` headers to be consistent with other classes in the page
- Move `locale` and `translation_key` of `TranslatableMixin` to its own "Database fields" section
- Add missing periods in Page.update_aliases parameter description
Fixes #8989. Now that DocumentChooserBlock is constructed dynamically via wagtail.documents.viewsets.chooser, we need to explicitly set its `__module__` attribute so that the result of calling `deconstruct()` for migrations points back to the wagtail.documents.blocks module.
Also update the documentation for defining custom choosers, and add tests for deconstructing the other chooser blocks.