Skip to content

Commit

Permalink
Merge pull request #94 from bbmokhtari/github-actions
Browse files Browse the repository at this point in the history
GitHub Actions
  • Loading branch information
bbmokhtari authored Oct 20, 2024
2 parents b579244 + 8f6d8c2 commit c555df7
Show file tree
Hide file tree
Showing 23 changed files with 686 additions and 483 deletions.
28 changes: 14 additions & 14 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand All @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at behzad.public@gmail.com. All
reported by contacting the project team at bbmokhtari.global@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
44 changes: 22 additions & 22 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contribution

[comment]: # (any changes to this module must also be reflected in /docs/contribution.rst)
[comment]: # "any changes to this module must also be reflected in /docs/contribution.rst"

This module provides comprehensive information on how to contribute to
Django Translations.
Expand All @@ -19,7 +19,7 @@ requests](https://github.com/bbmokhtari/django-translations/pulls).

Clone the repository of Django Translations:

``` bash
```bash
$ git clone https://github.com/bbmokhtari/django-translations.git
```

Expand All @@ -28,7 +28,7 @@ environment) install the required libraries for working on it. To do
this change directories into the root directory of the cloned repository
and run the following command:

``` bash
```bash
$ pip install -r requirements_dev.txt
```

Expand All @@ -46,7 +46,7 @@ from here on out run all the commands in that directory:

To create the example project:

``` bash
```bash
$ python create.py
```

Expand All @@ -55,26 +55,26 @@ repository.

Run migrations:

``` bash
```bash
$ python project/manage.py migrate
```

To populate some data for the Sample app:

``` bash
```bash
$ python project/manage.py shell
```

Then in the python shell:

``` python
```python
>>> from sample.utils import create_all
>>> create_all()
```

To run the example project:

``` bash
```bash
$ python project/manage.py runserver
```

Expand All @@ -92,7 +92,7 @@ and cities.

The example project supports `German (de)` and `Turkish (tr)` languages.

Change the *language* settings in your browser and reload the API
Change the _language_ settings in your browser and reload the API
endpoint, or if you are using a rest client like Postman change the
`Accept-Language` header in your request. The API endpoint should show
you the response in the requested language.
Expand All @@ -105,7 +105,7 @@ To change the basic configurations of Django Translations edit the
To generate the configurations file change directories into the root
directory of the cloned repository and run the following command:

``` bash
```bash
$ python config.py
```

Expand All @@ -116,7 +116,7 @@ cloned repository.

To run the tests: (make sure you have created [The example project]())

``` bash
```bash
$ python project/manage.py test
```

Expand All @@ -126,13 +126,13 @@ To build the documentation: (make sure you have created [The example
project](), also make sure to generate the
[Configurations](#configurations))

``` bash
```bash
$ make --directory docs html
```

To run tests on the examples of the documentation:

``` bash
```bash
$ make --directory docs doctest
```

Expand All @@ -142,23 +142,23 @@ Django Translations uses `flake8` for styling purposes.

To lint the code:

``` bash
```bash
$ flake8
```

## Releasing a version

Creating a git tag automatically causes Travis CI to:
Creating a git tag automatically causes CI to:

- Lint the code
- Run unit tests
- Run documentation tests
- Lint the code
- Run unit tests
- Run documentation tests

And if all of the above pass:

- Generate the proper documentation with the git tag as the version
number and upload it to GitHub Pages.
- Generate the python package with the git tag as the version number
and upload it to PyPI.
- Generate the proper documentation with the git tag as the version
number and upload it to GitHub Pages.
- Generate the python package with the git tag as the version number
and upload it to PyPI.

The tag **must** follow the `PEP 440` conventions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ Please ensure the following steps have been taken:
- [ ] Have you run the documentation tests?

## Note:
Please ensure that once the PR is submitted, you check Travis CI for build issues and submit an update to your PR as soon as possible.

Please ensure that once the PR is submitted, you check CI for build issues and submit an update to your PR as soon as possible.
46 changes: 23 additions & 23 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Django Translations

[![build](https://travis-ci.com/bbmokhtari/django-translations.svg?branch=master)](https://travis-ci.com/bbmokhtari/django-translations)
[![python](https://img.shields.io/badge/python-%3E%3D3.6%2C%20%3C4-0073b7)](https://pypi.org/project/django-translations/)
[![django](https://img.shields.io/badge/django-%3E%3D2.2%2C%20%3C4-0C4B33)](https://pypi.org/project/django-translations/)
[![django](https://img.shields.io/badge/django-%3E%3D2.2%2C%20%3C6.0-0C4B33)](https://pypi.org/project/django-translations/)
[![python](https://img.shields.io/badge/python-%3E%3D3.7%2C%20%3C4.0-0073b7)](https://pypi.org/project/django-translations/)

Django model translation for perfectionists with deadlines.

Expand All @@ -29,42 +28,42 @@ Currently, this project is incompatible with PostgreSQL.

## Requirements

- Python (\>=3.6, \<4)
- Django (\>=2.2, \<4)
- Python (\>=3.7, \<4)
- Django (\>=2.2, \<6)

## Installation

1. Install Django Translations using pip:
``` bash

```bash
$ pip install django-translations
```

2. Add `translations` to the `INSTALLED_APPS` in the settings of your
project:
``` python

```python
INSTALLED_APPS += [
'translations',
]
```

3. Run `migrate`:
``` bash

```bash
$ python manage.py migrate
```

4. Configure Django internationalization and localization settings:
``` python

```python
USE_I18N = True # use internationalization
USE_L10N = True # use localization
MIDDLEWARE += [ # locale middleware
'django.middleware.locale.LocaleMiddleware',
]
LANGUAGE_CODE = 'en-us' # default (fallback) language
LANGUAGES = ( # supported languages
('en', 'English'),
Expand All @@ -73,7 +72,7 @@ Currently, this project is incompatible with PostgreSQL.
('tr', 'Turkish'),
)
```

Please note that these settings are for Django itself.

## Basic Usage
Expand All @@ -82,7 +81,7 @@ Currently, this project is incompatible with PostgreSQL.

Inherit `Translatable` in any model you want translated:

``` python
```python
from translations.models import Translatable
class Continent(Translatable):
Expand All @@ -100,7 +99,7 @@ No migrations needed afterwards.

Use the admin extensions:

``` python
```python
from translations.admin import TranslatableAdmin, TranslationInline
class ContinentAdmin(TranslatableAdmin):
Expand All @@ -115,7 +114,7 @@ This provides specialized translation inlines for the model.

Use the queryset extensions:

``` python
```python
>>> from sample.models import Continent
>>> continents = Continent.objects.all(
... ).distinct( # familiar distinct
Expand Down Expand Up @@ -146,7 +145,7 @@ This provides a powerful yet familiar interface to work with the querysets.

Use the translation context:

``` python
```python
>>> from translations.context import Context
>>> from sample.models import Continent
>>> continents = Continent.objects.all()
Expand All @@ -157,12 +156,12 @@ Use the translation context:
... print(continents)
... print(continents[0].countries.all())
... print(continents[0].countries.all()[0].cities.all())
...
...
... continents[0].countries.all()[0].name = 'Change the name'
... context.update('de') # update the translations from the context
...
...
... context.delete('de') # delete the translations of the context
...
...
... context.reset() # reset the translations of the context
... print(':') # use the objects like before
... print(continents)
Expand Down Expand Up @@ -202,6 +201,7 @@ For more interesting capabilities browse through the
## Support the project

To support the project you can:

- ⭐️: [Star](http://github.com/bbmokhtari/django-translations/) it on GitHub.
- 💻: [Contribute](https://bbmokhtari.github.io/django-translations/contribution.html) to the code base.
- ☕️: [Buy](https://bbmokhtari.github.io/django-translations/donation.html) the maintainers coffee.
Loading

0 comments on commit c555df7

Please sign in to comment.