Instalar en SUSE y openSUSE

Requisitos de hardware

Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):

  • 2 GB de RAM

  • 2 núcleos de CPU

  • 1 GB de espacio de almacenamiento

Cuanta más memoria tenga, mejor, ya que se utiliza para el prealmacenaje en todos los niveles (sistema de archivos, base de datos y Weblate).

Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.

The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.

Nota

Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.

Instalación

Requisitos del sistema

Install the dependencies needed to build the Python modules (see Requisitos de software):

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

Instale las dependencias opcionales que desee en función de las funcionalidades que vaya a utilizar (vea Dependencias opcionales):

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 Running server, Configuración de base de datos para Weblate, Tareas en segundo plano con Celery. Depending on size of your installation you might want to run these components on dedicated servers.

Las instrucciones de instalación local:

# 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

Módulos de Python

Consejo

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. Cree el entorno virtual para Weblate:

    virtualenv --python=python3 ~/weblate-env
    
  2. Active el entorno virtual para Weblate:

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

    # pkgconfig is needed to install borgbackup 1.2
    pip install pkgconfig
    # Install Weblate with all optional dependencies
    pip install "Weblate[all]"
    

    Please check Dependencias opcionales for fine-tuning of optional dependencies.

    Nota

    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
    

Configurar Weblate

Nota

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 Adjusting configuration.

  3. Create the database and its structure for Weblate (the example settings use PostgreSQL, check Configuración de base de datos para 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 Running server and Serving static files):

    weblate collectstatic
    
  6. Compress JavaScript and CSS files (optional, see Compressing client assets):

    weblate compress
    
  7. Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Tareas en segundo plano con Celery for more info:

    ~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
    
  8. Start the development server (see Running server for 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 Órdenes de gestión.

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

  • Review potential issues with your installation either on /manage/performance/ URL (see Interfaz de gestión) or using weblate check --deploy, see Puesta en marcha de entorno de producción.

Adding translation

  1. Open the admin interface (http://localhost:8000/create/project/) and create the project you want to translate. See Configuración de proyectos 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 Configuración de componentes for more details.

    The important fields here are: Nombre de componente, Repositorio de código fuente, and Máscara de archivos for finding translatable files. Weblate supports a wide range of formats including gettext de GNU, Recursos de cadenas de Android, Cadenas de iOS de Apple, Propiedades de Java, Stringsdict format or Fluent format, see Formatos de archivo admitidos 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.