从源码安装¶
安装 Weblate 前,请先遵照用于您系统的安装说明:
使用 Git 获取最新的 Weblate 源码(或下载 tarball 包并将其解压):
git clone https://github.com/WeblateOrg/weblate.git weblate-src
另外,您可以使用发布的压缩包。您可以从我们的网站 <https://weblate.org/> 下载。这些下载是经过加密签名的,请参见 验证发布签名。
将当前的 Weblate 代码安装到 Python 环境中:
. ~/weblate-env/bin/activate uv pip install -e 'weblate-src[all]'
If you intend to run the testsuite from the source checkout, install the development dependencies as described in Weblate 的本地测试.
将
weblate/settings_example.py复制为weblate/settings.py。将新的
settings.py文件中的值调整为您所需要的。您至少需要提供数据库凭证和 Django 密钥,但在生产安装中需要做更多的更改,参见:调整配置。新建 Weblate 使用的数据库,参见 Weblate 的数据库设置。
构建 Django 表、静态文件和初始数据(参见 填满数据库 和 为静态文件提供服务):
weblate migrate weblate collectstatic weblate compress
备注
无论任何时候更新仓库时,都应该重复这一步骤。
Packaging Weblate for distributions¶
The dependency versions in pyproject.toml describe the runtime
environment tested by the Weblate project. They are intentionally strict for
installs from PyPI and for the Weblate release process, because Weblate cannot
validate every dependency-version combination covered by wider version ranges.
Distribution packages can replace those Python packages with versions from the distribution package set. When doing so, run Weblate's test suite against the packaged dependency set and treat passing tests as the compatibility signal for the distribution package.
Keep Weblate's tightly coupled companion packages in sync with the Weblate release:
Mismatched versions of these packages are more likely to break at runtime or during tests than other Python dependency substitutions.
参见
See Weblate 的本地测试 for test setup and 发行周期 for Weblate's release cadence.