Skip to content

Commit

Permalink
Merge pull request #57 from zammad/mh/maintenance/switch-to-weblate
Browse files Browse the repository at this point in the history
Move translations from Transifex to Weblate
  • Loading branch information
MrGeneration committed Dec 2, 2021
2 parents 5fe80e2 + f4f701f commit 137c865
Show file tree
Hide file tree
Showing 6 changed files with 3,106 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.transifexrc
.tx
.DS_Store
locale/.doctrees
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ help:
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " intl to create po files for weblate"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
Expand Down Expand Up @@ -177,13 +178,13 @@ info:

.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
@echo "Created or updated POT file in locale."

.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
sphinx-intl update -p $(BUILDDIR)/locale/ -l de changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

Expand Down Expand Up @@ -222,4 +223,4 @@ pseudoxml:
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."
@echo "Build finished. Dummy builder generates no files."
55 changes: 22 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Documentation Status][badge]][docs]
[![Documentation Status][badge]][docs] [![Translation Status][tbadge]][wbetranslate]

# Zammad User Documentation

Expand All @@ -9,11 +9,12 @@ Source files for [Zammad’s user documentation][docs].
If you would like to improve the docs, simply:

1. fork the repo,
2. edit the appropriate `.rst` files (see [Markup Format](#markup-format) below), and
2. edit the appropriate `.rst` files (see [Markup Format](#markup-format) below),
and
3. submit a pull request.

> 🌍 **Wanna help translate?** Submit your contributions
> (or request additional languages) [here][tfxtranslate].
> (or request additional languages) [here][wbetranslate].
> Do **NOT** submit a PR with changes to the contents of the `locale/` directory.
Thanks! ❤ ❤ ❤
Expand All @@ -34,7 +35,7 @@ this markup language can be found at:
* sphinx

```
$ pip install sphinx sphinx-autobuild sphinx-intl sphinx_rtd_theme
$ pip install sphinx sphinx-autobuild sphinx-intl sphinx_rtd_theme sphinx-tabs
```

* gettext
Expand All @@ -46,52 +47,40 @@ this markup language can be found at:
...
```

* transifex-client (optional)

```
$ pip install transifex-client
```

### Local HTML build

```
$ make html
```

### Localization using transifex
### Localization using Weblate

```
# create .tx config
$ tx init
This documentation is translated via Weblate.
After changing or adding text in this documentation, updating the POT file
is required. (This is usually done by us after QA *before* merging the PR)

Weblate will automatically provide the translation parts in in its UI for
all available languages. If there's translation progress it will automatically
provide pull requests on this repository. 🎉

```
# ensure clean enviroment
$ make clean
# generate the strings from the *.rst files
$ make gettext
# OPTIONAL: if you have to adapt a new locale, run
sphinx-intl update -p _build/locale/ -l de
# update the resource files from the pot dir
$ sphinx-intl update-txconfig-resources --pot-dir _build/locale --transifex-project-name zammad-user-documentation
# push to transifex (if configured)
$ tx push -s
# Below pull options by default ignore unreviewed (see https://docs.transifex.com/client/pull#getting-different-file-variants )
# after translation pull needed languages from transifex
$ tx pull -l en
# build the .MO files for use with readthedocs
# (After a successful build, push to this repo and readthedocs will update itself.)
$ sh build_mo.sh
# manual language-based build (`_build/html/`) (for testing)
$ make -e SPHINXOPTS="-D language='de'" html
$ make -e SPHINXOPTS="-D language='en'" html
```

### Localization process

[![Translation progress][tprogress]][wbetranslate]

[badge]: https://readthedocs.org/projects/zammad-user-documentation/badge/?version=latest
[docs]: https://zammad-user-documentation.readthedocs.io/en/latest/
[tfxtranslate]: https://www.transifex.com/zammad/zammad-user-documentation/
[docs]: https://user-docs.zammad.org/en/latest/
[tbadge]: https://translations.zammad.org/widgets/documentations/-/user-documentation/svg-badge.svg
[wbetranslate]: https://translations.zammad.org/projects/documentations/user-documentation/
[tprogress]: https://translations.zammad.org/widgets/documentations/-/user-documentation/multi-auto.svg
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
extensions = ['versionwarning.extension']

locale_dirs = ['locale/']
gettext_compact = False
gettext_compact = "user-docs"
language = "en"

html_theme = 'sphinx_rtd_theme'
Expand Down

0 comments on commit 137c865

Please sign in to comment.