Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#15856 closed New feature (fixed)

Add a localflavor for Macedonia

Reported by: vasiliyeah Owned by: nobody
Component: contrib.localflavor Version: master
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 vasiliyeah 4 years ago.
patch that adds contrib.localflavor.mk

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by aaugustin

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 4 years ago by anonymous

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 Changed 4 years ago by anonymous

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

comment:4 follow-up: Changed 4 years ago by 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.

comment:5 in reply to: ↑ 4 Changed 4 years ago by vasiliyeah

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 Changed 4 years ago by vasiliyeah

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 Changed 4 years ago by jezdez

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')),
    # ..
)

Changed 4 years ago by vasiliyeah

patch that adds contrib.localflavor.mk

comment:8 Changed 4 years ago by vasiliyeah

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 Changed 4 years ago by vasiliyeah

  • Patch needs improvement unset
  • UI/UX unset

comment:10 Changed 4 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:11 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

In [16385]:

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

comment:12 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

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