Skip to content

When setting COUNTRIES_OVERRIDE, allow custom flag_url #449

@kunambi

Description

@kunambi

Because of Django compability issues in django-modeltranslation, the Indonesian language has the code ind rather than id. In order for our project to mesh well with django-countries we're using COUNTRIES_OVERRIDE like so:

COUNTRIES_OVERRIDE = {
    "ID": None,
    "IND": {
        "names": [
            _("Indonesia"),
        ],
        "ioc_code": "INA",
    },
}

This works very well.

However, when we want to display the flag it automatically is looking for flags/ind.gif which of course returns a 404. Would love if we could set a custom flag_url in the complex dictionary format, e.g.:

COUNTRIES_OVERRIDE = {
    "ID": None,
    "IND": {
        "names": [
            _("Indonesia"),
        ],
        "ioc_code": "INA",
        "flag_url": "flags/id.gif",
    },
}

TYIA

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions