mirror of https://github.com/django/django.git
Fixed #23814 -- Pointed localflavor documentation to external package
Edited localflavor doc to point to the external package documentation, leaving just the 'How to migrate' section in Django.
This commit is contained in:
parent
82ec05fcc9
commit
87fed94440
|
@ -12,10 +12,11 @@ This document contains all the API references of :class:`Field` including the
|
|||
|
||||
.. seealso::
|
||||
|
||||
If the built-in fields don't do the trick, you can try :doc:`localflavor
|
||||
</topics/localflavor>`, which contains assorted pieces of code
|
||||
that are useful for particular countries or cultures. Also, you can easily
|
||||
:doc:`write your own custom model fields </howto/custom-model-fields>`.
|
||||
If the built-in fields don't do the trick, you can try `django-localflavor
|
||||
<https://django-localflavor.readthedocs.org/>`_, which contains assorted
|
||||
pieces of code that are useful for particular countries or cultures. Also,
|
||||
you can easily :doc:`write your own custom model fields
|
||||
</howto/custom-model-fields>`.
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -7,48 +7,13 @@ assorted pieces of code that are useful for particular countries or cultures.
|
|||
This code is now distributed separately from Django, for easier maintenance
|
||||
and to trim the size of Django's codebase.
|
||||
|
||||
The new localflavor package is named ``django-localflavor``, with a main
|
||||
module called ``localflavor`` and many subpackages using an
|
||||
`ISO 3166 country code`_. For example: ``localflavor.us`` is the
|
||||
localflavor package for the U.S.A.
|
||||
|
||||
Most of these ``localflavor`` add-ons are country-specific fields for the
|
||||
:doc:`forms </topics/forms/index>` framework -- for example, a
|
||||
``USStateField`` that knows how to validate U.S. state abbreviations and a
|
||||
``FISocialSecurityNumber`` that knows how to validate Finnish social security
|
||||
numbers.
|
||||
|
||||
To use one of these localized components, just import the relevant subpackage.
|
||||
For example, here's how you can create a form with a field representing a
|
||||
French telephone number::
|
||||
|
||||
from django import forms
|
||||
from localflavor.fr.forms import FRPhoneNumberField
|
||||
|
||||
class MyForm(forms.Form):
|
||||
my_french_phone_no = FRPhoneNumberField()
|
||||
|
||||
For documentation on a given country's localflavor helpers, see its README
|
||||
file.
|
||||
|
||||
.. _ISO 3166 country code: http://www.iso.org/iso/country_codes.htm
|
||||
|
||||
.. _localflavor-packages:
|
||||
|
||||
Supported countries
|
||||
===================
|
||||
|
||||
See the official documentation for more information:
|
||||
|
||||
https://django-localflavor.readthedocs.org/
|
||||
|
||||
Internationalization of localflavors
|
||||
====================================
|
||||
.. _localflavor-packages:
|
||||
|
||||
To activate translations for the ``localflavor`` application, you must include
|
||||
the application's name in the :setting:`INSTALLED_APPS` setting, so the
|
||||
internationalization system can find the catalog, as explained in
|
||||
:ref:`how-django-discovers-translations`.
|
||||
Code is hosted on github at https://github.com/django/django-localflavor.
|
||||
|
||||
.. _localflavor-how-to-migrate:
|
||||
|
||||
|
|
Loading…
Reference in New Issue