Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When setting COUNTRIES_OVERRIDE, allow custom flag_url #449

Open
kunambi opened this issue Dec 18, 2023 · 1 comment
Open

When setting COUNTRIES_OVERRIDE, allow custom flag_url #449

kunambi opened this issue Dec 18, 2023 · 1 comment

Comments

@kunambi
Copy link

kunambi commented Dec 18, 2023

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

@SmileyChris
Copy link
Owner

Sure, seems like a valid enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants