Saravanan666/pypi-org huggingface dataset:
Package: django-transadmin
# Django Transadmin - Translate your text from the adminCategories: (translation, internationalization, i18n)[![Build Status](https://api.travis-ci.org/vinyll/django-transadmin.png)](http://travis-ci.org/vinyll/django-transadmin)Works on Python 3.x and Python 2.6 or more.Compatible with the default Django template, [Jinja2](http://jinja.pocoo.org/) and [Jingo](https://github.com/jbalogh/jingo)#### BenefitsAdministrate your translations directly from the admin.Import your translations string from po files.Compatible with [Jingo](https://github.com/jbalogh/jingo)#### Quick tourIn a template:```html{{ _("String to translate") }}```In a python file:```pythonfrom transadmin.helpers import _translated_text = _("String to translate")```##### Import translationYou can directly create a string to translate from the admin.When it comes to generate many pages, you may prefer the automation script.##### Manuallyget to your admin (transadmin > Translation) and add:- source: "String to translate"- language: "fr"- trans: "Chaine à traduire"##### Automation scriptDjango allows you to generate _po_ files from templates, views and so on:```bashdjango-admin.py makemessages -l fr```_Transadmin_ then allows you to import a _po_ file into the database:```bashpython manage.py transadmin_import my/fr/file.po -l fr```This command reads translations from _my/file.po_ and import every string intothe database for _fr_ language.Your untranslated strings are now ready to get translated from the admin!> Even though the `transadmin_import` command is safe and preserves> your existing data. You are highly encouraged to make a backup before running> such commands.You can now view your website in French.## Installation#### DownloadVia pip ![latest version](https://pypip.in/v/django-transadmin/badge.png)```bashpip install django-transadmin```or the bleeding edge version```bashpip install -e git+https://github.com/vinyll/django-transadmin.git#egg=django-transadmin```#### update INSTALLED_APPSIn _settings.py_, add _transadmin_ in your INSTALLED_APPS```pythonINSTALLED_APPS = (# …,'transadmin',)```Congratulations, you're all set!#### ConfigurationA few settings are available:- `TRANSADMIN_LANGUAGES`: a tuple of tuples for available languages for the admin. Reads the settings.LANGUAGES by default.- `TRANSADMIN_CONTEXTS`: a tuple of tuples for available context. Free text by default.- `TRANSADMIN_FALLBACK_LANGUAGE`: a string representing the code of the languageto fallback to if a string is not translated into the current language.No fallback by default, displays the untranslated text.
Package: django-transitions
A wrapper ofpytransitionsfordjangoYou do notneeddjango-transitions to integratedjangoandpytransitions.
It is meant to be a lightweight wrapper (it has just over 50 logical lines of code)
and documentation how to go about using pytransitions inside a django application.This package provides:Example workflow implementation.Base classes and mixins toKeep it DRYKeep transitions consistentReduce cut and pasteAvoid boiler plate.Admin mixin to add workflow actions to the django admin.Admin templates
Package: django-translatable-fields
Translatable model fields for Django with admin integration. Uses PostgreSQL JSONField.InstallationAdd applicationINSTALLED_APPS=(...'translatable_fields',...)AddTranslatableFieldmodel fieldsfromdjango.dbimportmodelsfromdjango.utils.translationimportugettext_lazyas_fromtranslatable_fields.modelsimportTranslatableFieldclassPosition(models.Model):...title=TranslatableField(verbose_name=_('title'))description=TranslatableField(verbose_name=_('description'))...Create custom model admin formfromdjangoimportformsfromdjango.contrib.postgres.formsimportJSONFieldfromckeditor_uploader.widgetsimportCKEditorUploadingWidgetfromcareers.models.positionimportPositionfromtranslatable_fields.widgetsimportTranslatableWidgetclassPositionAdminForm(forms.ModelForm):title=JSONField(widget=TranslatableWidget(widget=forms.TextInput))description=JSONField(widget=TranslatableWidget(widget=CKEditorUploadingWidget))classMeta:model=Positionfields=(...'title','description',...)Create custom model admin with custom formfromdjango.contribimportadminfromcareers.forms.admin.positionimportPositionAdminFormclassPositionAdmin(admin.ModelAdmin):form=PositionAdminForm
Package: django-translatemessages
Django app for translating Django .po files.
It usesdeep-translatorandpolibInstallationwhen using pip:pip install django-translatemessagesWhen using poetry:poetry add django-translatemessagesConfigurationYou must declare in yoursettings.pywhat translator to use and its params.
Please refer todeep-translator Translatorsto know what parameters to specify (Note thatdjango-translatemessagesautomatically addsourceandtargetparameters)To configure GoogleTranslator, add in yoursettings.py:TRANSLATEMESSAGES_PARAMS = {
    "translator": {
        "class": "GoogleTranslator",
        "params": {},
    },
}To configure DeeplTranslator, you will need an API key, add in yoursettings.py:TRANSLATEMESSAGES_PARAMS = {
    "translator": {
        "class": "DeeplTranslator",
        "params": {
            "api_key": "your deepl api key",
        },
    },
}A good pratice in a Django application is to encapsulate strings to be translated into square brakets,
thus, you will noticed at once what strings has not been translated yet.
You can askdjango-translatemessagesto extract the string to translate from the source string.
Use a regex which selects with parentheses the text to extract. Note that if there is no match, the translation will not occur.For example if you want to translate[my english string]intomy french stringwith deepl, put insettings.py:TRANSLATEMESSAGES_PARAMS = {
    "extract_regex": r"\[(.*)\]",
    "translator": {
        "class": "DeeplTranslator",
        "params": {
            "api_key": "your deepl api key",
        },
    },
}The source language isenby default, but you can use another one in yoursettings.py:TRANSLATEMESSAGES_PARAMS = {
    "source_lang": "fr",
    ...
}IMPORTANT :By default,django-translatemessageswill produce translations with the flagfuzzy.
This force the developer to validate manually each translation.To do so, edit eachdjango.pofile, search for the line#, fuzzyand remove it if you agree with the proposed translation. If you do not do this,
Django will not display the translation. You can also usepoeditand pressCTRL + RETURNon each highlighted translation you agree.To disable auto-fuzzy feature, use this in yoursettings.py:TRANSLATEMESSAGES_PARAMS = {
    "auto_fuzzy": False,
    ...
}UsageTo auto-translate all languages in all apps:python ./manage.py translatemessagesDo not forget to do amakemessagesbefore if needed (See Django documentation)For more options, runpython ./manage.py translatemessages-hNews0.0.5 (2023-06-29)Force translation of fuzzy strings except when obsolete or already translated
by django-translatemessages0.0.4 (2023-06-21)Do not translate fuzzy strings0.0.2 (2023-06-11)First commit
Package: django-translate-po
django-translate-poSimple quick script for automatically translating .po files using Google or AWS. It speeds up internationalization by
giving translators machine translated base version to correct.UsageInstallationpip install django_translate_poUsage with translate functionfromdjango_translate_po.translator_functionsimportselect_translator_function# Can use AWS or Google translate service,# but if want use AWS service, you must add some settings into django's settings.py file, like this:AWS_TRANSLATE_SERVICE={"service_name":"translate","service_region":"us-west-2","access_key":"your-access-key","access_secret":"your-access_secret"}translator_function=select_translator_function("AWS")# translator_function = select_translator_function("Google")res_text=translator_function("your-text",source_code="us",target_code="de")Usage with translate po filefromdjango_translate_po.translateimportPoTranslatorpo_translator=PoTranslator("./a.po",translator_service="AWS",source_code="en",target_code="zh")po_translator.generate_text_for_untranslated()Changelog0.1.0Release Django-translate_po0.2.0Fix packages import error and refactor the project structure0.2.1Update the README.md file
Package: django-translation
Model TranslationConfigurationin settings.py fileINSTALLED_APPS=[...,'rest_framework','translation']MAIN_LANGUAGE='ar'#you could add any language could you wantin urlsurlpatterns=[....path('',include('translation.urls',namespace='translation'))]usageIn model:Usefrom translation.translation import TranslatableModelinstead ofdjango.db.models.ModelUsedjango.db.models.JSONFieldfor every translatable fielddefine "translatable" property which defines the translatable fields in the modeltranslatable is a dictionary that references the translatable fields in any tabletranslatable key is field nametranslatable value is a dictionary that can take two itemsform fieldandform field widgetthe default widget isforms.TextInputyou can access the current locale of certain field by usingmodel.translated_fieldfor example ifmodelhas fieldnameto get translated value to current locale
usemodel.translated_nameExamplefromdjangoimportformsfromdjango.dbimportmodelsfromtranslation.modelsimportTranslatableModelclassFoo(TranslatableModel):...# define translatabletranslatable={'name':{"field":forms.CharField},'bio':{"field":forms.CharField,"widget":forms.Textarea},}...# define your fields herename=models.JSONField(blank=True,null=True)bio=models.JSONField(blank=True,null=True)...In Forms:Usefrom translation.translation import TranslatableModelForminstead ofdjango.forms.ModelFormTranslationURlTo use translation form for any model just redirect to this urlplease note"next" query parameter is mandatory parameterfromdjango.urlsimportreversenext_url='/any/url/you/want/to/redirect/to/after/translation'reverse("{yourpath}:translate",kwargs={"app_label":"app_label","model":"model","pk":"pk"})+'?next={}'.format(next_url)In SerializerUseutils.serializers.TranslatableModelSerializerinstead ofrest_framework.serializers.ModelSerializerfromtranslation.serializersimportTranslatableModelSerializerclassFooSerializer(TranslatableModelSerializer):classMeta:fields='__all__'model=TranslatableTestModel...data={"title":{"en":"en_title","ar":"ar_title"},"description":{"en":"en_title","ar":"ar_title"}}serializer=FooSerializer(data=data)serializer.is_valid()serializer.save().to_representation(self, instance)it returns value by current localeserializer.data["title"]=>"en_title"if current locale isenwhen current does not exist it returns value by fallback locale.to_internal_value(self, data)it accepts single value and set it by current localedata = {"title": "foo title"}=>{"title": {"en": "foo title"}}ifenis current localeit accepts json value and set it as it isdata = {"title": {"en": "en foo title", "ar": "ar foo title"}}=>{"title": {"en": "en foo title", "ar": "ar foo title"}}it raises validation error when add language code that doe not exists in supported languagesIn templatesget_field_original_translationto get original field translation "main language" use filter for exampleEX:name|get_field_original_translation
Package: django-translation-aliases
A small library which adds “translate” and “blocktranslate”
template tags and modifies makemessages to work with them.Free software: BSD 3-Clause LicenseInstallationpip install django-translation-aliasesAdddjango_translation_aliasesto yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django_translation_aliases',
)This will add thetranslateandblocktranslatetemplate tags to
thei18nlibrary so that you can use them in your templates:{% load i18n %}
{% translate "This message" %}
{% blocktranslate trimmer %}
    Another message
{% endblocktranslate %}Documentationhttps://django-translation-aliases.readthedocs.io/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.0 (2019-06-22)First release on PyPI.
Package: django-translation-manager
Django app for managing translations from admin.Using this django app you can easily manage and publish translations from django admin without editing .po files manually.Install packageuse pip to get the packagepip install django-translation-manageradd ‘translation_manager’ to settings.py: INSTALLED_APPSadd variables from Translation Manager’s defaults.py to your settings.pyadd post_publish signal to restart webserver:from translation_manager.signals import post_publish as translation_post_publish

translation_post_publish.connect(restart_server, sender=None)Supported versions of djangoWe support all django versions greater or equal 2.2.20.Using with django-rqWe support asynchronous translation processing by django-rq.Set translation processing method in settings.pyTRANSLATIONS_PROCESSING_METHOD = 'async_django_rq'Inslall django-rqpip install django_rqInstall django-redis-cachepip install django-redis-cacheWe tested it with django-rq 2.1.0 and django-redis-cache 2.1.0For configuration django_rq seehttps://github.com/ui/django-rqUsing with AngularjsWe support translation for Angularjs client-site app via REST apiEnable api communication in settingsTRANSLATIONS_ENABLE_API_COMMUNICATION = TrueEnable searching for translation strings in Angularjs source codesTRANSLATIONS_ENABLE_API_ANGULAR_JS = TrueSet path to Anguraljs source code files.The important thing is that it must be in the same file system.Configuration example:TRANSLATIONS_API_CLIENT_APP_SRC_PATH = '/var/srv/front/src'Add regex for matching translation strings in client app src files:TRANSLATIONS_API_TRANSLATION_STRINGS_REGEX = r''Inslall django REST framewrokpip install djangorestframeworkAdd translation manager urls in your url patternsfrom translation_manager import urls as translation_urls

urlpatterns.append(url(r'^translations/', include(translation_urls)))We tested it with django-rest-framework 3.4.6SyncDBuse syncdb./manage.py syncdbor migrate:./manage.py migrateLoad strings from po filesvia python shell./manage.py shell

from translation_manager.manager import Manager

m = Manager()
m.load_data_from_po()Add link to translation adminthis is optional in case you need it{% url admin:translation_manager_translationentry_changelist %}Known bugsIf you are using different base site you have to register admin to your site.License noteDjango Translation Manager is available under Mozilla Public License 2.0http://choosealicense.com/licenses/mpl-2.0/DonateThank you!We really appreciate every donation that helps us take Django Translation Manager to the next level.
Package: django-translation-po
Python PO translationDescription:A package that will read key values and get the translated value from django.po fileIssue & Why the package is created:I need to send English value and Arabic value to use it in a single page application. I searched for a package or tool to get the translated text from django.py file to use it in my SPA without duplicate the request and specify the language in the header in each request.This package is useful for developers who need migrate from purly backend to have separated backend and front end and they want to send translated values from their backend to frontend without duplicate the request OR translate the same value in the front end and backend.Steps:python manage.py makemessages -l [your-language]Write the translation value in django.po file. Thenpython manage.py compilemessages -l [your-language]LicenseMIT
Package: django-transplant
OverviewDjango-transplant is an app for performing easy merges of django user
accounts. It should play nicely with any third party social authentication
backend.RequirementsDjango-transplant requires:Django 1.2.5 or higher.If you plan to develop, or run the test suite you should also install:MockThis dependencywill notbe installed automatically via pip.InstallingTo install with pip into site-packages issue:pip install django-transplantTo install with pip into src folder (as git repo) issue:pip install -e \
git+http://github.com/lolek09/django-transplant#egg=django-transplantConfigurationAdd'transplant'to yourINSTALLED_APPS. If you plan to run the test
suite you should also add'transplant.tests':INSTALLED_APPS += (
        'transplant',
        'transplant.tests', # this is optional
)For your convenience django-transplant provides a default view for performing
User merges. You can use it like any FormView, and it’s name istransplant_merge. It expects a default template in ‘transplant/merge.html’.To hook it up just add it to yoururlconfat any URL:urplatterns = patterns('',
        ...
        url(r'^accounts/merge/$', include('transplant.urls')),
        ...
)You should be now able to get the merge form and submit it, but it will have
no effect. To utilize default merges you must setTRANSPLANT_OPERATIONSin your settings.py:TRANSPLANT_OPERATIONS = (
    (
        'transplant.tests.models.CustomProfile',
        'transplant.surgeons.DefaultSurgeon',
        {}
    ),
    (
        'transplant.tests.models.Item',
        'transplant.tests.surgeons.DefaultSurgeon',
        {'user_field': 'owner'}
    ),
    (
        'transplant.tests.models.Message',
        'transplant.tests.surgeons.DefaultSurgeon',
        {'manager': 'unread'}
    ),
)TRANSPLANT_OPERATIONSconsists of triples, each one of them specifies:Path to model class to be merged.Path toSurgeonclass to be used during the merge.Extra arguments.Currently supported extra arguments are:user_field- name of the user field that will be used by the Surgeon
during the merge (defaults to ‘user’).manager- name of Manager used during the merge. In the example above
only messages accessible via the ‘unread’ manager will be merged.You may be happy with the behavior ofDefaultSurgeonwhich is:set field given as ‘user_field’ to the user that performs the mergecall save() on each entity (so that all signals are triggered)set the is_active to False on the user that is mergedIf you want additional functionality consult the docs.DocumentationDocumentation is available athttp://django-transplant.readthedocs.org/Changelog0.0.2Addidional Surgeon class BatchSurgeon pefrorming batch updatesAdded UserMergeForm used by default by provided view0.0.1Surgery classSurgeon classes
- NopSurgeon class that does basically nothing
- DefaultSurgeon class for default merging behaviorDefault view provide for convenienceUrls provided for conveniene
Package: django-transtool
django-transtool===========Make translating your django project easier.|Installation------------**Requirements:*** django v1.8+* django-rosetta**\1\. Install** ``django-transtool``.* Via pip::$ pip install django-transtool* Via setuptools::$ easy_install django-transtoolFor install development version use ``git+https://github.com/liminspace/django-transtool.git@develop`` instead ``django-transtool``.**\2\. Set up** ``settings.py`` **in your django project.** ::INSTALLED_APPS = (...,'transtool',)
Package: django-traversal
Django Traversal 0.4====================Django Trversal - библиотека для создания контексто-зависимых и иерархических приложенийРеализует паттерн MVRT (Model View Resource Template) где за структуру данных отвечает Model, за взаимодействие с пользователем View, за отображения - Template, а за бизнес-логику Resource.Преимущества применения django-traversal:* Структура приложения становится более определённой, решается проблемма разростания представлений;* Небольшие ресурсы легко отлаживать и тестировать, каждый ресурс работает со своей моделью данных, так-что такая структура отлично масштабируется горизонтально;* Иерархический доступ к ресурсам позволяет без труда реализовать Access Control List или ACL — список контроля доступа, который определяет, кто или что может получать доступ к конкретному объекту, и какие именно операции разрешено или запрещено этому субъекту проводить над объектом.* Появляются большие возможности по формированию человеко-понятных урл (ЧПУ)Requirements------------* Python 2.6+* Django 1.4.5+Установка---------pip install django-traversalНастройка---------1. Добавьте traversal в список установленных приложений:INSTALLED_APPS = ('traversal',***)2. В файле resources.py, в вашем приложение, создайте корневой ресурс - класс, потомок traversal.resource.Resource, добавьте ему декоратор @resource_register(). После чего в настройках, добавьте путь к вашему корневому ресурсу:ROOT = 'your_app.resources.RootRecource'3. В файлах views.py ваших приложений, создайте фабрики построения путей - класс, потомок traversal.traverse.TraverseFactory, определите в данном классе app_resource_tree:app_resource_tree = {'RootResource': {"": index_view},'PostDetailResource': {"": some_view,"view_slug_in_url": another_view},}4. После чего в настройках, добавьте список путей к каждой из ваших фабрик построения путей:TRAVERSE_FACTORIES = ('your_app.views.YourFactory',)5. Подключаем traversal к стандартному роутеру в urls.py, после всех регулярных выражений:urlpatterns += [url(r'^', include('traversal.urls'), name='router')]На этом настройка завершена, можно приступать к реализации архитектуры вашего приложения,Пример приложения на DjangoTraversal:https://bitbucket.org/whitemaster/django-traversal-blogs
Package: django-trawler
Trawler is a django app designed to help audit a group of people or organization
in terms ofphishingawareness.When used as directed, you can launch your ownphaux-phishingcampaign and track
the members of your organization that actuallyfollow the linkor load the
images (either by default or by choice depending on how their mail client is
configured).This software was largely inspired by a presentation given byLance Spitznerin which he described his approach to phishing awareness.For more detail:http://django-trawler.readthedocs.org/InstallationIf you’re familiar with django apps, this process will be familiar.
Install using your choice ofpiporeasy_install:$ pip install django-trawler

or ...

$ easy_install django-trawlerConfigurationIn your project settings module:Addtrawleranddjango.contrib.admintoINSTALLED_APPS.Ensure your mail settings are appropriate (the app needs to send mail).Ensure you set the domain for your server (djangoSitesframework) so
admin links point to the right place.Includetrawler.urlsin your urlconf.MAKE ABSOLUTELY SUREDEBUG = Falsebefore launching a campaign (or yourtargetswill see nice django 404 pages).