diff --git a/README.md b/README.md index f803fae..4277430 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This Django app provides integration for translation options in templates with s Requirements ===== -Django Translation Flags require Django Internationalization and localization properly configured. You can see more about theses settings in [https://docs.djangoproject.com/en/2.1/topics/i18n/](https://docs.djangoproject.com/en/2.1/topics/i18n/) +Django Translation Flags require Django Internationalization and localization properly configured. You can see more about these settings in [https://docs.djangoproject.com/en/2.1/topics/i18n/](https://docs.djangoproject.com/en/2.1/topics/i18n/) Basically you need to: @@ -97,29 +97,34 @@ Inject the required meta tags in your `base.html` (or wherever your HTML <hea ```html {% load flags %} - + ``` By default it will show the rectangular icons, but you can change it to `square`: ```html {% load flags %} - + ``` Optionally you can set your custom class for HTML tags: ```html {% load flags %} - + ``` -The `languages` template tags accept `**kwargs` to configure the HTML elements. +The `languages` template tags accept `**kwargs` to configure the class to HTML tags. +So you can set the classes to these HTML tags: + +**li_class**: Class to `li` tag (Default: empty) + +**a_class**: Class to `a` tag (Default: empty) The HTML structure is: @@ -131,22 +136,22 @@ The HTML structure is: ``` -So you can set the classes to these HTML tags: - -**li_class**: Class to `li` tag (Default: empty) - -**a_class**: Class to `a` tag (Default: empty) - How does it work? ===== -The Django Translation Flags has a `CSS` file where all the most important languages flags are configured. The avaliable flags are: +The Django Translation Flags has a `CSS` file where all the most important languages flags are configured. + +The avaliable flags are: `af`: Afrikaans, `ar`: Arabic, `az`: Azerbaijani, `de`: German, `en`: English, `en-au`: Australian English, `es`: Spanish, `es-ar`: Argentinian Spanish, `es-mx`: Mexican Spanish, `fr`: French, `hi`: Hindi, `hu`: Hungarian, `id`: Indonesian, `it`: Italian, `ja`: Japanese, `ko`: Korean, `nl`: Dutch (Nederlands), `pl`: Polish, `pt`: Portuguese, `pt-br`: Brazilian Portuguese, `ru`: Russian, `sv`: Swedish, `tr`: Turkish, `uk`: Ukrainian, `zh-cn`: Simplified Chinese, `zh-hans`: Simplified Chinese and `zh-hant`: Traditional Chinese. ![](assets/img/flags.png) -The App get the language code from `LANGUAGES` on `settings.py` and then it makes the magic happen. +The App get the language code from `LANGUAGES` on `settings.py` and then it concatenates the language codes with the name of the icon class and shows the correct flags.. + +See the all Django supported languages in module `django.conf.locale.LANG_INFO` +*LANG_INFO is a dictionary structure to provide meta information about languages.* + Feedback ===== diff --git a/tox.ini b/tox.ini index 1a5a3cc..1cf0c6a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,15 @@ [tox] envlist = py36-django{20} +[tox:travis] +3.6 = py36 + [testenv] commands = python runtests.py setenv = DJANGO_SETTINGS_MODULE=tests.settings PYTHONPATH={toxinidir} basepython = py36: python3.6 -deps = django20: Django==2.0 \ No newline at end of file +deps = + django20: Django==2.0 + pypandoc==1.3.3 \ No newline at end of file