Quick setup guide

Note

This is just a quick guide for installing and starting to use Weblate for testing purposes. Please check Installation instructions for more real world setup instructions.

Installing in a virtualenv

If you’d just like to do a quick installation locally on your device to find out if Weblate is for you, you can install it using a virtual environment for Python 2, a simple (and slow!) SQLite database, and the lightweight Django development server.

  1. Install development files for libraries needed for building some Python modules:

    # Debian/Ubuntu:
    apt install libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev python-dev
    
    # openSUSE/SLES:
    zypper install libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel libyaml-devel python-devel
    
    # Fedora/RHEL/CentOS:
    dnf install libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel libyaml-devel python-devel
    
  2. Install pip and virtualenv. Usually they are shipped by your distribution or with Python:

    # Debian/Ubuntu:
    apt-get install python-pip python-virtualenv
    
    # openSUSE/SLES:
    zypper install python-pip python-virtualenv
    
    # Fedora/RHEL/CentOS:
    dnf install python-pip python-virtualenv
    
  3. Create the virtualenv for Weblate (the path in /tmp is really just an example, you rather want something more permanent, even if this is just for testing):

    virtualenv --python=python2.7 /tmp/weblate
    
  4. Activate the virtualenv for Weblate, so Weblate will look for Python libraries there first:

    . /tmp/weblate/bin/activate
    
  5. Install Weblate including all dependencies. You can also use pip to install the optional dependencies:

    pip install Weblate
    # Optional deps
    pip install pytz python-bidi PyYAML pyuca
    
  6. Copy the file /tmp/weblate/lib/python2.7/site-packages/weblate/settings-example.py to /tmp/weblate/lib/python2.7/site-packages/weblate/settings.py

  7. Optionally, adjust the values in the new settings.py file.

  8. Tell Django where to find the settings file for Weblate:

    export DJANGO_SETTINGS_MODULE=weblate.settings
    
  9. Create the SQLite database and its structure for Weblate:

    weblate migrate
    
  10. Create the administrator user account and copy the password it outputs to the clipboard, and maybe also save it to a text file for later use:

    weblate createadmin
    
  11. Start the development server:

    weblate runserver
    
  12. Open a web browser, go to http://localhost:8000/accounts/login/ and login with the user name admin and paste the password in.

  13. Proceed with Adding translation to add some translatable contents to your test installation.

You can stop the test server with Ctrl+C, and leave the virtual environment with deactivate. If you want to resume testing later, you need to repeat the steps 4, 8 and 11 each time to start the development server.

Installing from sources

  1. Install all required dependencies, see Software requirements.

  2. Grab Weblate sources (either using Git or download a tarball) and unpack them, see Installing Weblate.

  3. Copy weblate/settings_example.py to weblate/settings.py and adjust it to match your setup. You will at least need to configure the database connection (possibly adding user and creating the database). Check Configuration for Weblate specific configuration options.

  4. Create the database which will be used by Weblate, see Database setup for Weblate.

  5. Build Django tables, static files and initial data (see Filling up the database and Serving static files):

    ./manage.py migrate
    ./manage.py collectstatic
    ./scripts/generate-locales # If you are using Git checkout
    
  6. Configure webserver to serve Weblate, see Running server.

Installing using Docker

  1. Clone weblate-docker repo:

    git clone https://github.com/WeblateOrg/docker-compose.git weblate-docker
    cd weblate-docker
    
  2. Start Weblate containers:

    docker-compose up
    

See also

See Running Weblate in the Docker for more detailed instructions and customization options.

Installing on OpenShift 2

  1. You can install Weblate on OpenShift PaaS directly from its Git repository using the OpenShift Client Tools:

    rhc -aweblate app create -t python-2.7 --from-code https://github.com/WeblateOrg/weblate.git --no-git
    
  2. After installation everything should be preconfigured and you can immediately start to add a translation project as described below.

See also

For more information, including on how to retrieve the generated admin password, see Running Weblate on OpenShift 2.

Adding translation

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

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

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

    The important fields here being 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, OS X string properties, Java properties or Qt Linguist files, see Supported formats for more details.

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