Skip to content

Commit

Permalink
Document the new in-context translation editor. Refs kiwitcms#1098
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov authored and SvetlomirBalevski committed Sep 24, 2019
1 parent d6f2abb commit cf77b9d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
Binary file added docs/source/_static/crowdin-in-context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 33 additions & 13 deletions docs/source/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Contribute
Kiwi TCMS team welcomes and appreciates any kind of contribution from you in
order to make Kiwi TCMS better and better. Anyone who is interested in
Kiwi TCMS is able to contribute in various areas, whatever you are a good
and experienced developer, documentation writer or even a normal user.
and experienced developer, documentation writer or even a regular user.

.. include:: set_dev_env.rst
:start-line: 2
Expand Down Expand Up @@ -64,38 +64,58 @@ Kiwi TCMS is using Crowdin as our translation service. You can find the project
at https://crowdin.com/project/kiwitcms. You need to register with Crowdin before
you can work on any translations!

To request a new language be added to Kiwi TCMS please
`create an issue <https://github.com/kiwitcms/Kiwi/issues/new>`_. In the description
let us know your Crowdin username!
To translate the application first turn on the special *translation mode* in
Kiwi TCMS via the language menu (top-right corner). Then use Crowdin in-context
editor to update the strings. The actual content on the page wil be updated on
the fly as you type! Don't forget to **Save** the newly submitted translation.
*kiwitcms-bot* will take care to submit the new strings as GitHub pull request!

Before starting to translate please read the
|Crowdin in-context|

.. versionadded:: 7.0

.. warning::

If in-context editor doesn't show source string your browser may not be supported!
Try updating the browser or switching to a different one! In our experience
Firefox 60.8.0 did not work but Google Chrome 77.0.3865.75 works!

.. important::

If possible start Kiwi TCMS in development mode (see above), using the latest version
from the *master* branch and translate from there. If you are unsure how to
do this then use the in-context editor at https://public.tenant.kiwitcms.org!

To request a new language please
`create an issue <https://github.com/kiwitcms/Kiwi/issues/new?title=Request+new+language:+...&body=Please+enable+...+language+in+Crowdin>`_
on GitHub.

If you prefer translating out of context (not recommended) please read the
`Starting Translation how-to
<https://support.crowdin.com/joining-translation-project/#starting-translation>`_
and the `Online Editor guide <https://support.crowdin.com/online-editor/>`_.

.. note::

All translations need to be proof-read before they are approved! If you do not
have sufficient Crowdin permissions to do so let us know that you have some new
translations that you'd like to be approved.

Making strings translatable
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Before strings can be translated they need to be marked as translatable.
This is done with the ``gettext()`` function or its shortcut ``_()``.
This is done with the ``ugettext_lazy()`` function or its shortcut ``_()``.
For templates ``{% load i18n %}`` at the top of the template and then use
the ``{% trans %}`` template tag to mark strings as translatable!
Please read `Django's Translation documentation
<https://docs.djangoproject.com/en/2.0/topics/i18n/translation/>`_ if
<https://docs.djangoproject.com/en/2.2/topics/i18n/translation/>`_ if
you are not sure what these functions are!

.. warning::

To update .po files once translatable strings have been changed or updated
you have to execute the following command and commit the results in git::

./manage.py makemessages
make messages

At the moment there is no test for this because Django doesn't make it easier
to implement a quick test based on 'git status'!


.. |Crowdin in-context| image:: ./_static/crowdin-in-context.png
4 changes: 2 additions & 2 deletions docs/source/set_dev_env.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Setting up a local development environment
Get source code
---------------

The Kiwi TCMS source code is available at: https://github.com/kiwitcms/Kiwi::
The Kiwi TCMS source code is available at https://github.com/kiwitcms/Kiwi::

git clone https://github.com/kiwitcms/Kiwi.git

Expand Down Expand Up @@ -40,7 +40,7 @@ Dependencies
First install RPM packages which are needed to compile some of the Python
dependencies::

sudo yum install gcc python-devel mariadb-devel libxml2-devel libxslt-devel graphviz
sudo yum install gcc rh-python36-python-devel mariadb-devel libffi-devel npm graphviz

.. note::

Expand Down

0 comments on commit cf77b9d

Please sign in to comment.