Installing on RedHat, Fedora and CentOS

Wymagania sprzętowe

Weblate powinien działać bez problemów na każdym współczesnym sprzęcie, poniżej przedstawiono minimalną konfigurację wymaganą do uruchomienia Weblate na jednym hoście (Weblate, baza danych i serwer sieciowy):

  • 2 GB pamięci RAM

  • 2 rdzenie procesora

  • 1 GB miejsca

Im więcej pamięci, tym lepiej - wykorzystywana jest do buforowania na wszystkich poziomach (system plików, baza danych i Weblate).

Wiele użytkowników jednocześnie zwiększa liczbę potrzebnych rdzeni procesora. W przypadku setek elementów tłumaczenia zalecane jest co najmniej 4 GB pamięci RAM.

Typowe użycie magazynu bazy danych wynosi około 300 MB na 1 milion hostowanych słów. Miejsce do magazynowania potrzebne do sklonowanych repozytoriów jest różna, ale Weblate stara się zachować ich minimalny rozmiar, wykonując płytkie klonowanie.

Informacja

Rzeczywiste wymagania dotyczące instalacji Weblate różnią się znacznie w zależności od rozmiaru zarządzanych tłumaczeń.

Instalacja

Wymagania systemowe

Install the dependencies needed to build the Python modules (see Wymagania dotyczące oprogramowania):

dnf install \
   libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel libyaml-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 Opcjonalne zależności):

dnf install tesseract-langpack-eng tesseract-devel leptonica-devel

Optionally install software for running production server, see Uruchamianie serwera, Konfiguracja bazy danych dla Weblate, Zadania w tle korzystające z Celery. Depending on size of your installation you might want to run these components on dedicated servers.

Instrukcja instalacji lokalnej:

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

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

# Caching backend: Redis
dnf install redis

# Database server: PostgreSQL
dnf install postgresql postgresql-contrib

# SMTP server
dnf install postfix

Moduły Pythona

Podpowiedź

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. Utwórz virtualenv dla Weblate:

    virtualenv --python=python3 ~/weblate-env
    
  2. Utwórz virtualenv dla Weblate:

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

    pip install "Weblate[all]"
    

    Please check Opcjonalne zależności for fine-tuning of optional dependencies.

Konfigurowanie Weblate

Informacja

Following steps assume virtualenv used by Weblate is active (what can be done by . ~/weblate-env/bin/activate). In case this is not true, you will have to specify full path to weblate command as ~/weblate-env/bin/weblate.

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

  2. Adjust the values in the new settings.py file to your liking. You will need to provide at least the database credentials and Django secret key, but you will want more changes for production setup, see Dostosowywanie konfiguracji.

  3. Create the database and its structure for Weblate (the example settings use PostgreSQL, check Konfiguracja bazy danych dla Weblate for production ready setup):

    weblate migrate
    
  4. Create the administrator user account and copy the password it outputs to the clipboard, and also save it for later use:

    weblate createadmin
    
  5. Collect static files for web server (see Uruchamianie serwera and Obsługa plików statycznych):

    weblate collectstatic
    
  6. Compress JavaScript and CSS files (optional, see Kompresowanie zasobów klienta):

    weblate compress
    
  7. Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Zadania w tle korzystające z Celery for more info:

    ~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
    
  8. Start the development server (see Uruchamianie serwera for production setup):

    weblate runserver
    

Po instalacji

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

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

  • Login 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 Polecenia zarządzania.

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

  • Review potential issues with your installation either on /manage/performance/ URL (see Interfejs zarządzania) or using weblate check --deploy, see Instalacja produkcyjna.

Dodawanie tłumaczenia

  1. Open the admin interface (http://localhost:8000/create/project/) and create the project you want to translate. See Konfiguracja projektu 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 Konfiguracja komponentu for more details.

    The important fields here are: Component name, VCS repository address and mask for finding translatable files. Weblate supports a wide range of formats including gettext PO files, Android resource strings, iOS string properties, Java properties or Qt Linguist files, see Obsługiwane formaty plików 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.