Skip to content

Commit

Permalink
Update Readme.
Browse files Browse the repository at this point in the history
Fixed people_group_list.html.
  • Loading branch information
luisza committed Jul 2, 2023
1 parent 8f9d327 commit bfc1d42
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
39 changes: 35 additions & 4 deletions Readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Configure your settings
Run migrations
Run migrations

.. code:: bash
Expand All @@ -58,12 +58,12 @@ Add djgentelella urls in your project urls.py file
urlpatterns = djgentelellaurls + [
...
]
Usage
_________


In forms
In forms

.. code:: python
Expand Down Expand Up @@ -93,7 +93,7 @@ In templates using base template
.. code:: html

{% extends 'gentelella/base.html' %}

Take a look this file to note the template block that you can overwrite

Test
Expand Down Expand Up @@ -141,3 +141,34 @@ Remember update the package version before make deploy it on server.


sudo apt install node-babel-cli npm webpack

Translation
____________________________

To add a new translation for a word there are two options:

.. code:: bash
django-admin makemessages --all
This command adds words that are inside django templates to ``locale/es/LC_MESSAGES/django.po``, there these words can be translated.

To add a word you can use the following syntax.

.. code:: html

{% trans "new_word" %}

For words used in JavaScript files, the following command must be executed.

.. code:: bash
django-admin makemessages -d djangojs -l es --ignore *.min.js
This command adds words that are inside the ``gettext`` js function, to ``locale/es/LC_MESSAGES/djangojs.po``, there these words can be translated.

Here is an example of ``gettext`` implementation:

.. code:: js
alert(gettext("new_word"))
5 changes: 3 additions & 2 deletions demo/demoapp/templates/people_group_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ <h2>People group</h2>
<li class="d-flex">
<div class="p-2 flex-fill"> {{obj}} </div>
<div class="p-2 flex-fill">
<a class="btn btn-sm btn-outline-warning float-end" href="{% url 'pgroup-edit' obj.pk %}"><i class="fa fa-edit"></i></a></li>
<a class="btn btn-sm btn-outline-warning float-end" href="{% url 'pgroup-edit' obj.pk %}"><i class="fa fa-edit"></i></a>
</div>
</li>
{% endfor %}
</ul>
</div>
Expand All @@ -38,4 +39,4 @@ <h2>People group</h2>



{% endblock %}
{% endblock %}

0 comments on commit bfc1d42

Please sign in to comment.