Installing on SUSE and openSUSE

Hardwareanforderungen

Weblate sollte auf jeder zeitgemäßen Hardware problemlos laufen. Nachfolgend finden Sie die minimale Konfiguration, die erforderlich ist, um Weblate auf einem einzelnen Host zu betreiben (Weblate, Datenbank und Webserver):

  • 2 GB Arbeitsspeicher

  • 2 CPU-Kerne

  • 1 GB Speicherplatz

Je mehr Speicher, desto besser - er wird für das Caching auf allen Ebenen (Dateisystem, Datenbank und Weblate) verwendet.

Viele gleichzeitige Benutzer erhöhen die Anzahl der benötigten CPU-Kerne. Für Hunderte von Übersetzungskomponenten werden mindestens 4 GB RAM empfohlen.

Dies hat schwerwiegende Auswirkungen auf die Leistung der Weboberfläche und beeinträchtigt Funktionen, die von regelmäßigen Auslösern abhängen (z. B. das Übertragen ausstehender Änderungen, Digest-Benachrichtigungen oder Sicherungen).

Bemerkung

Die tatsächlichen Anforderungen an Ihre Weblate-Installation hängen stark von der Größe der darin verwalteten Übersetzungen ab.

Installation

Systemvoraussetzungen

Install the dependencies needed to build the Python modules (see Software-Anforderungen):

zypper install \
   libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel \
   libyaml-devel libffi-devel cairo-devel pango-devel \
   gobject-introspection-devel libacl-devel python3-pip python3-virtualenv \
   python3-devel git

Install wanted optional dependencies depending on features you intend to use (see Optionale Abhängigkeiten):

zypper install tesseract-ocr tesseract-devel leptonica-devel
zypper install libldap2-devel libsasl2-devel
zypper install libxmlsec1-devel

Optionally install software for running production server, see Laufender Server, Datenbankeinrichtung für Weblate, Hintergrundaufgaben mit Celery. Depending on size of your installation you might want to run these components on dedicated servers.

The local installation instructions:

# Web server option 1: NGINX and uWSGI
zypper install nginx uwsgi uwsgi-plugin-python3

# Web server option 2: Apache with ``mod_wsgi``
zypper install apache2 apache2-mod_wsgi

# Caching backend: Redis
zypper install redis-server

# Database server: PostgreSQL
zypper install postgresql postgresql-contrib

# SMTP server
zypper install postfix

Python modules

Hinweis

We’re using virtualenv to install Weblate in a separate environment from your system. If you are not familiar with it, check virtualenv User Guide.

  1. Create the virtualenv for Weblate:

    virtualenv ~/weblate-env
    
  2. Activate the virtualenv for Weblate:

    . ~/weblate-env/bin/activate
    
  3. Install Weblate including all optional dependencies:

    # Install Weblate with all optional dependencies
    pip install "Weblate[all]"
    

    Please check Optionale Abhängigkeiten for fine-tuning of optional dependencies.

    Bemerkung

    On some Linux distributions running Weblate fails with libffi error:

    ffi_prep_closure(): bad user_data (it seems that the version of the libffi library seen at runtime is different from the 'ffi.h' file seen at compile-time)
    

    This is caused by incompatibility of binary packages distributed via PyPI with the distribution. To address this, you need to rebuild the package on your system:

    pip install --force-reinstall --no-binary :all: cffi
    

Configuring Weblate

Bemerkung

The following assumes the virtualenv used by Weblate is activated (by executing . ~/weblate-env/bin/activate). If not, specify the full path to the weblate command as ~/weblate-env/bin/weblate.

  1. Copy the file ~/weblate-env/lib/python3.9/site-packages/weblate/settings_example.py to ~/weblate-env/lib/python3.9/site-packages/weblate/settings.py.

  2. Passen Sie die Werte in der neuen Datei settings.py nach Ihren Wünschen an. Sie müssen zumindest die Datenbank-Zugangsdaten und den geheimen Django-Schlüssel angeben, aber Sie werden mehr Änderungen für die Produktionseinrichtung benötigen, siehe Anpassen der Konfiguration.

  3. Erstellen Sie die Datenbank und ihre Struktur für Weblate (die Beispieleinstellungen verwenden PostgreSQL, sehen Sie sich Datenbankeinrichtung für Weblate für ein produktionsreifes Setup an):

    weblate migrate
    
  4. Erstellen Sie ein Benutzerkonto für den Administrator und kopieren Sie dessen Passwort in die Zwischenablage, und speichern Sie es zur späteren Verwendung:

    weblate createadmin
    
  5. Sammeln Sie die statischen Dateien für Ihren Webserver (siehe Laufender Server und Bereitstellung statischer Dateien):

    weblate collectstatic
    
  6. Komprimieren Sie die JavaScript- und CSS-Dateien (optional, siehe Compressing client assets):

    weblate compress
    
  7. Start the Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. Hintergrundaufgaben mit Celery has more info:

    ~/weblate-env/lib/python3.9/site-packages/weblate/examples/celery start
    
  8. Start the development server (Laufender Server details a production setup):

    weblate runserver
    

After installation

Congratulations, your Weblate server is now running and you can start using it.

  • You can now access Weblate on http://localhost:8000/.

  • Sign in with admin credentials obtained during installation or register with new users.

  • You can now run Weblate commands using weblate command when Weblate virtualenv is active, see Management commands.

  • You can stop the test server with Ctrl+C.

  • Review potential issues with your installation either on /manage/performance/ URL (see Verwaltungsoberfläche) or using weblate check --deploy, see Produktionseinrichtung.

Adding translation

  1. Open the admin interface (http://localhost:8000/create/project/) and create the project you want to translate. See Project configuration for more details.

    All you need to specify here is the project name and its website.

  2. Create a component which is the real object for translation - it points to the VCS repository, and selects which files to translate. See Component configuration for more details.

    The important fields here are: Name der Komponente, Quellcode-Repository, and Dateimaske for finding translatable files. Weblate supports a wide range of formats including GNU gettext, Android string resources, Apple iOS strings, Java properties, Stringsdict-Format or Fluent-Format, see Supported file formats for more details.

  3. Once the above is completed (it can be lengthy process depending on the size of your VCS repository, and number of messages to translate), you can start translating.