The goal of internationalization and localization is to allow a single Web application to offer its content in languages and formats tailored to the audience.
Django has full support for translation of text, formatting of dates, times and numbers, and time zones.
Pada dasarnya, Django melakukan dua hal:
Obviously, translation depends on the target language, and formatting usually
depends on the target country. This information is provided by browsers in
the Accept-Language
header. However, the time zone isn't readily available.
The words "internationalization" and "localization" often cause confusion; here's a simplified definition:
More details can be found in the W3C Web Internationalization FAQ, the Wikipedia article or the GNU gettext documentation.
Peringatan
Translation and formatting are controlled by USE_I18N
and
USE_L10N
settings respectively. However, both features involve
internationalization and localization. The names of the settings are an
unfortunate result of Django's history.
Disini adalah beberapa ketentuan lain yang akan membantu kami menangani bahasa umum:
ll
or a
combined language and country specification of the form ll_CC
.
Examples: it
, de_AT
, es
, pt_BR
. The language part is
always in lower case and the country part in upper case. The separator
is an underscore.Accept-Language
menggunakan bentuk ini. Contoh: it
, de-at
, es
, pt-br
. Kode-kode bahasa umumnya diwakili dalam huruf-kecil, tetapi kepala Accept-Language
HTTP adalah kasus-tidak-peka. Pemisahnya adalah sebuah tanda garis..po
file extension.Des 02, 2017