用于转换api的python包装器

transfluent的Python项目详细描述


Build Status

这是用于Transfluent API的python包装器。

安装

$ pip install transfluent

用法

importtransfluent# Initialize the Transfluent client and retrieve your authentication# token by using your email and password.client=transfluent.Transfluent()client.authenticate(email='example@example.org',password='my-password')# Alternatively, you may initialize the Transfluent client directly# with your authentication token.client=transfluent.Transfluent(token='my-token')# Order translations for a resource file.response=client.file_save(identifier='my-project/messages',language=1,file=open('translations/messages.pot'),type='po-file')print"The file contains {0} words.".format(response['word_count'])response=client.file_translate(identifier='my-project/messages',language=1,target_languages=[11],)print"{0} words were ordered.".format(response['word_count'])# Check if the translation for the resource file is complete.is_translated=client.is_file_complete(identifier='my-project/messages',language=11)ifis_translated:# Retrieve the translated resource file.content=client.file_read(identifier='my-project/messages',language=11)withopen('translations/en/LC_MESSAGES/messages.po','w')asout:out.write(content)else:# Check the precise translation progress for the resource file.status=client.file_status(identifier='my-project/messages',language=11)print"Translation is {0} complete.".format(status['progress'])

更改日志

在这里您可以看到python的每个transfluent之间更改的完整列表 释放。

0.3.0(2016年2月10日)

  • 添加了Python3支持。

0.2.1(2013年5月29日)

  • 修正了如何翻译文本的错误。

0.2.0(2013年5月29日)

  • 在中为textstextstranslate方法实现了python包装器 Transfluent的API

0.1.0(2013年4月22日)

  • 首次公开发行。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
mysql Spring,AWS,访问远程数据库:java。lang.AbstractMethodError:在组织中为空。springframework。果心命令比较器。findOrder(OrderComparator.java:142)   java什么是“未找到网络:缓存项[url:…]”确切的意思是?   java@EmbeddedId和@Id异常   java从一个数组中获取数据以创建另一个数组。这个循环怎么了?   主方法中的java调用值为10的rect上的scale,然后打印矩形区域   java将数据插入现有记录   出现n位数后的java拆分字符串   java Hibernate验证程序异常   安卓如何从监听器接收结果(java)   在paintbrushtype GUI中,java paintComponent()vs paint()和JPanel vs Canvas   java抛出异常,以便堆栈跟踪不包含某些类类型   java使用哪种语法来提高性能和资源利用率   java My regex搜索只打印出最后一个匹配项   安卓在xml解析中的java视图翻转器示例   java如何维护LDAP系统和关系数据库的完整性?