KU注册链接:在Debian 和Ubantu 上安装

本文由 KU注册链接 вт989点сс 原创编译。Weblate 应该可以在任何现代硬体上正常执行,以下是在单个主机( Weblate,资料库和Web 伺服器)上执行Weblate 所需的最低组态:

  • 3 GB of RAM

  • 2 CPU 核心

  • 1 GB 的储存空间

记忆体越多越好—— 用于所有级别的快取(档案系统、资料库和Weblate )。

许多并发使用者会增加所需的CPU 内核数量。对于数百个翻译组件,推荐至少有4 GB 的内存。

典型的资料库储存用量大约为每一百万单词300 MB。克隆仓储所需的储存空间会变化,但Weblate 试图通过浅克隆将其大小最小化。

安装

系统要求

安装所需的相依项,来建立Python 模组(请参见软体要求):

apt install -y \
   libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev \
   libffi-dev libcairo-dev gir1.2-pango-1.0 libgirepository1.0-dev \
   libacl1-dev libssl-dev libpq-dev libjpeg-dev build-essential \
   python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git

Install wanted optional dependencies depending on features you intend to use (see Python 相依性):

apt install -y \
   libldap2-dev libldap-common libsasl2-dev \
   libxmlsec1-dev

可选地安装生产伺服器执行所需要的软件,参见正在执行伺服器、Weblate 的资料库设定、使用Celery 的后台任务。根据于您的安装所占的空间,您会想要在特定的伺服器上运行这些组件。

本地安装的使用说明:

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

# Web server option 2: Apache with ``mod_wsgi``
apt install -y apache2 libapache2-mod-wsgi-py3

# Caching backend: Redis
apt install -y redis-server

# Database server: PostgreSQL
apt install -y postgresql postgresql-contrib

# SMTP server
apt install -y exim4

# Gettext for the msgmerge add-on
apt install -y gettext

Python 模组

1.为Weblate 新建virtualenv:

virtualenv ~/weblate-env

2.为Weblate 启动virtualevn :

. ~/weblate-env/bin/activate

3.Install Weblate including all optional dependencies:

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

Please check Python 相依性for fine-tuning of optional dependencies.

在一些Linux 发行版执行Weblate 发生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)
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

组态Weblate 

1.将文件:file: ~/weblate-env/lib/python3.9/site-packages/weblate/settings_example.py复制为:file: ~/weblate-env/lib/python3.9/site-packages/ weblate/settings .py。

2.Adjust the values in the new settings.pyfile 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调整组态.

3.Create the database and its structure for Weblate (the example settings use PostgreSQL, check Weblate 的资料库设定for a production-ready setup):

weblate migrate

4.Create an administrator user account admin, generate its password, and copy it to the clipboard; remember to save it for later use:

weblate createadmin

5.Collect the static files for your web server (see正在执行伺服器and静态档案服务):

weblate collectstatic

6.Compress the JavaScript and CSS files (optional, see压缩客户端素材):

weblate compress

7.Start the Celery workers. This is not necessary for development purposes, but strongly recommended otherwise.使用Celery 的后台任务has more info:

~/weblate-env/lib/python3.9/site-packages/weblate/examples/celery start

8.Start the development server (正在执行伺服器details a production setup):

weblate runserver

  • 13
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值