用于转换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第三方库


热门话题
java限制C++代码访问JNI中的某些类   Android上的java DateFormat:不可解析的日期   通过json进行java迭代,并为其他请求调用多个API   Netbeans中的java JavaFX项目引发异常“输入流不能为null”   多线程Java newFixedThreadPool解释   |在java字符串中无法识别。split()方法   Java中的原始包装器类是否被视为引用类型?   Java swing。如何在intellij idea GUI设计工具中重写组件方法   数组乘矩阵   java将30GB的XML文件分割成小块XML   java通过一棵树递归找到一个节点,并返回指向该节点的路径   java如何将可观察的<Observable<List<T>>转换为可观察的<List<T>>   使用java在web服务器上更改php文件中的字符串?   java希望开发像tomcat这样的servlet容器   java希望提高编程的数学技能