All Projects → cordery → django-languages-plus

cordery / django-languages-plus

Licence: MIT License
Provides models and fixtures for working with both common languages and 'culture codes' or locale codes, like pt-BR.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to django-languages-plus

Tempura
Pure Clojure/Script i18n translations library
Stars: ✭ 211 (+904.76%)
Mutual labels:  i18n, translation
SonataTranslationBundle
SonataTranslationBundle
Stars: ✭ 72 (+242.86%)
Mutual labels:  i18n, translation
mobx-react-intl
A connector between mobx-react and react-intl
Stars: ✭ 32 (+52.38%)
Mutual labels:  i18n, translation
translation
👅 Translations (symfony/translation) to Nette Framework (@nette)
Stars: ✭ 55 (+161.9%)
Mutual labels:  i18n, translation
i18n
internationalize projects to Arabic
Stars: ✭ 67 (+219.05%)
Mutual labels:  i18n, translation
Glotpress Wp
🌍 🌎 🌏 GlotPress is a WordPress plugin to let you set up your own collaborative, web-based software translation tool.
Stars: ✭ 205 (+876.19%)
Mutual labels:  i18n, translation
django-i18nfield
Store internationalized strings in Django models with full forms support
Stars: ✭ 32 (+52.38%)
Mutual labels:  i18n, translation
Node Gettext
A JavaScript implementation of gettext, a localization framework.
Stars: ✭ 175 (+733.33%)
Mutual labels:  i18n, translation
i18n.cr
Internationalization API ( i18n ) for Crystal!
Stars: ✭ 36 (+71.43%)
Mutual labels:  i18n, translation
mobility-actiontext
Translate Rails Action Text rich text with Mobility.
Stars: ✭ 27 (+28.57%)
Mutual labels:  i18n, translation
I18next Express Middleware
[deprecated] can be replaced with i18next-http-middleware
Stars: ✭ 195 (+828.57%)
Mutual labels:  i18n, translation
inlang
Open Source Localization Solution for Software.
Stars: ✭ 160 (+661.9%)
Mutual labels:  i18n, translation
Linguist
Easy multilingual urls and redirection support for the Laravel framework
Stars: ✭ 188 (+795.24%)
Mutual labels:  i18n, translation
Weblate
Web based localization tool with tight version control integration.
Stars: ✭ 2,719 (+12847.62%)
Mutual labels:  i18n, translation
React Translated
A dead simple way to add complex translations (i18n) in a React (DOM/Native) project 🌎🌍🌏
Stars: ✭ 176 (+738.1%)
Mutual labels:  i18n, translation
fluent-vue
Internationalization plugin for Vue.js
Stars: ✭ 137 (+552.38%)
Mutual labels:  i18n, translation
Formatjs
The monorepo home to all of the FormatJS related libraries, most notably react-intl.
Stars: ✭ 12,869 (+61180.95%)
Mutual labels:  i18n, translation
Es2015 I18n Tag
ES2015 template literal tag for i18n and l10n (translation and internationalization)
Stars: ✭ 171 (+714.29%)
Mutual labels:  i18n, translation
deepl-api-connector
Connector library for deepl.com rest translation api
Stars: ✭ 12 (-42.86%)
Mutual labels:  i18n, translation
pydantic-i18n
pydantic-i18n is an extension to support an i18n for the pydantic error messages.
Stars: ✭ 32 (+52.38%)
Mutual labels:  i18n, translation

Django Languages Plus

https://travis-ci.org/cordery/django-languages-plus.svg?branch=master

django-languages-plus provides models and fixtures for working with both common languages and 'culture codes' or locale codes, like pt-BR.

Note that this is only a small (but popular) subset of all living languages, and is not even a comprehensive set of the ISO 639 languages. It does however include the endonym/autonym/exonym.

The Language model contains all ISO 639-1 languages and related information from http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

The model provides the following fields (original wikipedia.org column name in parentheses).

  • name_en (ISO Language Name)
  • name_native (Native Name)
  • iso_639_1 (639-1)
  • iso_639_2T = (639-2/T)
  • iso_639_2B = (639-2/B)
  • iso_639_3 = (639-3)
  • family = (Language Family)
  • countries_spoken

Installation

pip install django-languages-plus

Usage

  1. Add languages_plus to your INSTALLED_APPS

  2. Migrate your database and load the language data fixture:

    python manage.py migrate
    python manage.py loaddata languages_data.json.gz
    
  3. In your code use:

    from languages_plus.models import Language
    lang = Language.objects.get(iso_639_1='en')
    

Generating Culture Codes (ex: pt_BR)

django-countries-plus(https://pypi.python.org/pypi/django-countries-plus) is now an explicit requirement. After installing both packages you can run the following command once to associate the two datasets and generate a list of culture codes (pt_BR for example):

from languages_plus.utils import associate_countries_and_languages
associate_countries_and_languages()

Requirements

django-countries-plus

Django: Tested against the latest versions of 1.11, 2, and 3.

Running Tests

Does the code actually work?

$ poetry install
$ poetry run pytest

Or for the full tox suite:

$ poetry install
$ pip install tox
$ tox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].