{"id":31846860,"url":"https://github.com/frojd/wagtail-systemtext","last_synced_at":"2025-10-12T09:17:23.769Z","repository":{"id":62588098,"uuid":"76848107","full_name":"Frojd/wagtail-systemtext","owner":"Frojd","description":"Simplified Wagtail system text management","archived":false,"fork":false,"pushed_at":"2021-05-25T19:47:45.000Z","size":53,"stargazers_count":8,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-25T00:56:29.143Z","etag":null,"topics":["django","static-text","wagtail"],"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/Frojd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-19T09:32:16.000Z","updated_at":"2024-05-29T08:49:54.000Z","dependencies_parsed_at":"2022-11-03T22:41:56.022Z","dependency_job_id":null,"html_url":"https://github.com/Frojd/wagtail-systemtext","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Frojd/wagtail-systemtext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2Fwagtail-systemtext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2Fwagtail-systemtext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2Fwagtail-systemtext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2Fwagtail-systemtext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frojd","download_url":"https://codeload.github.com/Frojd/wagtail-systemtext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frojd%2Fwagtail-systemtext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010970,"owners_count":26084837,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","static-text","wagtail"],"created_at":"2025-10-12T09:17:22.179Z","updated_at":"2025-10-12T09:17:23.757Z","avatar_url":"https://github.com/Frojd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Frojd/wagtail-systemtext.svg?branch=master)](https://travis-ci.org/Frojd/wagtail-systemtext) [![PyPI version](https://badge.fury.io/py/wagtailsystemtext.svg)](https://badge.fury.io/py/wagtailsystemtext)\n\n# Wagtail System Text\n\nThis is a library that enables cms editors to update static test in Wagtail. By using identifiers developers mark the strings that can be updated by the editor/moderator from the cms.\n\nA template identifier can look like this `{% systemtext \"title\" %}`. When this identifier are evaluated it will be added to the cms under the section **Settings / System Text** under the name `title`. The entry has a field called `string` that can be updated, this is the text that will be rendered to the website users.\n\nIdentifiers can also be grouped, by using the group argument `{% systemtext \"title\" group \"headlines\" %}` we can make management easier, identifiers without group will be assigned to the `general` group.\n\nBy default identifiers will added in lazy mode, so for instance when a site renders a idenifier it will be added to that sites set of identifiers. The are also management commands that both searches through your code base and finds suiteable identifiers (`find_and_add_systemtext`), syncs then betweeen sites (`sync_systemtext`) and manual add/delete commands (`add_systemtext` / `delete_systemtext`).\n\n\n## Requirements\n\n- Python 2.7\n- Django 1.8+\n- Wagtail 1.7+\n\n\n## Installation\n\nInstall the library with pip:\n\n```bash\n$ pip install wagtailsystemtext\n```\n\n\n## Quick Setup\n\nMake sure `wagtail.contrib.modeladmin` and `wagtailsystemtext` is added to your `INSTALLED_APPS`.\n\n\n```python\nINSTALLED_APPS = (\n    # ...\n    'wagtail.contrib.modeladmin',\n    'wagtailsystemtext',\n)\n```\n\nThen add SiteSystemTextMiddleware to your middlewares, make sure you add it after `wagtail.wagtailcore.middleware.SiteMiddleware`\n\n```python\nMIDDLEWARE_CLASSES = (\n    # ...\n    'wagtail.wagtailcore.middleware.SiteMiddleware',\n    'wagtailsystemtext.middlewares.SiteSystemTextMiddleware',\n)\n```\n\nDone!\n\n\n## Usage\n\nOverall the implementation follows the same convention of django translations.\n\n### Strings\n\nThis is how you work with regular text, supply identifer and group and retrive the systemtext string.\n\n```python\nfrom wagtailsystemtext.utils import systemtext as _st\n\n_st('my_text')\n_st('main_label', group='buttons')\n_st('main_label', group='buttons', default='My label')\n```\n\n### Lazy strings\n\nLazy strings are run when called upon, when for instance you want to initialize a systemtext retrival before the middleware has run. Like in a admin interface.\n\n```python\nfrom wagtailsystemtext.utils import systemtext_lazy as _st\n\n_st('my_text')\n_st('main_label', group='buttons')\n_st('main_label', group='buttons', default='My label')\n```\n\n### Templates\n\nSystemtext contains a templatetag called systemtext, that behaves in the same way as Djangos `{% trans... %}`\n\n#### Templatetags\n\n```python\n{% load systemtext %}\n\n{% systemtext \"my_text\" %}\n{% systemtext \"main_label\" group \"buttons\" %}\n{% systemtext \"main_label\" group \"buttons\" default \"My label\" %}\n```\n\n\n## Management commands\n\n- `find_and_add_systemtext`: Finds the systemtext identifiers in your applications (by looking for `_st` and `{% systemtext ... %}`) and adds them to each wagtail site).\n- `add_systemtext`: Add identifier to site(s)\n- `delete_systemtext`: Remove identifiers from site(s)\n- `sync_systemtext`: Sync identifiers between sites to make sure they contain the same\n- `list_systemtext`: List all active systemtext\n\n\n## Settings\n\n- `SYSTEMTEXT_CACHE_PREFIX`: Cache prefix (`\"wagtailsystemtext\"` by default)\n- `SYSTEMTEXT_CACHE_EXPIRY`: Cache expiry in seconds (10 min by default)\n- `SYSTEMTEXT_REBUILD_ON_SAVE`: If cache should be rebuilt on save (`True` by default)\n- `SYSTEMTEXT_USE_DEFAULT_ON_EMPTY`: If present, use default value when string is empty (`False` by default)\n\n\n### Release start\n\nThese hooks will automatically bump the application version when using `git flow release ...`\n\n```bash\nchmod +x $PWD/git-hooks/bump-version.sh\nln -nfs $PWD/git-hooks/bump-version.sh .git/hooks/post-flow-release-start\nln -nfs $PWD/git-hooks/bump-version.sh .git/hooks/post-flow-hotfix-start\n```\n\n\n## Roadmap\n\n- [x] `trans` template tag support\n- [x] Wagtail admin view with site permissions\n- [x] Cache-rebild on save through admin\n- [x] Default text support (on declaration)\n- [x] Lazy text transforms\n- [x] Add setting for fallbacking to default if string is empty\n- [x] Automatic tag discovery\n- [x] Sync command between sites\n- [ ] Group filter in Wagtail admin\n- [ ] Last accessed timestamps\n- [ ] `blocktrans` template tag support\n\n\n## Contributing\n\nWant to contribute? Awesome. Just send a pull request.\n\n\n## License\n\nWagtail System Text is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrojd%2Fwagtail-systemtext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrojd%2Fwagtail-systemtext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrojd%2Fwagtail-systemtext/lists"}