Skip to content

Commit

Permalink
添加获取文件字数和语种
Browse files Browse the repository at this point in the history
  • Loading branch information
NameIsBad committed Jan 26, 2021
1 parent 8f9df5f commit 0334ce6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 86 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# Documentation
# Documentation

### 1.首先安装 sphinx

```
pip install sphinx sphinx_intl sphinx_rtd_theme recommonmark
```

### 2.生成 Html 命令

```
make html
```
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TranslateDoc

translate/TranslateText
translate/TranslateFile
translate/FileWordsCount

.. toctree::
:maxdepth: 1
Expand Down
57 changes: 57 additions & 0 deletions source/translate/FileWordsCount.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
**获取文件字数和语种**
======================

**请求地址**

::

POST https://api2.ctcfile.com/translations/words-count

**请求参数**

==== ====== ====== ==== ============
属性 类型 默认值 必填 说明
==== ====== ====== ==== ============
file binary 是 翻译文件(流)
==== ====== ====== ==== ============

**返回值**

================= ====== ====================================
属性 类型 说明
================= ====== ====================================
word_count int 文件字数
src_language_type string 语种( :doc:`../overview/LanguageType`)
================= ====== ====================================

**返回数据示例**

正常返回

.. code:: json
{
"word_count": 5221,
"src_language_type": "zs"
}
错误时返回

======= ======================================================== =======================================
错误码 英文描述 中文描述
======= ======================================================== =======================================
40003 Not enough words. 字数不够
40004 Number of word has expired. 字数已经过期
40006 File has no words. 文件里没有字
-- Other :doc:`../overview/StatusCode` 其他 :doc:`../overview/StatusCode`
======= ======================================================== =======================================


**在线调试**

开发者可以使用 |网页调试工具| 调试该接口

.. |网页调试工具| raw:: html

<a href="https://api2.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/post_translations_words_count" target="_blank">网页调试工具</a>
85 changes: 0 additions & 85 deletions source/translate/OpenLink.md

This file was deleted.

0 comments on commit 0334ce6

Please sign in to comment.