From fa78cd7f213fad847f26bceaf1e6e96fcba3d5b6 Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Mon, 19 Feb 2018 20:55:14 +0100 Subject: [PATCH] add section about overriding the locales in the docs; make an example of how to override the locales --- README.rst | 45 +++++++++++++++--- ROADMAP.rst | 29 +++++++---- docs/index.rst | 45 +++++++++++++++--- .../fobi_locale/en/LC_MESSAGES/django.mo | Bin 0 -> 508 bytes .../fobi_locale/en/LC_MESSAGES/django.po | 29 +++++++++++ .../simple/settings/alternative_labels.py | 8 ++++ src/fobi/tests/test_core.py | 7 --- 7 files changed, 134 insertions(+), 29 deletions(-) create mode 100644 examples/simple/fobi_locale/en/LC_MESSAGES/django.mo create mode 100644 examples/simple/fobi_locale/en/LC_MESSAGES/django.po create mode 100644 examples/simple/settings/alternative_labels.py diff --git a/README.rst b/README.rst index 48cac8e6..e3d4a478 100644 --- a/README.rst +++ b/README.rst @@ -97,7 +97,14 @@ Roadmap ======= Some of the upcoming/in-development features/improvements are: -- Bootstrap 4 and Foundation 6 support (in version 0.13). +- Implement disabling forms based on dates. +- Class based views. +- Cloning of forms. +- JSON schema support. +- Webpack integration. +- Improved Django REST framework OPTIONS. +- Bootstrap 4 support. +- Foundation 6 support. See the `TODOS `_ @@ -2173,13 +2180,39 @@ imports should go smoothly. It is though possible to make an import ignoring missing form element and form handler plugins. You would get an appropriate notice about that, but import will continue leaving the broken plugin data out. +Translations +============ Available translations -====================== -English is the primary language. +---------------------- +English is the primary language. The following translations are +available (core and plugins) -- `Dutch `_ (core and plugins) -- `German `_ (core and plugins) -- `Russian `_ (core and plugins) +- `Dutch `_ +- `German `_ +- `Russian `_ +- `French `_ (not yet released) + +Overriding translations +----------------------- +There might be cases if you wish to override certain translations. This can +be done very easily by introducing of a custom locale path in your project. + +See the following as a good example of overriding some English labels. + +`custom settings +`__ +`custom locales directory +`__ + +Run the example project as follows: + +.. code-block:: sh + + cd examples/simple/ + ./manage.py runserver --settings=settings.alternative_labels + +In the example given, "Boolean" and "Checkbox select multiple" plugin names +are renamed to "Checkbox" and "Multiple checkboxes" respectively. Debugging ========= diff --git a/ROADMAP.rst b/ROADMAP.rst index a84bf5e0..c2f9326f 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -3,16 +3,25 @@ Roadmap ======= Upcoming releases road-map. -unscheduled ------------ -yyyy-mm-dd (future). +See the `issues `_. +.. note:: + + If you need any of the below mentioned features or any features mentioned + in the issues sooner than they appear, consider sponsoring releases of + the desired features. Mail me for the details. + +Unscheduled +----------- +The following issues/features are planned to be implemented/solved in the +upcoming releases. + +- Implement disabling forms based on dates. +- Class based views. +- Cloning of forms. +- JSON schema support. +- Webpack integration. +- Improved Django REST framework OPTIONS. - Bootstrap 4 support. - Foundation 6 support. - -unscheduled ------------ -This release contains minor backwards incompatible changes, related to the -change of the name of the "simple" theme into "django_admin_style" theme. - -- The "simple" theme has been renamed to "django_admin_style". +- The "simple" theme would be renamed to "django_admin_style". diff --git a/docs/index.rst b/docs/index.rst index 26754f12..e695b3c4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -97,7 +97,14 @@ Roadmap ======= Some of the upcoming/in-development features/improvements are: -- Bootstrap 4 and Foundation 6 support (in version 0.13). +- Implement disabling forms based on dates. +- Class based views. +- Cloning of forms. +- JSON schema support. +- Webpack integration. +- Improved Django REST framework OPTIONS. +- Bootstrap 4 support. +- Foundation 6 support. See the `TODOS `_ @@ -2173,13 +2180,39 @@ imports should go smoothly. It is though possible to make an import ignoring missing form element and form handler plugins. You would get an appropriate notice about that, but import will continue leaving the broken plugin data out. +Translations +============ Available translations -====================== -English is the primary language. +---------------------- +English is the primary language. The following translations are +available (core and plugins) -- `Dutch `_ (core and plugins) -- `German `_ (core and plugins) -- `Russian `_ (core and plugins) +- `Dutch `_ +- `German `_ +- `Russian `_ +- `French `_ (not yet released) + +Overriding translations +----------------------- +There might be cases if you wish to override certain translations. This can +be done very easily by introducing of a custom locale path in your project. + +See the following as a good example of overriding some English labels. + +`custom settings +`__ +`custom locales directory +`__ + +Run the example project as follows: + +.. code-block:: sh + + cd examples/simple/ + ./manage.py runserver --settings=settings.alternative_labels + +In the example given, "Boolean" and "Checkbox select multiple" plugin names +are renamed to "Checkbox" and "Multiple checkboxes" respectively. Debugging ========= diff --git a/examples/simple/fobi_locale/en/LC_MESSAGES/django.mo b/examples/simple/fobi_locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..cc0731c533d5ffe8ee940c116253a7263a22a952 GIT binary patch literal 508 zcmYL`!EO^V5Qew3h-#1Rg#!oQ(WJWpp@RY_Xb#utyt0O~NjA91 zhB>>=rRNYvu=|1An8K-k)`i=H-+Rw zl29N_@kX`9pW?pe*%ZnOPBV61@pAO`TQ$z(Lihl+6UJ*1tm7, 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-19 13:21-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Artur Barseghyan \n" +"Language-Team: LANGUAGE \n" +"Language: English \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +#: contrib/apps/drf_integration/form_elements/fields/boolean/base.py:27 +#: contrib/plugins/form_elements/fields/boolean/base.py:20 + +#: contrib/apps/drf_integration/form_elements/fields/boolean/base.py:27 +#: contrib/plugins/form_elements/fields/boolean/base.py:20 +msgid "Boolean" +msgstr "Checkbox" + +#: contrib/apps/drf_integration/form_elements/fields/checkbox_select_multiple/base.py:30 +#: contrib/plugins/form_elements/fields/checkbox_select_multiple/base.py:27 +msgid "Checkbox select multiple" +msgstr "Multiple checkboxes" diff --git a/examples/simple/settings/alternative_labels.py b/examples/simple/settings/alternative_labels.py new file mode 100644 index 00000000..296a29c3 --- /dev/null +++ b/examples/simple/settings/alternative_labels.py @@ -0,0 +1,8 @@ +import os +from .base import * + +LOCALE_PATHS = [ + os.path.abspath(os.path.join(BASE_DIR, 'fobi_locale')), + # os.path.abspath(os.path.join(BASE_DIR, 'locale')), +] +# import ipdb; ipdb.set_trace() diff --git a/src/fobi/tests/test_core.py b/src/fobi/tests/test_core.py index 22f49ce7..29e2ab17 100644 --- a/src/fobi/tests/test_core.py +++ b/src/fobi/tests/test_core.py @@ -22,13 +22,6 @@ __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('FobiCoreTest',) -__title__ = 'fobi.tests.test_core' -__author__ = 'Artur Barseghyan ' -__copyright__ = '2014-2016 Artur Barseghyan' -__license__ = 'GPL 2.0/LGPL 2.1' -__all__ = ('FobiCoreTest',) - - class FobiCoreTest(TestCase): """Tests of django-fobi core functionality."""