Skip to content

Commit

Permalink
Merge pull request #280 from freakboy3742/weblate
Browse files Browse the repository at this point in the history
Add a reference to Weblate, and cross-reference translations on the landing page
  • Loading branch information
freakboy3742 committed Jan 10, 2024
2 parents b34a6b2 + d9a5d4c commit 7373e4d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
17 changes: 17 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,20 @@ want to contribute code, please `fork the code`_ and `submit a pull request`_.
.. _log them on Github: https://github.com/beeware/beeware/issues
.. _fork the code: https://github.com/beeware/beeware
.. _submit a pull request: https://github.com/beeware/beeware/pulls

Translations
~~~~~~~~~~~~

.. image:: https://hosted.weblate.org/widget/beeware/open-graph.png
:target: https://hosted.weblate.org/engage/beeware/
:alt: Translation status
:width: 300px

We manage translations using `Weblate <https://weblate.org/>`__.

.. image:: https://hosted.weblate.org/widget/beeware/horizontal-blue.svg
:target: https://hosted.weblate.org/engage/beeware/
:alt: Translation status

If you'd like to contribute to the translation effort, join the ``#translations``
channel on `Discord`_ and introduce yourself!
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,6 @@

# ReadTheDocs doesn't allow configuration of the -t tags passed in for builds;
# but it *does* allow for configuration of environment variables.
translation = os.getenv("TRANSLATION")
if translation:
if not any(tag.endswith("_translation") for tag in tags):
translation = os.getenv("TRANSLATION", "original")
tags.add(f"{translation}_translation")
12 changes: 12 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ single page web app. We're also going to look at how you can use BeeWare tools t
some of the common tasks that you'll need to do as an app developer, such as testing
your app.

.. only:: original_translation

.. admonition:: Translations are available

If you're not comfortable with English, translations of this tutorial are
available in
`Deutsch <https://docs.beeware.org/de>`__,
`Español <https://docs.beeware.org/es>`__,
`Français <https://docs.beeware.org/fr>`__, and
`汉语 <https://docs.beeware.org/zh-cn>`__.


.. only:: machine_translation

.. admonition:: This is a machine translation!
Expand Down
17 changes: 1 addition & 16 deletions docs/locales/de/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ msgstr "BeeWare ist kein einzelnes Produkt, Werkzeug oder eine Bibliothek - es i
#: ../../index.rst:44 92df4f7286f84d699664b010b81b774e
#, fuzzy
msgid "`Toga <https://toga.readthedocs.io>`__, a cross platform widget toolkit;"
msgstr "toga <https://toga.readthedocs.io>`__, ein plattformübergreifendes Widget-Toolkit;"
msgstr "`Toga <https://toga.readthedocs.io>`__, ein plattformübergreifendes Widget-Toolkit;"

#: ../../index.rst:45 9e35a63fa7e54f41959a0ae98ac34ed0
#, fuzzy
Expand Down Expand Up @@ -99,18 +99,3 @@ msgstr "Los geht's!"
#: ../../index.rst:63 1dc266914cec4a09900ff4bbbe1ac955
msgid "Ready to try BeeWare for yourself? :doc:`Let's build a cross platform application in Python! <tutorial/tutorial-0>`"
msgstr "Sind Sie bereit, BeeWare selbst auszuprobieren? :doc:`Lassen Sie uns eine plattformübergreifende Anwendung in Python erstellen! <tutorial/tutorial-0>`"

#~ msgid "This document is a machine translation!"
#~ msgstr ""

#~ msgid "This document is a translation!"
#~ msgstr ""

#~ msgid "This version of the tutorial has been generated by machine translation. We know this isn't ideal, but we felt that a bad translation was better than no translation at all."
#~ msgstr ""

#~ msgid "This document is a translation of the English version. The translation has been reviewed by humans, but newer sections may be generated by machine translation, or not translated at all."
#~ msgstr ""

#~ msgid "Machine translation"
#~ msgstr ""
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ passenv =
# export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib
PYENCHANT_LIBRARY_PATH
commands =
!lint-!all-!translate : python -m sphinx {[docs]sphinx_args} -b html . {[docs]build_dir}/html
!lint-!all-!translate : python -m sphinx {[docs]sphinx_args} -b html . {[docs]build_dir}/html/en
lint : python -m sphinx {[docs]sphinx_args_extra} -b linkcheck . {[docs]build_dir}/links
lint : python -m sphinx {[docs]sphinx_args_extra} -b spelling . {[docs]build_dir}/spell
translate : python -m sphinx {[docs]sphinx_args_extra} -b gettext . {[docs]build_dir}/gettext
Expand All @@ -68,7 +68,7 @@ commands =
all : python -m sphinx {[docs]sphinx_args_extra} -b html -D language=de -t machine_translation . {[docs]build_dir}/html/de
all : python -m sphinx {[docs]sphinx_args_extra} -b html -D language=es -t machine_translation . {[docs]build_dir}/html/es
all : python -m sphinx {[docs]sphinx_args_extra} -b html -D language=fr -t machine_translation . {[docs]build_dir}/html/fr
all : python -m sphinx {[docs]sphinx_args_extra} -b html -D language=zh_CN -t machine_translation . {[docs]build_dir}/html/zh_CN
all : python -m sphinx {[docs]sphinx_args_extra} -b html -D language=zh_CN -t machine_translation . {[docs]build_dir}/html/zh-cn

[testenv:package]
skip_install = True
Expand Down

0 comments on commit 7373e4d

Please sign in to comment.