{"id":21649490,"url":"https://github.com/rollinger/babelbase","last_synced_at":"2026-04-14T01:31:11.211Z","repository":{"id":262357015,"uuid":"886986829","full_name":"rollinger/babelbase","owner":"rollinger","description":"Database powered Translations for Django","archived":false,"fork":false,"pushed_at":"2024-11-13T04:05:21.000Z","size":26,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T02:38:39.439Z","etag":null,"topics":["django","translation"],"latest_commit_sha":null,"homepage":"","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/rollinger.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-12T01:06:04.000Z","updated_at":"2024-11-13T04:05:25.000Z","dependencies_parsed_at":"2024-11-12T02:21:46.505Z","dependency_job_id":"283af831-b45c-4392-a1d8-c016858d57f3","html_url":"https://github.com/rollinger/babelbase","commit_stats":null,"previous_names":["rollinger/babelbase"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rollinger/babelbase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollinger%2Fbabelbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollinger%2Fbabelbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollinger%2Fbabelbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollinger%2Fbabelbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollinger","download_url":"https://codeload.github.com/rollinger/babelbase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollinger%2Fbabelbase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31778580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","translation"],"created_at":"2024-11-25T07:31:23.205Z","updated_at":"2026-04-14T01:31:11.186Z","avatar_url":"https://github.com/rollinger.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Babelbase\n\n[![PyPI version](https://badge.fury.io/py/your-package-name.svg)](https://badge.fury.io/py/your-package-name)\n[![Build Status](https://travis-ci.org/yourusername/your-package-name.svg?branch=main)](https://travis-ci.org/yourusername/your-package-name)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA brief description of your Django package and its purpose.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Features\n\n- List of main features\n- Key functionalities\n- Benefits of using the package\n\n## Installation\n\n### Requirements\n\n- Python 3.10+\n- Django 4.2+\n\n### Install via pip\n\n```bash\npip install babelbase\n```\n\n### Install via github\n\nOr install directly from GitHub:\n\n```bash\npip install git+https://github.com/rollinger/babelbase.git\n```\n\n## Quick Start\n\nAdd 'babelbase' to your INSTALLED_APPS settings.\nRun migrations to create the models.\n\nEnable i18n language processing\n\n- path(\"i18n/\", include(\"django.conf.urls.i18n\")),\n- wrapping i18n_pattern to the urls\n- add 'django.middleware.locale.LocaleMiddleware', to the middleware list (must be between session and common mw)\n- add \"django.template.context_processors.i18n\", to context processor list\n\n## Configuration\n\n## Usage\n\nProvide usage examples here. You may want to include:\n\n- Code snippets showing how to use the package.\n- A brief explanation of key functionalities or components.\n- Screenshots or links to a demo if applicable.\n\n```python\nfrom your_package_name import SomeFunction\n# Code example here\nSomeFunction()\n```\n\n## Testing\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n- Fork the repository.\n- Create a new branch with a descriptive name.\n- Make your changes and commit them.\n- Open a pull request.\n  See the CONTRIBUTING.md file for more details.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\n## Contact\n\nFor questions or support, please contact your-email@example.com.\n\n### Explanation of Each Section\n\n- **Package Name**: Introduces the package and includes status badges.\n- **Table of Contents**: Provides easy navigation.\n- **Features**: Lists the main highlights of the package.\n- **Installation**: Includes dependencies and instructions for installation.\n- **Quick Start**: Basic setup steps.\n- **Configuration**: Additional setup steps for advanced configuration.\n- **Usage**: Shows examples of how to use the package.\n- **Testing**: Instructions for running tests.\n- **Contributing**: Guidelines for contributing to the project.\n- **License**: States the license for the project.\n- **Contact**: How to reach out for support.\n\nThis layout will help users understand the purpose, setup, and usage of your Django package at a glance.\n\n=== OLD\n\n# Content\n\nAdds database translations as a templatetag to the frontend and the backend.\n\n## How to use in Frontend\n\nFirst the view has to be loaded with the ContentMixin and a list of namespaces. Note that the global namespaces set in\nsettings.DB_TRANSLATION_DEFAULT_IDENTIFIER are always prepended to the view_identifier_list and available the the View's\ntemplate.\n\nWhile db translations are loaded on demand anywhere, using the ContentMixin on a view will prefetch all translations\nof a given namespace and make them available to the template. T\n\n```python\nfrom kinderwunschpraxis_stuttgart_villa_haag.content_i18n.views import ContentMixin\n\nclass StartNewsfeedView( ..., ContentMixin):\n    template_name = \"news/index.html\"\n    view_identifier_list = [\"newsfeed\"]\n```\n\nThen in the template you can use one of the templatetags \"get_content\" or \"blockcontent_i18n\".\nThree parameter are required:\n\n- view_id or namespace\n- key_id or identifier\n- placeholder: the placeholder text that should appear (optional, but strongly recommended)\n\n- The templatetags are builtins in settings.TEMPLATES and need not to be loaded separately.\n\n```html\n\u003cp class=\"mb-4\"\u003e\n  {% blockcontent_i18n \"newsletter\" 'subscription_tagline' %} Get expert\n  insights and timely updates on Private Markets developments with the Privatize\n  Newsletter. {% endblockcontent_i18n %}\n\u003c/p\u003e\n\n--or--\n\n\u003cp class=\"mb-4\"\u003e\n  {% get_content \"start_index\" \"solutions_offer_privatize_title\" \"What Privatize\n  offers to you and your clients\" %}\n\u003c/p\u003e\n```\n\n## How to use in Backend\n\nPrepare DB Translation for the script you want to use it after the imports, defining the namespaces to prefetch:\n\n```python\nfrom kinderwunschpraxis_stuttgart_villa_haag.content_i18n.translate import db_gettext_lazy as _db\nfrom kinderwunschpraxis_stuttgart_villa_haag.content_i18n.translate import DatabaseTranslationBuffer\n\ntranslation_namespace = [\"user_tracks\", \"investor_qualification\"]\ndb_buffer = DatabaseTranslationBuffer(translation_namespace)\n\n# Then use it anywhere:\n_db(db_buffer, \"investor_qualification\", \"arbitrary_text\", {\"name\": \"Phil\"})\n```\n\nIMPORTANT: Lazy loading is LOST once it is evaluated, so performing any operation on the returned **proxy** object will\nbreak the on-demand translation functionality. E.g.:\n\n```python\n_db(db_buffer, \"investor_qualification\", \"arbitrary_text\", {\"name\": \"Phil\"}) + \"another text\"\n```\n\nwould evaluate that composite string and translation would be lost.\n\n## How to use in Management Commands\n\n### manage_content_i18n_translations\n\nRUN: python manage.py manage_content_i18n_translations\n\nThis management command iterates through all templates and get_or_creates the translations from the\ntemplates. It also finds duplicates and stale translations.\n\nThis way, it's easy to update the translation state of an instance.\n\n### update_content_i18n_fixture\n\nRUN: python manage.py update_content_i18n_fixture\n\nThis management command updates the content_i18n fixture with the current state of the database.\n\n### load_content_i18n_fixture\n\nRUN: python manage.py load_content_i18n_fixture\n\nThis management command loads the content_i18n fixture into the database. Useful to apply translations to\nproduction server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollinger%2Fbabelbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollinger%2Fbabelbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollinger%2Fbabelbase/lists"}