django/django-localflavor — pull request #117 by dessibelle (2014-09-10 13:08:57+00:00)
Title: Added full names and numerical codes for Swedish counties

I have added the following dictionaries and functions to `se_counties.py`:

`NUMERICAL_COUNTY_CODES` contains the numerical two-digit couty codes which has more or less replaced the alphabetical codes nowadays. Also, these numerical codes is always the leading digits in the codes for municipailites and smaller subdivisions, which can be beneficial.

`FULL_COUNTY_NAMES` contains the full names of each county. The current labels given in `SE_COUNTIES` is good when it is obvioius to the user that he/she is selecting a county, but they are not identical to the full county name. Also, in Swedish the county names differ somewhat, e.g. "Skåne län" as opposed to the more generic "Stockholms län" (ending with genitive case s), which the Swedish i18n should honor.

`numerical_county_code()` and `full_county_name()` are simply accessor methods for the above dictionaries, returning the corresponding values given a alphabetical county code.

For backwards compatibility I have chosen to keep both the alphabetical codes and the shortened names (lacking the "county"-part) in the original `SE_COUNTIES` list, although I guess one could argue numerical codes and full names would be a better option.

I also added a `@county_decorator()` which adds a few accessor methods to models

The decorator adds `get_FIELDNAME_numerical_code()` and `get_FIELDNAME_full_name()` methods to django models for all `FIELDNAME` values supplied in the `field_names` tuple. Ideally this can be used on
all model fields that uses `COUNTY_CHOICES` for the choices argument.

@county_decorator(field_names('field',))
class MyClass:
field = models.CharField(choices=se_counties=COUNTY_CHOICES)

If I have understood the other pull requests correctly, localizations is managed through Transifex. I'd be glad to add Swedish localizations for the introduced changes if I could get access.