Skip to content

Commit

Permalink
chore(release): v0.1.1
Browse files Browse the repository at this point in the history
- Bump version to v0.1.1 for new release
- Update CHANGELOG.md with latest changes
- Add distribution files for publishing on PyPI
- Ensure compatibility with the latest Django version
  • Loading branch information
Nabute committed Sep 14, 2024
1 parent 9f95c95 commit 14a248b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## [v0.1.1] - 2024-09-14

This version brings enhanced flexibility, making the `lisan` package highly adaptable for multilingual projects by enabling external services for automated translations while maintaining a customizable architecture.

### Added
- **Pluggable Translation Service**: Introduced a base `BaseTranslationService` class, allowing easy integration of third-party or custom translation services.
- Added an example implementation with `GoogleTranslateService` using Google’s translation API.
- Enabled dynamic loading of translation services via Django settings (`LISAN_DEFAULT_TRANSLATION_SERVICE`).

- **Auto-Translation Support**:
- Added an `auto_translate` option to `get_lisan_field` in `LisanModelMixin`, enabling automatic translation fallback when specific language translations are missing.
- Added auto-translation support in serializers and admin displays for models with translatable fields.

- **Bulk Translation Operations**: Added `set_bulk_lisans` method to support creating or updating translations for multiple languages in bulk.

- **Flexible Field Types**: Enhanced support for additional field types, such as `TextField`, `JSONField`, and more, in translatable models.

- **Customizable Admin Display**:
- Introduced `lisan_display_format` for customizing how translated fields appear in the Django admin interface.

- **Middleware Improvement**: Enhanced `LanguageMiddleware` to support multiple language detection sources, including query parameters (`?lang=xx`), cookies, and user profile settings.

### Fixed
- Improved fallback language handling for missing translations, with a new configuration (`LISAN_FALLBACK_LANGUAGES`) allowing developers to define custom fallback hierarchies.

### Configuration Changes
- **New Settings**:
- `LISAN_DEFAULT_TRANSLATION_SERVICE`: Configure the default translation service dynamically.
- `LISAN_FALLBACK_LANGUAGES`: Customize fallback languages in case a specific translation is missing.

---

### Migration Notes
No database migrations are required for this release, but additional configuration in `settings.py` may be necessary to leverage new features like auto-translation and pluggable services.

---

### Future Plans
- Introduce caching for external translation service results to minimize API calls.
- Add support for other translation services such as DeepL and Microsoft Translator.
- Improve manual translation management in the Django admin interface.
1 change: 0 additions & 1 deletion lisan/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def read_file(filename):

setup(
name='lisan',
version='0.1.0',
version='0.1.1',
packages=find_packages(),
include_package_data=True,
license='MIT',
Expand Down

0 comments on commit 14a248b

Please sign in to comment.