Commit graph

57 commits

Author SHA1 Message Date
Serhii Tereshchenko
a1106d1fe1 fix: Fix indonesian language support
Refs #763
2024-10-17 11:14:03 +03:00
Serhii Tereshchenko
56c578400f fix: Support multiple translation fields in get_translation_fields 2024-08-07 17:59:44 +03:00
Serhii Tereshchenko
9d9a2ab8b0 chore: Update code for minumum python 3.9 2024-06-01 10:37:33 +03:00
Hugo Defrance
bdee9ff5b9 Feat: Add build_lang helper in utils 2024-05-16 12:29:07 +03:00
Victorien
a9e95e8c78
feat: Add types
Refs #716
2024-04-04 11:27:00 +03:00
Serhii Tereshchenko
8742ad3554 style: Reformat files (use double quotes) 2023-11-25 13:48:57 +02:00
Serhii Tereshchenko
86cfa3f913 chore: Sort imports 2023-05-30 17:51:20 +03:00
Gabriele Baldi
f69e3172bc
feat: Add support for ManyToManyFields 🧑‍🤝‍🧑 (#668) 2023-01-27 15:05:18 +02:00
Maksudul Haque
4927b6cb63
Make Context Managers (fallbacks and auto_populate) Thread Safe (#657) 2022-11-08 14:13:17 +00:00
Serg Tereshchenko
86b67c271e fix: Remove six (old compat layer for python2) 2022-07-13 23:14:28 +03:00
Serg Tereshchenko
25b6011a1f style: Apply black 2021-09-18 10:55:39 +03:00
Sergey Tereschenko
7a8a96ba18 chore(flake8): Fix linter errors. 2020-07-10 09:19:01 +03:00
Tim Gates
01a41783cb
docs: Fix simple typo, splitable -> splittable
There is a small typo in modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js, modeltranslation/utils.py.

Should read `splittable` rather than `splitable`.
2020-03-24 19:29:02 +11:00
Sergey Tereschenko
da5d8c91ba fix flake8 warnings 2020-02-14 17:27:12 +02:00
Adrian Berger
a7c0482b94 replace force_text to support django 3 2020-01-07 11:13:45 +01:00
Sergey Tereschenko
686e020974 Change permissions to 644 2019-12-18 00:30:13 +02:00
Misha Kalyna
5505208003 explicitly install and import six (which was removed from Django 3.0) 2019-10-05 21:07:08 +02:00
Dirk Eschler
49836c210d Satisfied flake8. 2017-11-24 15:14:40 +01:00
Ben Lopatin
2438300915
Add docstring documentation for utils.unique 2017-10-28 20:56:49 -04:00
oliphunt
28eb14e4fa CS fixes. 2015-05-26 12:18:45 +01:00
oliphunt
9480dba1c5 Add mt-bidi class to input fields for bi-directional languages. 2015-05-21 12:54:38 +01:00
Jacek Tomaszewski
d8e6f32cbd Django 1.8 compatibility changes (ref #299).
Thanks to Luca Corti for initial commit.
2015-04-13 00:43:09 +02:00
wrwrwr
902a7c9a72 Fixed Indonesian translation field and ForeignKey field name clash.
The official ISO-639-1 code for Indonesia is "id"; replaced this
problematic suffix with the ISO-639-2 3-letter code in the translation
field names (http://en.wikipedia.org/wiki/Indonesian_language).
2014-10-24 13:05:10 +02:00
Jacek Tomaszewski
71af06c7c9 Add configurable formfields (close #211, ref #163, #187).
This will hopefully at last resolve the problem with nullable CharFields.
2013-10-23 15:40:45 +02:00
Jacek Tomaszewski
b7ea1fac4c Further work towards Python 3 support. 2013-04-08 11:41:06 +02:00
Kudlaty
966c0f38ad Initial work towards python 3 support 2013-04-08 11:41:06 +02:00
wrwrwr
7ff0506f27 Context manager for temporarily switching fallbacks on or off. 2013-02-24 11:01:08 +01:00
wrwrwr
f168b55737 Apply population using a pre_save signal.
It can be used with ``get_or_create`` (without resaving) and, more importantly, fixture loading.
Extend population by providing two new modes: ``default`` that sets just the default translation (only if its not given; ensuring a fallback is available; alike ``update_translation_fields``) and ``required`` that further limits population by only filling default translation of non-nullable fields (minimum to keep some level of consistency).
Add a ``populate(mode)`` toggle on multilingual query set / manager and an ``auto_populate``  context manager for fixture loading.
2013-02-19 10:47:25 +01:00
Jacek Tomaszewski
079f745621 Small refactor in _join_css_class and its test. 2013-02-15 11:08:37 +01:00
deschler
f8c5d46b7a Simplified checks in _join_css_class and updated test to reflect the change (issue #141). 2013-02-15 00:57:55 +01:00
deschler
83b133049d Fixed _join_css_class() doesn't take settings.LANGUAGES into account and fails with 'en-us'. Resolves issue #141. 2013-02-14 22:15:00 +01:00
Dirk Eschler
e94bbcd3d2 Applied styleguide. We allow 100 chars now, let's use the space. 2013-02-06 11:52:46 +01:00
wrwrwr
715b13a1e9 Do generate CSS class name for fields starting with an underscore (still seems to work with two-part codes). 2013-01-24 13:05:44 +01:00
Jacek Tomaszewski
5b51a7b793 Add fallback language feature and base tests. 2012-11-13 16:28:42 +01:00
Jacek Tomaszewski
86cb1e0de2 Use namespaced settings values in utils. 2012-11-13 16:03:09 +01:00
Dirk Eschler
3acfa09dbc - Validated codebase against pep8 and pyflakes.
- Fixed an undefined name bug in add_localized_fields error message when a model already has a field by the name that is added.
- Fixed redefined method name in ModeltranslationWithFileFields test class.
2012-10-24 11:06:35 +02:00
Dirk Eschler
9d58478b2e Fixed tabs don't properly support two-part language codes. Resolves issue 63. 2012-10-19 13:32:33 +02:00
Dirk Eschler
5d0afa21bd Fixed non-unicode verbose field names (with actual unicode characters) showing up empty in forms. Resolves issue 35. 2012-07-11 20:24:37 +00:00
Dirk Eschler
6f7704bc57 Some cleanups and validated codebase against PEP8 and coding guidelines. 2012-07-04 10:09:22 +00:00
Dirk Eschler
1c8e82890d Major refactoring of the admin integration. Subclassed BaseModelAdmin and InlineModelAdmin. Patching options in init doesn't seem to be thread safe. Instead used provided hooks like get_form, get_formset and get_fieldsets. This should resolve several problems with the exclude and fieldsets options and properly support options in inlines. Added a new admin option exclude_languages to exclude certain translation fields per admin class. Moved tests to separate folder and added tests for TranslationAdmin. To run the tests the settings provided in model.tests.modeltranslation have to be used (settings.LANGUAGES override doesn't work for TranslationAdmin). 2012-07-04 09:29:05 +00:00
Dirk Eschler
39262a8a02 Fixed a bug in the admin integration where an emptied default language field (which has been defined with "blank=True") hasn't cleared the default field. Resolves issue 47. 2011-04-10 20:27:24 +00:00
Dirk Eschler
974503ca0a Moved determination of default language into settings. 2010-07-06 09:52:41 +00:00
Dirk Eschler
adc7af11d3 Fixed fieldname isn't ensured to be string. Resolves issue 41 (thanks martyn.clement). 2010-06-30 19:37:37 +00:00
Dirk Eschler
77350b1e89 Factored out settings into a separate settings.py and consistently used an app specific settings prefix, TRANSLATION_REGISTRY now deprecated in favour of MODELTRANSLATION_TRANSLATION_REGISTRY. 2010-06-26 08:54:08 +00:00
Dirk Eschler
406abfb89f Refactored creation of translation fields. Added a factory to handle the creation of translation fields. The factory also checks if a field is officially supported by modeltranslation and bails out early in case it doesn't. Resolves issue 37. 2010-06-24 13:24:03 +00:00
Dirk Eschler
5d5bf067ad Handle related fields in field descriptor (work in progress, issue 36). 2010-06-22 22:02:16 +00:00
Dirk Eschler
006239a68e Restored handling of KeyError raised by ForeignKeyTanslationField. 2010-06-21 20:26:52 +00:00
Dirk Eschler
0ac39fba8c Added configurable default value per field instance. Resolves issue 28 (thanks to bmihelac). 2010-06-21 13:38:34 +00:00
Dirk Eschler
9b68efda05 Added setting to override the default language. Resolves issue 2. 2010-06-21 09:43:41 +00:00
Dirk Eschler
b8fab905dc Fixed TranslationField pre_save does not get the default language correctly. Factored out determination of default language. Resolves issue 31 (thanks to jaap). 2010-06-17 14:33:39 +00:00