Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
33e6cf5e
Kaydet (Commit)
33e6cf5e
authored
Tem 26, 2013
tarafından
Jannis Leidel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20774 -- Mention the new django-localflavor app as a replacement for the contrib app.
üst
0b35a2cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
62 deletions
+18
-62
localflavor.txt
docs/topics/localflavor.txt
+18
-62
No files found.
docs/topics/localflavor.txt
Dosyayı görüntüle @
33e6cf5e
...
@@ -7,8 +7,9 @@ assorted pieces of code that are useful for particular countries or cultures.
...
@@ -7,8 +7,9 @@ assorted pieces of code that are useful for particular countries or cultures.
This code is now distributed separately from Django, for easier maintenance
This code is now distributed separately from Django, for easier maintenance
and to trim the size of Django's codebase.
and to trim the size of Django's codebase.
The localflavor packages are named ``django-localflavor-*``, where the asterisk
The new localflavor package is named ``django-localflavor``, with a main
is an `ISO 3166 country code`_. For example: ``django-localflavor-us`` is the
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.
localflavor package for the U.S.A.
Most of these ``localflavor`` add-ons are country-specific fields for the
Most of these ``localflavor`` add-ons are country-specific fields for the
...
@@ -22,7 +23,7 @@ For example, here's how you can create a form with a field representing a
...
@@ -22,7 +23,7 @@ For example, here's how you can create a form with a field representing a
French telephone number::
French telephone number::
from django import forms
from django import forms
from
django_localflavor_
fr.forms import FRPhoneNumberField
from
localflavor.
fr.forms import FRPhoneNumberField
class MyForm(forms.Form):
class MyForm(forms.Form):
my_french_phone_no = FRPhoneNumberField()
my_french_phone_no = FRPhoneNumberField()
...
@@ -37,75 +38,30 @@ file.
...
@@ -37,75 +38,30 @@ file.
Supported countries
Supported countries
===================
===================
The following countries have django-localflavor- packages.
See the official documentation for more information:
* Argentina: https://github.com/django/django-localflavor-ar
https://django-localflavor.readthedocs.org/
* Australia: https://github.com/django/django-localflavor-au
* Austria: https://github.com/django/django-localflavor-at
* Belgium: https://github.com/django/django-localflavor-be
* Brazil: https://github.com/django/django-localflavor-br
* Canada: https://github.com/django/django-localflavor-ca
* Chile: https://github.com/django/django-localflavor-cl
* China: https://github.com/django/django-localflavor-cn
* Colombia: https://github.com/django/django-localflavor-co
* Croatia: https://github.com/django/django-localflavor-hr
* Czech Republic: https://github.com/django/django-localflavor-cz
* Ecuador: https://github.com/django/django-localflavor-ec
* Finland: https://github.com/django/django-localflavor-fi
* France: https://github.com/django/django-localflavor-fr
* Germany: https://github.com/django/django-localflavor-de
* Greece: https://github.com/spapas/django-localflavor-gr
* Hong Kong: https://github.com/django/django-localflavor-hk
* Iceland: https://github.com/django/django-localflavor-is
* India: https://github.com/django/django-localflavor-in
* Indonesia: https://github.com/django/django-localflavor-id
* Ireland: https://github.com/django/django-localflavor-ie
* Israel: https://github.com/django/django-localflavor-il
* Italy: https://github.com/django/django-localflavor-it
* Japan: https://github.com/django/django-localflavor-jp
* Kuwait: https://github.com/django/django-localflavor-kw
* Lithuania: https://github.com/simukis/django-localflavor-lt
* Macedonia: https://github.com/django/django-localflavor-mk
* Mexico: https://github.com/django/django-localflavor-mx
* The Netherlands: https://github.com/django/django-localflavor-nl
* Norway: https://github.com/django/django-localflavor-no
* Peru: https://github.com/django/django-localflavor-pe
* Poland: https://github.com/django/django-localflavor-pl
* Portugal: https://github.com/django/django-localflavor-pt
* Paraguay: https://github.com/django/django-localflavor-py
* Romania: https://github.com/django/django-localflavor-ro
* Russia: https://github.com/django/django-localflavor-ru
* Slovakia: https://github.com/django/django-localflavor-sk
* Slovenia: https://github.com/django/django-localflavor-si
* South Africa: https://github.com/django/django-localflavor-za
* Spain: https://github.com/django/django-localflavor-es
* Sweden: https://github.com/django/django-localflavor-se
* Switzerland: https://github.com/django/django-localflavor-ch
* Turkey: https://github.com/django/django-localflavor-tr
* United Kingdom: https://github.com/django/django-localflavor-gb
* United States of America: https://github.com/django/django-localflavor-us
* Uruguay: https://github.com/django/django-localflavor-uy
Internationalization of localflavors
Internationalization of localflavors
====================================
====================================
To activate translations for
a
``localflavor`` application, you must include
To activate translations for
the
``localflavor`` application, you must include
the application's name
(e.g. ``django_localflavor_jp``) in
the
the application's name
in the :setting:`INSTALLED_APPS` setting, so
the
:setting:`INSTALLED_APPS` setting, so the internationalization system can find
internationalization system can find the catalog, as explained in
the catalog, as explained in
:ref:`how-django-discovers-translations`.
:ref:`how-django-discovers-translations`.
.. _localflavor-how-to-migrate:
.. _localflavor-how-to-migrate:
How to migrate
How to migrate
==============
==============
If you've used the old ``django.contrib.localflavor`` package, follow these two
If you've used the old ``django.contrib.localflavor`` package or one of the
easy steps to update your code:
temporary ``django-localflavor-*`` releases, follow these two easy steps to
update your code:
1. Install the appropriate third-party ``django-localflavor-*`` package(s).
1. Install the third-party ``django-localflavor`` package from PyPI.
Go to https://github.com/django/ and find the package for your country.
2. Change your app's import statements to reference the new package
s
.
2. Change your app's import statements to reference the new package.
For example, change this::
For example, change this::
...
@@ -113,9 +69,9 @@ easy steps to update your code:
...
@@ -113,9 +69,9 @@ easy steps to update your code:
...to this::
...to this::
from
django_localflavor_
fr.forms import FRPhoneNumberField
from
localflavor.
fr.forms import FRPhoneNumberField
The code in the new package
s
is the same (it was copied directly from Django),
The code in the new package is the same (it was copied directly from Django),
so you don't have to worry about backwards compatibility in terms of
so you don't have to worry about backwards compatibility in terms of
functionality. Only the imports have changed.
functionality. Only the imports have changed.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment