专栏首页iOSDevLogUbuntu安装Weblate

Ubuntu安装Weblate

安装


Installation in virtualenv

首先以 root 用户登录

This is the recommended method if you don’t want to concern yourself with further detail. This will create a separate Python environment for Weblate, possibly duplicating some of the Python libraries on the system.

1. 开发环境

Install the development files for libraries to be used during the building of the Python modules:

apt install libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev python3-dev build-essential

2. 虚拟环境

Install pip and virtualenv. Usually they are shipped by your distribution or with Python:

apt install python3-pip python3-virtualenv virtualenv

3. 创建虚拟环境

Create and activate virtualenv for Weblate:

virtualenv --python=python3 ~/weblate-env

4. 激活虚拟环境

Activate the virtualenv for Weblate, so Weblate will look for Python libraries there first:

. ~/weblate-env/bin/activate

5. 安装 Weblate

Install Weblate including all dependencies, you can also use pip to install optional dependencies:

pip install Weblate
# Optional deps
pip install pytz python-bidi PyYAML pyuca
# Install database backend for PostgreSQL
pip install psycopg2-binary
# Install database backend for MySQL
apt install default-libmysqlclient-dev
pip install mysqlclient

6. 创建 配置文件

Create your settings (in this example it would be in~/weblate-env/lib/python3.6/site-packages/weblate/settings.py based on the settings_example.py in the same directory).

cp ~/weblate-env/lib/python3.6/site-packages/weblate/settings_example.py
~/weblate-env/lib/python3.6/site-packages/weblate/settings.py

7. 配置

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

允许访问地址

# List of URLs your site is supposed to serve
ALLOWED_HOSTS = ["67.218.132.50"]

配置 email

我用的是 aliyun 邮箱

企业云邮箱POP\SMTP\IMAP地址和端口信息

找到 SMTP 地址和端口信息

EMAIL_HOST = 'smtp.mxhichina.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = 'xxx@xxx.com'
EMAIL_HOST_PASSWORD = 'xxxxxxxx'
...

 # E-mail address that error messages come from.
SERVER_EMAIL = 'iosdevlog@iosdevlog.com'
                                                                                                                                                                                                                                                                                               # Default email address to use for various automated correspondence from
# the site managers. Used for registration emails. 
DEFAULT_FROM_EMAIL = 'iosdevlog@iosdevlog.com'

测试发送 email

weblate sendtestemail xxx@xxx.com

github 登录

https://github.com/settings/developers

Application name

Virgilio

Homepage URL

http://67.218.132.50

Authorization callback URL

http://67.218.132.50/accounts/complete/github/

8. 数据库

Create the SQLite database and its structure for Weblate:

weblate migrate

9. 管理员

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

10. 启动环境

Start the development server:

weblate runserver 67.218.132.50:80 -d

11. 测试

Open a web browser, go to http://67.218.132.50/accounts/login/ and login with the user name admin and paste the password in.

12. 使用

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.

问题


检查

http://67.218.132.50/admin/performance/

发送的邮箱带 example.com

打开 http://67.218.132.50/admin/sites/site/1/

修改 Domain name 域名

Set correct sitename

find . -name "*.md"  -print0 | xargs -0 -I M extract M M.zh_Hans.xliff M.zh_Hans.skl en-US zh_Hans

参考


Quick setup guidel Configuring outgoing email

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Learn Android Studio 3Android architectureAndroid ComponentsDesign editor.pngKeyboard Shortcuts for

    iOSDevLog
  • IB Designables: Failed to render and update auto layout status forhttps://github.com/CocoaPods/Cocoa

    https://www.raywenderlich.com/156971/cocoapods-tutorial-swift-getting-started

    iOSDevLog
  • Transporter 上传慢解决方案

    解决使用 Transporter 上传 ipa 到 App Store 时,有时间会卡住或者非常慢。

    iOSDevLog
  • BizTalk Server 2006 Virtual Multi-Box Install

    One of the great improvements in BizTalk Server 2006 was the ease of the install...

    阿新
  • Protocol Buffer Basics: Java(一)

    This tutorial provides a basic Java programmer's introduction to working with pr...

    阿泽
  • How to Accelerate Your Python Deep Learning with Cloud GPU?

    This afternoon, I trained a 3-layers neural network as a regression model to pre...

    王树义
  • IT部门存在的意义,谁是IT的客户

    今天看到这么一篇文章,转过来给做IT的朋友。我们必须审视自己存在的理由和意义,不仅要分清最终的客户,还得和同为IT的协作者、IT客户做好服务。你尽力让你的客户开...

    崔文远TroyCui
  • 使用深度强化学习测试三消游戏(CS AI)

    测试视频游戏是制作过程中的关键步骤,需要花费大量时间和资源。一些软件公司正试图使用​​人工智能来替代能够使用人工代理的系统来减少对人力资源的需求。我们研究了使用...

    刘子蔚
  • Create a natural language classifier that identifies spam

    With the advent of cognitive computing and smart machines, machine learning and ...

    首席架构师智库
  • Control is important! model predictive control mpc.pytorch lib

    Optimal control is a widespread field that involve finding an optimal sequence o...

    用户1908973

扫码关注云+社区

领取腾讯云代金券