From 6f82512b161e16ad4ffd0d33b1c267b1c4c9bb8c Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Mon, 16 Sep 2024 19:14:48 -0600 Subject: [PATCH] translate.libre.is --- docs/_source/index.rst | 1 + .../en/LC_MESSAGES/translate-libre-is.po | 141 ++++++++++++++++++ docs/_source/translate-libre-is.rst | 137 +++++++++++++++++ 3 files changed, 279 insertions(+) create mode 100644 docs/_source/locale/en/LC_MESSAGES/translate-libre-is.po create mode 100644 docs/_source/translate-libre-is.rst diff --git a/docs/_source/index.rst b/docs/_source/index.rst index 79df516..832d7af 100644 --- a/docs/_source/index.rst +++ b/docs/_source/index.rst @@ -21,6 +21,7 @@ Libre developers documentation. maps-libre-is meet-libre-is tile-libre-is + translate-libre-is license :maxdepth: 2 :caption: Contents: diff --git a/docs/_source/locale/en/LC_MESSAGES/translate-libre-is.po b/docs/_source/locale/en/LC_MESSAGES/translate-libre-is.po new file mode 100644 index 0000000..fe242c1 --- /dev/null +++ b/docs/_source/locale/en/LC_MESSAGES/translate-libre-is.po @@ -0,0 +1,141 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2024, Jeff Moe +# This file is distributed under the same license as the Libre Developers +# Documentation package. +# FIRST AUTHOR , 2024. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Libre Developers Documentation 0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-16 19:14-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" + +#: ../../../_source/translate-libre-is.rst:3 +msgid "translate.libre.is" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:4 +msgid "Natural language translation website." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:6 +msgid "``_" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:10 +msgid "LibreTranslate" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:11 +msgid "LibreTranslate web translator." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:13 +msgid "``_" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:15 +msgid "``_" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:17 +msgid "Using user \"jebba\", change as appropriate." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:33 +msgid "" +"Note, the first time it is run, it will download the translation models. " +"The web URL won't be available until this is complete. It will download " +"(currently) 8.7 gigs of data." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:37 +msgid "Files downloaded to here:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:39 +msgid "~/.local/share/argos-translate/packages" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:42 +msgid "systemd" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:43 +msgid "meh." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:45 +msgid "Crufty startup script:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:47 +msgid "systemd service file:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:49 +msgid "/etc/systemd/system/libretranslate.service" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:69 +msgid "Startup script cruft:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:71 +msgid "/home/jebba/bin/deepcrayon-libretranslate-start" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:88 +msgid "Then:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:97 +msgid "" +"The first time it runs it will take awhile to start as it has to download" +" ~9 gigs of data to ~/.local/share/argos-translate/packages" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:103 +msgid "Apache" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:104 +msgid "URL:" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:106 +msgid "``_" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:108 +msgid "or" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:110 +msgid "``_" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:112 +msgid "Set up Apache proxy." +msgstr "" + +#: ../../../_source/translate-libre-is.rst:120 +msgid "" +"Set up config with proxy /etc/apache2/sites-available/translate-libre-" +"is.conf" +msgstr "" + +#: ../../../_source/translate-libre-is.rst:128 +msgid "Then set up and restart apache." +msgstr "" + diff --git a/docs/_source/translate-libre-is.rst b/docs/_source/translate-libre-is.rst new file mode 100644 index 0000000..e058f98 --- /dev/null +++ b/docs/_source/translate-libre-is.rst @@ -0,0 +1,137 @@ +================== +translate.libre.is +================== +Natural language translation website. + + ``_ + + +LibreTranslate +============== +LibreTranslate web translator. + + ``_ + + ``_ + +Using user "jebba", change as appropriate. + +.. code-block:: sh + + sudo apt install python3-venv python-is-python3 + mkdir -p /home/jebba/devel/LibreTranslate/server + cd /home/jebba/devel/LibreTranslate/server + python -m venv venv + source venv/bin/activate + pip install -U setuptools pip wheel + # Numpy workaround for closed bug (but not really fixed): + # https://github.com/LibreTranslate/LibreTranslate/issues/638 + pip install numpy==1.26.4 + pip install libretranslate + + +Note, the first time it is run, it will download the translation models. +The web URL won't be available until this is complete. +It will download (currently) 8.7 gigs of data. + +Files downloaded to here: + +~/.local/share/argos-translate/packages + +systemd +======= +meh. + +Crufty startup script: + +systemd service file: + +/etc/systemd/system/libretranslate.service + +.. code-block:: systemd + + [Unit] + Description=LibreTranslate + After=network-online.target + Wants=network-online.target + + [Service] + ExecStart=/home/jebba/bin/deepcrayon-libretranslate-start + WorkingDirectory=/tmp + User=jebba + Group=jebba + Restart=no + ExecReload=/bin/kill -HUP $MAINPID + + [Install] + WantedBy=multi-user.target + +Startup script cruft: + +/home/jebba/bin/deepcrayon-libretranslate-start + +.. code-block:: sh + + #!/bin/bash + + cd /home/jebba/devel/LibreTranslate/server + + source venv/bin/activate + + libretranslate \ + --host 0.0.0.0 \ + --port 8000 \ + --frontend-language-source en \ + --frontend-language-target es \ + --update-models \ + +Then: + +.. code-block:: sh + + chmod +x /home/jebba/devel/LibreTranslate/server + sudo systemctl daemon-reload + sudo systemctl start libretranslate.service + sudo systemctl enable libretranslate.service + +The first time it runs it will take awhile to start as it has to +download ~9 gigs of data to +~/.local/share/argos-translate/packages + + +Apache +====== +URL: + + ``_ + +or + + ``_ + +Set up Apache proxy. + +.. code-block:: sh + + sudo apt install python3-certbot-apache + sudo certbot -d translate.libre.is + sudo systemctl restart apache2 + +Set up config with proxy +/etc/apache2/sites-available/translate-libre-is.conf + +.. code-block:: apache + + + + +Then set up and restart apache. + +.. code-block:: sh + + sudo rm /etc/apache2/sites-enabled/000-default* + sudo ln -s /etc/apache2/sites-available/translate-libre-is.conf \ + /etc/apache2/sites-enabled/ + sudo a2enmod proxy_http proxy + sudo systemctl restart apache2 +