Skip to content

Conversation

mattwang44
Copy link
Contributor

  • Add new flavor for Taiwan (tw)
  • Add TWAdministrativeDivisionSelect

All Changes

  • Add an entry to the docs/changelog.rst describing the change.

  • Add an entry for your name in the docs/authors.rst file if it's not
    already there.

New Fields Only

  • Prefix the country code to all fields.

  • Field names should be easily understood by developers from the target
    localflavor country. This means that English translations are usually
    not the best name unless it's for something standard like postal code,
    tax / VAT ID etc.

  • Prefer 'PostalCodeField' for postal codes as it's
    international English; ZipCode is a term specific to the United
    States postal system.

  • Add meaningful tests. 100% test coverage is not required but all
    validation edge cases should be covered.

  • Add .. versionadded:: <next-version> comment markers to new
    localflavors.

  • Add documentation for all fields.

@mattwang44 mattwang44 marked this pull request as ready for review July 3, 2025 20:57
@benkonrath
Copy link
Member

Thanks for the PR! I'll have a look at it next week sometime.

@benkonrath benkonrath self-requested a review July 11, 2025 21:37
Copy link
Member

@benkonrath benkonrath left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. The names need to be updated as indicated before this can be merged.

#: https://en.wikipedia.org/wiki/List_of_administrative_divisions_of_Taiwan

TW_ADMINISTRATIVE_DIVISION_CHOICES = (
("changhua_county", "彰化縣"),
Copy link
Member

Choose a reason for hiding this comment

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

The displayed text should be in English and marked as translatable with gettext. We use Transifex to manage the translations - the translated version can be added to Transifix after this PR is merged. The translations are then pulled into the repo before a release, or as needed.

You can see an example of how to do this in the KW local flavor:

https://github.com/django/django-localflavor/blob/master/localflavor/kw/kw_areas.py

I realize this is a roundabout way of getting the administrative names displayed, but this is how we allow developers to create multi-lingual applications.

Copy link
Contributor Author

@mattwang44 mattwang44 Jul 22, 2025

Choose a reason for hiding this comment

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

fixed, please review again.
how can i help with the translation on the Transifex? I found the link. I'll join the project to add these translation strings.

@mattwang44 mattwang44 requested a review from benkonrath July 22, 2025 19:27
@benkonrath benkonrath merged commit 6a5bada into django:master Jul 23, 2025
7 checks passed
@benkonrath
Copy link
Member

Thanks for PR and for your quick update!

@mattwang44 mattwang44 deleted the init-tw branch July 24, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants