ilja
c092fc9fd6
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Argos Translate is a Python module for translation and can be used as a command line tool. This is also the engine for LibreTranslate, for which we already have a module. Here we can use the engine directly from our server without doing requests to a third party or having to install our own LibreTranslate webservice (obviously you do have to install Argos Translate). One thing that's currently still missing from Argos Translate is auto-detection of languages (see <https://github.com/argosopentech/argos-translate/issues/9>). For now, when no source language is provided, we just return the text unchanged, supposedly translated from the target language. That way you get a near immediate response in pleroma-fe when clicking Translate, after which you can select the source language from a dropdown. Argos Translate also doesn't seem to handle html very well. Therefore we give admins the option to strip the html before translating. I made this an option because I'm unsure if/how this will change in the future. Co-authored-by: ilja <git@ilja.space> Reviewed-on: #351 Co-authored-by: ilja <akkoma.dev@ilja.space> Co-committed-by: ilja <akkoma.dev@ilja.space> |
||
---|---|---|
.. | ||
docs | ||
theme/partials | ||
Makefile | ||
mkdocs.yml | ||
Pipfile | ||
Pipfile.lock | ||
README.md | ||
requirements.txt |
Building the docs
You don't need to build and test the docs as long as you make sure the syntax is correct. But in case you do want to build the docs, feel free to do so.
You'll need to install mkdocs for which you can check the mkdocs installation guide. Generally it's best to install it using pip
. You'll also need to install the correct dependencies.
Example using a Debian based distro
1. Install pipenv and dependencies
pip install pipenv
pipenv sync
2. (Optional) Activate the virtual environment
Since dependencies are installed in a virtual environment, you can't use them directly. To use them you should either prefix the command with pipenv run
, or activate the virtual environment for current shell by executing pipenv shell
once.
3. Build the docs using the script
[pipenv run] make all
4. Serve the files
A folder site
containing the static html pages will have been created. You can serve them from a server by pointing your server software (nginx, apache...) to this location. During development, you can run locally with
[pipenv run] mkdocs serve
This handles setting up an http server and rebuilding when files change. You can then access the docs on http://127.0.0.1:8000