Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#15856 closed New feature (fixed)

Add a localflavor for Macedonia

Reported by: Vasil Vangelovski Owned by: nobody
Component: contrib.localflavor Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've created a localflavor package with form and model fields for a Macedonian localflavor. Tests and documentation are included. Also a translation for the mk locale is included. Although I'm not sure updates to translation are handled in this way anymore since the transition to transifex.

There's a pull request on GitHub https://github.com/django/django/pull/22

Attachments (1)

localflavor_mk.patch (26.1 KB ) - added by Vasil Vangelovski 14 years ago.
patch that adds contrib.localflavor.mk

Download all attachments as: .zip

Change History (13)

comment:1 by Aymeric Augustin, 14 years ago

Easy pickings: unset
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

This work looks pretty good and the request is reasonable. Accepting the ticket.

Reading through the patch, I noticed that sometimes the alphabetical order is not respected when inserting MK-related stuff in existing files; this should be fixed.

comment:2 by anonymous, 14 years ago

The alphabetical order in the municipalities list looks as if it is not respected when you read it as it is with latin characters. When the translation is applied in Cyrillic it is in alphabetical order respecting the Cyrillic alphabet ordering абвгд... (abvgd). So it is like that intentionally os it's sorted properly when the translation to Macedonian is applied.

comment:3 by anonymous, 14 years ago

The alphabetical order may be out of line when importing tests (mk should go before mx). I'll fix that.

comment:4 by Jannis Leidel, 14 years ago

Please attach the patch here for the sake of completeness.

Unless there is a specific reason, please don't prefix the MUNICIPALITY_CHOICES with "MK.".

Also, the translation updates shouldn't be part of the patch.

in reply to:  4 comment:5 by Vasil Vangelovski, 14 years ago

Replying to jezdez:

Please attach the patch here for the sake of completeness.

Unless there is a specific reason, please don't prefix the MUNICIPALITY_CHOICES with "MK.".

Also, the translation updates shouldn't be part of the patch.

Are you sure about the prefix? I can remove it without a problem, but I did that in order to be consistent with the existing codebase for localflavor. Looking at choices tuples for other localflavors I can see that tupples are prefixed with the country code example:

HR_COUNTY_CHOICES (this is a new one)

IS_POSTALCODES

US_TERRITORIES

etc...

comment:6 by Vasil Vangelovski, 14 years ago

Disregard the pervious comment. I think what jezdez meant is that tuple wasn't prefixed with MK but it should have been. And I thought that I did prefix it. I've attached a patch with my latest work. I tried to keep stuff consistent with what is in other localflavors and reordered some of the code so it's sorted alphabetically.

comment:7 by Jannis Leidel, 14 years ago

I meant the name of the choice keys, e.g.:

MK_MUNICIPALITIES = (
    ('MK.AD', _(u'Aerodrom')),
    ('MK.AR', _(u'Aračinovo')),
    # ..
)

Unless there is some kind of sensible reason (e.g. a standard or common sense) to prefix the choice key with "MK." we should just leave it out:

MK_MUNICIPALITIES = (
    ('AD', _(u'Aerodrom')),
    ('AR', _(u'Aračinovo')),
    # ..
)

by Vasil Vangelovski, 14 years ago

Attachment: localflavor_mk.patch added

patch that adds contrib.localflavor.mk

comment:8 by Vasil Vangelovski, 14 years ago

OK, got it. I removed the prefix and updated the code and docs accordingly. The reason they were prefixed is that the codes are HASC codes and those are hierarchical and prefixed wit the country code. But, I can't see a scenario where a conflict could arise if they are not.

comment:9 by Vasil Vangelovski, 14 years ago

Patch needs improvement: unset
UI/UX: unset

comment:10 by Jannis Leidel, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:11 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

In [16385]:

Fixed #15856 -- Added Macedonian localflavor. Many thanks to vasiliyeah.

comment:12 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

Note: See TracTickets for help on using tickets.
Back to Top