Skip to main content

A simple Django app to display national flags for languages.

Project description

Flags is a simple Django app that helps display national flags. For efficiency, there is just one huge PNG file with all the flags, and individual flags are selected for display using CSS trickery.

Quick start

  1. Add “language_flags” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'language_flags',
    ]
  2. In templates where you want to use language_flags, include the language_flags template tag library:

    {% load language_flags_tags %}
  3. You can use the flags_for_language tag to display a number of flags of nations where a language is spoken. Right now the language can be either English or German:

    {% flags_for_language COUNT LANGUAGE %}

    This will display COUNT flags for language LANGUAGE; the flags will always include the first country listed for LANGUAGE, while the remainder will be randomly selected from the other countries.

Acknowledgments

The flag sprite was downloaded from https://www.flag-sprites.com and is derived from the FamFamFam flag icon set at http://www.famfamfam.com/lab/icons/flags/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-language-flags-0.1.1.tar.gz (89.8 kB view details)

Uploaded Source

File details

Details for the file django-language-flags-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-language-flags-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c2f74f3fed63dc569ee8599aae5e714a9b3f2d4ff949a91d18c7a5f27e881de7
MD5 2dd0857462ad8530c1b26341966bbe50
BLAKE2b-256 f1d059cba1a1e518c19c9ae23aeea10b7d2864fdf40bc8dda88b29966641d73e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page