Installing on SUSE and openSUSE

Hardware requirements

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):

  • 2GBのRAM

  • 2 CPU cores

  • 1 GB of storage space

The more memory the better - it is used for caching on all levels (filesystem, database and 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.

注釈

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

導入

System requirements

Install the dependencies needed to build the Python modules (see ソフトウェア要件):

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 オプションの依存関係):

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 実行サーバー, Weblate のデータベース設定, 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

ヒント

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 --python=python3 ~/weblate-env
    
  2. Activate the virtualenv for Weblate:

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

    pip install "Weblate[all]"
    

    Please check オプションの依存関係 for fine-tuning of optional dependencies.

    注釈

    Weblate を、一部の Linux ディストリビューションで実行すると発生する libffi エラー:

    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)
    

    これは、PyPI を介して配布されるバイナリ パッケージとディストリビューションとの互換性がないことが原因です。これに対処するために必要な、システムでのパッケージの再構築方法:

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

Configuring Weblate

注釈

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. 新しい settings.py ファイルの値を、必要に応じて変更してください。少なくともデータベースの資格情報と Django 秘密鍵の設定が必要ですが、本番環境のセットアップには、さらに多くの変更が必要です。参照: 詳細設定

  3. Create the database and its structure for Weblate (the example settings use PostgreSQL, check 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 実行サーバー and 静的ファイルの提供):

    weblate collectstatic
    
  6. Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):

    weblate compress
    
  7. Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Celery を使用するバックグラウンド タスク for more info:

    ~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
    
  8. Start the development server (see 実行サーバー 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 管理コマンド.

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

  • Review potential issues with your installation either on /manage/performance/ URL (see 管理画面) or using weblate check --deploy, see 本番環境の設定.

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.

    ここで重要な項目: コンポーネント名ソースコードのリポジトリ、および翻訳可能なファイルを検索するための ファイルマスク です。Weblate は、ref:gettextAndroid string resourcesApple iOS stringsJava propertiesStringsdict 形式Fluent 形式 など、幅広い形式に対応しています。詳細については、対応するファイル形式 を確認してください。

  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.