Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Indonesian localflavour #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions localflavor/id_/id_choices.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
from django.utils.translation import ugettext_lazy as _

#: Indonesia does not have an official Province code standard.
#: I decided to use unambiguous and consistent (some are common) 3-letter codes.
#: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Provincial code in Indonesia doesn't comply with the standard 3-letter province code
# data taken from the official page of Indonesian internal affair ministry
# http://www.kemendagri.go.id/pages/data-wilayah
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a 404 page not found error when I try to load this URL. Has this page been removed since you made this pull request?

PROVINCE_CHOICES = (
('ACE', _('Aceh')),
('BLI', _('Bali')),
('BTN', _('Banten')),
('BKL', _('Bengkulu')),
('DIY', _('Yogyakarta')),
('JKT', _('Jakarta')),
('GOR', _('Gorontalo')),
('JMB', _('Jambi')),
('JBR', _('Jawa Barat')),
('JTG', _('Jawa Tengah')),
('JTM', _('Jawa Timur')),
('KBR', _('Kalimantan Barat')),
('KSL', _('Kalimantan Selatan')),
('KTG', _('Kalimantan Tengah')),
('KTM', _('Kalimantan Timur')),
('BBL', _('Kepulauan Bangka-Belitung')),
('KRI', _('Kepulauan Riau')),
('LPG', _('Lampung')),
('MLK', _('Maluku')),
('MUT', _('Maluku Utara')),
('ACEH', _('Nanggroe Aceh Darussalam')),
('BABEL', _('Kepulauan Bangka-Belitung')),
('BALI', _('Bali')),
('BANTEN', _('Banten')),
('BENGKULU', _('Bengkulu')),
('DI_YOGYAKARTA', _('DI Yogyakarta')), # Special Region Yogyakarta
('DKI_JAKARTA', _('DKI Jakarta')), # Special Capital Region Jakarta
('GORONTALO', _('Gorontalo')),
('JABAR', _('Jawa Barat')),
('JAMBI', _('Jambi')),
('JATENG', _('Jawa Tengah')),
('JATIM', _('Jawa Timur')),
('KALBAR', _('Kalimantan Barat')),
('KALSEL', _('Kalimantan Selatan')),
('KALTENG', _('Kalimantan Tengah')),
('KALTIM', _('Kalimantan Timur')),
('KALUT', _('Kalimantan Utara')),
('KEPRI', _('Kepulauan Riau')),
('LAMPUNG', _('Lampung')),
('MALUKU', _('Maluku')),
('MALUT', _('Maluku Utara')),
('NTB', _('Nusa Tenggara Barat')),
('NTT', _('Nusa Tenggara Timur')),
('PPA', _('Papua')),
('PPB', _('Papua Barat')),
('RIU', _('Riau')),
('SLB', _('Sulawesi Barat')),
('SLS', _('Sulawesi Selatan')),
('SLT', _('Sulawesi Tengah')),
('SLR', _('Sulawesi Tenggara')),
('SLU', _('Sulawesi Utara')),
('SMB', _('Sumatera Barat')),
('SMS', _('Sumatera Selatan')),
('SMU', _('Sumatera Utara')),
('PAPUA', _('Papua')),
('PAPUA_BARAT', _('Papua Barat')),
('RIAU', _('Riau')),
('SULBAR', _('Sulawesi Barat')),
('SULSEL', _('Sumatera Selatan')),
('SULTENG', _('Sulawesi Tengah')),
('SULTRA', _('Sulawesi Tenggara')),
('SULUT', _('Sulawesi Utara')),
('SUMBAR', _('Sumatera Barat')),
('SUMSEL', _('Sumatera Selatan')),
('SUMUT', _('Sumatera Utara')),
)

#: License plate prefixes
Expand Down
66 changes: 34 additions & 32 deletions tests/test_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,46 @@


class IDLocalFlavorTests(SimpleTestCase):

def test_IDProvinceSelect(self):
f = IDProvinceSelect()
out = '''<select name="provinces">
<option value="ACE">Aceh</option>
<option value="BLI">Bali</option>
<option value="BTN">Banten</option>
<option value="BKL">Bengkulu</option>
<option value="DIY">Yogyakarta</option>
<option value="JKT">Jakarta</option>
<option value="GOR">Gorontalo</option>
<option value="JMB">Jambi</option>
<option value="JBR">Jawa Barat</option>
<option value="JTG">Jawa Tengah</option>
<option value="JTM">Jawa Timur</option>
<option value="KBR">Kalimantan Barat</option>
<option value="KSL">Kalimantan Selatan</option>
<option value="KTG">Kalimantan Tengah</option>
<option value="KTM">Kalimantan Timur</option>
<option value="BBL">Kepulauan Bangka-Belitung</option>
<option value="KRI">Kepulauan Riau</option>
<option value="LPG" selected="selected">Lampung</option>
<option value="MLK">Maluku</option>
<option value="MUT">Maluku Utara</option>
<option value="ACEH">Nanggroe Aceh Darussalam</option>
<option value="BABEL">Kepulauan Bangka-Belitung</option>
<option value="BALI">Bali</option>
<option value="BANTEN">Banten</option>
<option value="BENGKULU">Bengkulu</option>
<option value="DI_YOGYAKARTA">DI Yogyakarta</option>
<option value="DKI_JAKARTA">DKI Jakarta</option>
<option value="GORONTALO">Gorontalo</option>
<option value="JABAR">Jawa Barat</option>
<option value="JAMBI">Jambi</option>
<option value="JATENG">Jawa Tengah</option>
<option value="JATIM">Jawa Timur</option>
<option value="KALBAR">Kalimantan Barat</option>
<option value="KALSEL">Kalimantan Selatan</option>
<option value="KALTENG">Kalimantan Tengah</option>
<option value="KALTIM">Kalimantan Timur</option>
<option value="KALUT">Kalimantan Utara</option>
<option value="KEPRI">Kepulauan Riau</option>
<option value="LAMPUNG" selected="selected">Lampung</option>
<option value="MALUKU">Maluku</option>
<option value="MALUT">Maluku Utara</option>
<option value="NTB">Nusa Tenggara Barat</option>
<option value="NTT">Nusa Tenggara Timur</option>
<option value="PPA">Papua</option>
<option value="PPB">Papua Barat</option>
<option value="RIU">Riau</option>
<option value="SLB">Sulawesi Barat</option>
<option value="SLS">Sulawesi Selatan</option>
<option value="SLT">Sulawesi Tengah</option>
<option value="SLR">Sulawesi Tenggara</option>
<option value="SLU">Sulawesi Utara</option>
<option value="SMB">Sumatera Barat</option>
<option value="SMS">Sumatera Selatan</option>
<option value="SMU">Sumatera Utara</option>
<option value="PAPUA">Papua</option>
<option value="PAPUA_BARAT">Papua Barat</option>
<option value="RIAU">Riau</option>
<option value="SULBAR">Sulawesi Barat</option>
<option value="SULSEL">Sumatera Selatan</option>
<option value="SULTENG">Sulawesi Tengah</option>
<option value="SULTRA">Sulawesi Tenggara</option>
<option value="SULUT">Sulawesi Utara</option>
<option value="SUMBAR">Sumatera Barat</option>
<option value="SUMSEL">Sumatera Selatan</option>
<option value="SUMUT">Sumatera Utara</option>
</select>'''
self.assertHTMLEqual(f.render('provinces', 'LPG'), out)
self.assertHTMLEqual(f.render('provinces', 'LAMPUNG'), out)

def test_IDLicensePlatePrefixSelect(self):
f = IDLicensePlatePrefixSelect()
Expand Down