Giter Club home page Giter Club logo

f-tt's Introduction

这是一个测试项目,构建了一个文档转换PO程序,用于文件翻译使用

环境:

  • ubuntu 18.04
  • Translate ToolKit 2.5.0 API
  • Python3.7
  • Flask 1.1.1
  • uWGSI

Translate ToolKit 官方文档 http://docs.translatehouse.org/projects/translate-toolkit/en/latest/api/index.html

目前实现的功能是:

  • txt文档转po文件(txt2po)(不管内容为何种语言,需要txt文件为utf-8编码)
  • json文件转po文件(json2po)(不管内容为何种语言,需要json文件为utf-8编码)
  • 对po文件进行分析统计(pocount)

How to use ?

(1)安装&运行uwsgi:

sudo apt-get install uwsgi uwsgi-plugin-python uwsgi-plugin-python3
sudo uwsgi /home/ubuntu/f-tt/flaskr/uwsgi.ini -d /home/ubuntu/f-tt/flaskr/logs/log.log

uwsgi.ini文件在项目的 f-tt/flaskr/uwsgi.ini (杀死uwsgi的命令是 sudo pkill -f uwsgi -9)

(2)修改nginx配置文件

sudo vim /etc/nginx/sites-available/default

server {
	listen 5000;

	root /var/www/html;

	server_name ip或者你的域名;

	location / {
		include /etc/nginx/uwsgi_params;
		uwsgi_pass 127.0.0.1:622;
	}

然后重启nginx即可.

(3)这时候输入地址:5000回车就能看到你的网站了.

f-tt's People

Contributors

finch-xu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.