From cda6ae19c8b03b9b913dda4427469dd95a01935e Mon Sep 17 00:00:00 2001 From: Dirk Eschler Date: Mon, 22 Oct 2012 11:57:52 +0200 Subject: [PATCH] Consistent capitalization of titles in docs. --- README.rst | 4 ++-- docs/modeltranslation/admin.rst | 16 ++++++++------- docs/modeltranslation/caveats.rst | 5 +++-- docs/modeltranslation/commands.rst | 8 +++++--- docs/modeltranslation/index.rst | 4 ++-- docs/modeltranslation/installation.rst | 23 +++++++++++++++++----- docs/modeltranslation/registration.rst | 6 +++--- docs/modeltranslation/related_projects.rst | 2 +- docs/modeltranslation/usage.rst | 8 +++++--- 9 files changed, 48 insertions(+), 28 deletions(-) diff --git a/README.rst b/README.rst index 351dd9e..d15e3ba 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Features - Supports inherited models -Project home +Project Home ------------ https://github.com/deschler/django-modeltranslation @@ -31,6 +31,6 @@ Documentation ------------- https://readthedocs.org/projects/django-modeltranslation -Mailing list +Mailing List ------------ http://groups.google.com/group/django-modeltranslation diff --git a/docs/modeltranslation/admin.rst b/docs/modeltranslation/admin.rst index 000451f..fafdcf5 100644 --- a/docs/modeltranslation/admin.rst +++ b/docs/modeltranslation/admin.rst @@ -1,6 +1,6 @@ .. _admin: -Django admin integration +Django Admin Integration ======================== In order to be able to edit the translations via the ``django.contrib.admin`` @@ -21,7 +21,7 @@ the most simple case would look like: admin.site.register(News, NewsAdmin) -Tweaks applied to the admin +Tweaks Applied to the Admin --------------------------- formfield_for_dbfield @@ -71,7 +71,7 @@ the translation fields of ``title``, but not the original field: .. _translationadmin_in_combination_with_other_admin_classes: -TranslationAdmin in combination with other admin classes +TranslationAdmin in Combination with Other Admin Classes -------------------------------------------------------- If there already exists a custom admin class for a translated model and you @@ -99,7 +99,7 @@ through the blog app, it has to be unregistered first: admin.site.register(Entry, MyTranslatedEntryAdmin) -Admin classes that override ``formfield_for_dbfield`` +Admin Classes that Override ``formfield_for_dbfield`` ***************************************************** In a more complex setup the original ``EntryAdmin`` might override @@ -205,7 +205,7 @@ __ translationadmin_in_combination_with_other_admin_classes_ admin.site.register(News, NewsAdmin) -Using tabbed translation fields +Using Tabbed Translation Fields ------------------------------- .. versionadded:: 0.3 @@ -228,8 +228,10 @@ The proposed way to include it is through the inner ``Media`` class of a } The ``force_jquery.js`` script is necessary when using Django's built-in -``django.jQuery`` object. This and the static urls used are just an example and -might have to be adopted to your setup of serving static files. +``django.jQuery`` object. + +.. note:: This is just an example and might have to be adopted to your setup of + serving static files. Standard jquery-ui theming can be used to customize the look of tabs, the provided css file is supposed to work well with a default Django admin. diff --git a/docs/modeltranslation/caveats.rst b/docs/modeltranslation/caveats.rst index 728fa7f..65d1b67 100644 --- a/docs/modeltranslation/caveats.rst +++ b/docs/modeltranslation/caveats.rst @@ -29,9 +29,10 @@ field is updated: >>> -Accessing translated fields outside views +Accessing Translated Fields Outside Views ----------------------------------------- -Since the ``modeltranslation`` mechanism relies on the current language as it + +Since the modeltranslation mechanism relies on the current language as it is returned by the ``get_language`` function care must be taken when accessing translated fields outside a view function. diff --git a/docs/modeltranslation/commands.rst b/docs/modeltranslation/commands.rst index 012a279..198bb81 100644 --- a/docs/modeltranslation/commands.rst +++ b/docs/modeltranslation/commands.rst @@ -1,12 +1,13 @@ .. _commands: -Management commands +Management Commands =================== .. _commands-update_translation_fields: -The ``update_translation_fields`` command +The ``update_translation_fields`` Command ----------------------------------------- + In case the modeltranslation app was installed on an existing project and you have specified to translate fields of models which are already synced to the database, you have to update your database schema manually. @@ -33,8 +34,9 @@ All translated models (as specified in the project's ``translation.py`` will be populated with initial data. -The ``sync_translation_fields`` command +The ``sync_translation_fields`` Command --------------------------------------- + .. versionadded:: 0.4 .. code-block:: console diff --git a/docs/modeltranslation/index.rst b/docs/modeltranslation/index.rst index 5f03fdf..85a82b4 100644 --- a/docs/modeltranslation/index.rst +++ b/docs/modeltranslation/index.rst @@ -5,8 +5,8 @@ .. include:: readme.rst -Table of content -================ +Table of Contents +================= .. toctree:: :maxdepth: 2 diff --git a/docs/modeltranslation/installation.rst b/docs/modeltranslation/installation.rst index 709c741..4e10a82 100644 --- a/docs/modeltranslation/installation.rst +++ b/docs/modeltranslation/installation.rst @@ -3,14 +3,15 @@ Installation ============ -Using pip +Using Pip --------- .. code-block:: console $ pip install django-modeltranslation -Using the source + +Using the Source ---------------- Get a source tarball from `github`_ or `pypi`_, unpack, then install with: @@ -47,17 +48,19 @@ in detail in the following sections: in that case. -Configure the project's ``settings.py`` +Configure the Project's ``settings.py`` --------------------------------------- -Required settings +Required Settings ***************** The following variables have to be added to or edited in the project's ``settings.py``: + ``INSTALLED_APPS`` ^^^^^^^^^^^^^^^^^^ + Make sure that the ``modeltranslation`` app is listed in your ``INSTALLED_APPS`` variable: @@ -72,10 +75,12 @@ Make sure that the ``modeltranslation`` app is listed in your .. note:: Also make sure that the app can be found on a path contained in your ``PYTHONPATH`` environment variable. + .. _settings-languages: ``LANGUAGES`` ^^^^^^^^^^^^^ + The ``LANGUAGES`` variable must contain all languages used for translation. The first language is treated as the *default language*. @@ -97,12 +102,15 @@ modeltranslation app, but rather required for Django to be able to (statically) translate the verbose names of the languages using the standard ``i18n`` solution. -Advanced settings + +Advanced Settings ***************** + Modeltranslation also has some advanced settings to customize its behaviour: ``MODELTRANSLATION_DEFAULT_LANGUAGE`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. versionadded:: 0.3 Default: ``None`` @@ -121,6 +129,7 @@ Example: ``MODELTRANSLATION_TRANSLATION_FILES`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. versionadded:: 0.4 Default: ``()`` (empty tuple) @@ -157,8 +166,12 @@ Example: automatically added to ``MODELTRANSLATION_TRANSLATION_FILES``. A ``DeprecationWarning`` is issued in this case. + ``MODELTRANSLATION_CUSTOM_FIELDS`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Default: ``()`` (empty tuple) + .. versionadded:: 0.3 ``Modeltranslation`` officially supports ``CharField`` and ``TextField``. diff --git a/docs/modeltranslation/registration.rst b/docs/modeltranslation/registration.rst index e90fcd3..674d98e 100644 --- a/docs/modeltranslation/registration.rst +++ b/docs/modeltranslation/registration.rst @@ -1,7 +1,7 @@ .. _registration: -Registering models and their fields for translation -=================================================== +Registering Models for Translation +================================== The ``modeltranslation`` app can translate ``CharField`` and ``TextField`` based fields (as well as ``FileField`` and ``ImageField`` as of version 0.4) @@ -60,7 +60,7 @@ translation will have been added some auto-magical fields. The next section explains how things are working under the hood. -Changes automatically applied to the model class +Changes Automatically Applied to the Model Class ------------------------------------------------ After registering the ``News`` model for translation an SQL dump of the diff --git a/docs/modeltranslation/related_projects.rst b/docs/modeltranslation/related_projects.rst index 6b73c3e..54d430e 100644 --- a/docs/modeltranslation/related_projects.rst +++ b/docs/modeltranslation/related_projects.rst @@ -1,6 +1,6 @@ .. _related_projects: -Related projects +Related Projects ================ .. note:: This list is horribly outdated and only covers apps that where diff --git a/docs/modeltranslation/usage.rst b/docs/modeltranslation/usage.rst index 0d04b53..eb81755 100644 --- a/docs/modeltranslation/usage.rst +++ b/docs/modeltranslation/usage.rst @@ -1,6 +1,6 @@ .. _usage: -Accessing translated and translation fields +Accessing Translated and Translation Fields =========================================== The modeltranslation app changes the behaviour of the translated fields. To @@ -32,8 +32,9 @@ fields*. If the default language is ``en``, the ``title_en`` and ``text_en`` fields would be the *default translation fields*. -Rules for translated field access +Rules for Translated Field Access --------------------------------- + So now when it comes to setting and getting the value of the original and the translation fields the following rules apply: @@ -59,8 +60,9 @@ translation fields the following rules apply: updated at the same time, the default translation field wins. -Examples for translated field access +Examples for Translated Field Access ------------------------------------ + Because the whole point of using the modeltranslation app is translating dynamic content, the fields marked for translation are somehow special when it comes to accessing them. The value returned by a translated field is depending