Translation on Firefox Translations models; new logo

- Email translation moves from LibreTranslate to our own translator
  service (translator/): Mozilla's Firefox Translations models on the
  Bergamot engine, fastText language detection (176 languages). Polish,
  English, German, French, Spanish and Italian on first start (~350 MB
  instead of ~10 GB); Admin panel > Email translation installs and
  removes languages. Built and pushed as the `translator` image.
- Every message is translated paragraph by paragraph as plain text;
  names travel with their sentence and are kept only where the model
  changed them; a sentence start the model copied ("Enclosed") is tried
  again in lower case; list markers are not sent
- The Translate button shows only for installed languages
- New logo: favicon, app/maskable/iPhone icons, notification badge,
  email logo and calendar copy regenerated; BIMI logo rebuilt in SVG
  Tiny PS with its gradients; masks render in browsers
- Launch screen background is the app's dark grey

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-18 22:04:04 +02:00
co-authored by Claude Opus 5.5
parent 8a1b9979e9
commit 972e10876b
38 changed files with 1627 additions and 223 deletions
+38
View File
@@ -0,0 +1,38 @@
# Translation service (translator/translator.py): Mozilla's Firefox
# Translations models on the Bergamot engine, and fastText language
# identification. Python 3.10: the newest the bergamot package is built for.
#
# docker build -f docker/Dockerfile.translator -t webmail/translator .
#
# The models are not in the image: they are downloaded into /data (a bind
# mount) on the first start and from the admin panel.
FROM python:3.10-slim
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DATA_DIR=/data \
HOME=/tmp
COPY translator/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
# fastText's language identifier (lid.176, compressed; CC BY-SA 3.0).
ADD --checksum=sha256:8f3472cfe8738a7b6099e8e999c3cbfae0dcd15696aac7d7738a8039db603e83 \
https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.ftz /opt/lid.176.ftz
COPY translator/translator.py /app/translator.py
# The same uid as the backend: DATA_ROOT/translator is owned by it (init).
RUN useradd --uid 10001 --no-create-home --shell /usr/sbin/nologin translator \
&& mkdir -p /data && chown translator /data /opt/lid.176.ftz
USER translator
WORKDIR /app
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=5 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/health', timeout=4)"
CMD ["uvicorn", "translator:app", "--host", "0.0.0.0", "--port", "5000", "--no-access-log"]