{"id":16390300,"url":"https://github.com/mom1/django-tof","last_synced_at":"2025-03-16T16:31:09.651Z","repository":{"id":57422403,"uuid":"218005321","full_name":"mom1/django-tof","owner":"mom1","description":"Django models translation on fly","archived":false,"fork":false,"pushed_at":"2020-04-17T10:10:46.000Z","size":333,"stargazers_count":28,"open_issues_count":22,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T08:16:30.885Z","etag":null,"topics":["django","django-models","django-models-translation","django-tof","i18n","internationalization","python","translation"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mom1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-28T08:59:52.000Z","updated_at":"2024-03-10T07:55:05.000Z","dependencies_parsed_at":"2022-09-13T15:41:22.450Z","dependency_job_id":null,"html_url":"https://github.com/mom1/django-tof","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mom1%2Fdjango-tof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mom1%2Fdjango-tof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mom1%2Fdjango-tof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mom1%2Fdjango-tof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mom1","download_url":"https://codeload.github.com/mom1/django-tof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822283,"owners_count":20353499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-models","django-models-translation","django-tof","i18n","internationalization","python","translation"],"created_at":"2024-10-11T04:42:46.050Z","updated_at":"2025-03-16T16:31:09.244Z","avatar_url":"https://github.com/mom1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub issues](https://img.shields.io/github/issues/mom1/django-tof.svg)\n![GitHub stars](https://img.shields.io/github/stars/mom1/django-tof.svg)\n![GitHub Release Date](https://img.shields.io/github/release-date/mom1/django-tof.svg)\n![GitHub commits since latest release](https://img.shields.io/github/commits-since/mom1/django-tof/latest.svg)\n![GitHub last commit](https://img.shields.io/github/last-commit/mom1/django-tof.svg)\n[![GitHub license](https://img.shields.io/github/license/mom1/django-tof)](https://github.com/mom1/django-tof/blob/master/LICENSE)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ef1b0b5bb51048a6a03f3cc87798f9f9)](https://www.codacy.com/manual/mom1/django-tof?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=mom1/django-tof\u0026amp;utm_campaign=Badge_Grade)\n[![codecov](https://codecov.io/gh/mom1/django-tof/branch/master/graph/badge.svg)](https://codecov.io/gh/mom1/django-tof)\n\n[![PyPI](https://img.shields.io/pypi/v/django-tof.svg)](https://pypi.python.org/pypi/django-tof)\n[![PyPI](https://img.shields.io/pypi/pyversions/django-tof.svg)]()\n![PyPI - Downloads](https://img.shields.io/pypi/dm/django-tof.svg?label=pip%20installs\u0026logo=python)\n\n# django-tof\nDjango models translation on fly 🛸️\n\n----\nThis project was initiated, promoted and accompanied by winePad GmbH. All development based on ideas, experience and financing by winePad GmbH (winePad.at).\n\n----\n\n[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/i0QJJJEMKSU/0.jpg)](https://www.youtube.com/watch?v=i0QJJJEMKSU)\n\n_[Russian readme](README_ru.md)_\n\n----\nThe background and objectives of this projects are described [here](https://github.com/mom1/django-tof/wiki/django-tof)\n\nAn Application for dynamic translation of existing Django models into any number of languages.\n\n  - without need to change existing model classes\n  - without need to reboot servers\n  - without changing the use of translated fields\n  - ready to work after install and indicated in INSTALLED_APPS\n  - fully integrated in Django admin\n\n## Installation\n\n`pip install django-tof`\n\n`python manage.py migrate tof`\n\n~~~python\n# settings.py\n...\nINSTALLED_APPS = [\n...\n'tof',\n...\n]\n~~~\nDon't forget to do if it necessary `python manage.py collectstatic`\n\n## How to use\n\n  1. In the simplest use case django-tof allows you to store translation into the current language.\nYou don't need special settings for this, just add this field into admin panel to the \"Translatable fields\" model.\nIn this case if current language is 'en', then the value saved in the model will be displayed only if the current language is 'en'.\n  1. If you need to support a certain number of languages and add them at the same time, you can use `TofAdmin`.\nUsing the `class CustomModelAdmin(TofAdmin)` will cause the translated fields (added to the \"Translatable fields\") will be able to specify a specific language.\nAt the same time, it is possible to leave some fields in the previous form by specify them in `TofAdmin` with attribute `only_current_lang = ('description', )`. \u003cbr\u003e\n![Widget for translatable fields](https://raw.githubusercontent.com/mom1/django-tof/master/docs/images/field_with_langs.jpeg)\n  1. You can also use inline translation submission forms. To do this, specify admin class (always inherited from \"TofAdmin\") `inlines = (TranslationTabularInline, )`\nor `inlines = (TranslationStackedInline, )`\n\n## Programmatic use\nLike a standard using, but it is possible to get a specific translation.\n\n~~~python\nfrom django.utils.translation import activate\n\nactivate('en')\nbook = Book.objects.first()\nbook.title  # =\u003e Title en\nbook.title.de  # =\u003e Title de\n~~~\n\n## Settings\n\n_The value for these variables can be specified in your settings.py_\n\nDEFAULT_LANGUAGE: _default_ \"en\" - Default language is stub, used if not other translations is found.\n\nFALLBACK_LANGUAGES: _default_ `{SITE_ID: ('en', 'de', 'ru'), 'fr': ('nl', ),}` - Determinate the order of search of languages for translation if the translation is in desired\nno language. The key can be SITE_ID, None or language.\n\nThe processing order is this, if a translation into current/requested language is not found, then first we checked by the language key, if there is, looking translations for requested languages,\nif not - we take the SIDE_ID key.\nFor example:\n\n  - if current language \"fr\", then searching order will be next: \"fr\" -\u003e \"nl\" -\u003e DEFAULT_LANGUAGE -\u003e then if there is an original value that was before the declaration of this field like translatable.\n  - if current language \"en\", then searching order will be next \"en\" -\u003e \"de\" -\u003e \"ru\" -\u003e DEFAULT_LANGUAGE -\u003e then if there is an original value that was before the declaration of this field like translatable.\n\nDEFAULT_FILTER_LANGUAGE: _default_ \"current\" - Indicates in which translations search/filter values. May be in the next forms `__all__`, `current`, `['en', 'de']`, `{'en', ('en', 'de', 'ru')}`\n\n  - `current` - if this value is assigned, the filtering is occurs only on the translation into the current language. This is a default value.\n  - `__all__` - if this value is assigned, the filtering is occurs for all translations.\n  - `['en', 'de']` - if this value is assigned, the filtering is occurs according to translations of the specified languages.\n  - `{'en', ('en', 'de', 'ru')}` - if this value is assigned, the filtering is occurs according to translations of languages received by the key of current language.\n\nCHANGE_DEFAULT_MANAGER: _default_ \"True\" - Changing the default manager of the model. If it True, then standard manager is transferred into class attribute \"objects_origin\",\nand \"objects\" becomes the standard manager inherited from standard with adding the functionality that recognized translated fields and takes into account settings from  DEFAULT_FILTER_LANGUAGE.\n\n\n## Requirements\n\n  - Python (\\\u003e=3.6)\n  - Django (\\\u003e=2.2)\n\n## How to start development\n\n  1. Fork this project\n  2. Clone the repo\n  3. Create new branch\n  4. **Change directory `example_project`**\n  5. You can use  [pyenv](https://github.com/pyenv/pyenv) to select the version of python `pyenv local 3.8.0`\n  6. We are using [poetry](https://poetry.eustace.io/docs/#installation)\n  7. Run: `poetry env use python` to use your python version.\n  8. Run: `poetry install` to install all requirements.\n  9. Run: `poetry shell` for activation virtual environment.\n  10. Run: `python manage.py runserver` to start the development server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmom1%2Fdjango-tof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmom1%2Fdjango-tof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmom1%2Fdjango-tof/lists"}