POST /api/v1/search HTTP/1.1 Host: i18ns.com Content-Type: application/json x-access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx { "language":"en", "content":"settings" }
名称 | 说明 |
---|---|
请求方式 | POST |
请求地址 | https://i18ns.com/api/v1/search |
x-access-token | API访问令牌 点击登录来获取. |
请求内容 |
language: 搜索语言. [en, zh, es, fr, ar, pt, ru, ja, ko, de, it] content: 搜索内容 |
限制 |
API免费版每天调用上限为1000次。 如果有更高需求,欢迎选择 付费版 ,支持i18ns可持续的服务。 联系方式:[email protected] |
[ { "format": 0, "translations": { "ar": ["الإعدادات"], "de": ["Einstellungen"], "en": ["Settings"], "es": ["Ajustes"], "fr": ["Paramètres"], "ja": ["設定"] } }, { "format": 0, "translations": { "ar": ["الإعدادات"], "de": ["EINSTELLUNGEN"], "en": ["SETTINGS"], "es": ["AJUSTES"], "fr": ["PARAMÈTRES"], "zh": ["设置"] } }, ... ]
字段 | 说明 |
---|---|
format | 当前翻译数据的格式: 0: 单个翻译格式; 1: 复数内容格式(一些语言存在单复数表示差异); 复数字符串表示规则参看 这里 |
translations | 翻译内容. 当format 为0, 表示语言数组中只有一条翻译内容: "translations": { "ar": ["الإعدادات"], // Arabic translations. "de": ["EINSTELLUNGEN"],// German translations. "en": ["SETTINGS"], // english translations. "es": ["AJUSTES"], // Spanish translations. "fr": ["PARAMÈTRES"], // French translations. "zh": ["设置"] // chinese translations. }当 format 为1, 表示当前数据为复数翻译格式,翻译内容以固定的顺序存放在语言数组中: "translations": { en:[ "xx",//"other": "xx",//"zero": "xx",//"one": "xx",//"two": "xx",//"few": "xx"//"many": ] ... } |
POST /api/v1/search HTTP/1.1 Host: i18ns.com Content-Type: application/json x-access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx { "language":"en", "content":"%s days" }返回内容:
[ { "format": 1, "translations": { "ar": [ "%s أيام", "%s أيام", "%s يوم", "%s أيام", "%s أيام", "%s أيام" ], "da": [ "%s dage", "%s dage", "%s dag", "", "", "" ], "de": [ "%s Tage", "%s Tage", "%s Tag", "", "", "" ], "en": [ "%s days", "%s days", "%s day", "", "", "" ], "es": [ "%s días", "%s días", "%s día", "", "", "" ], "es_ES": [ "%s días", "%s días", "%s día", "", "", "" ], "fr": [ "%s jours", "%s jours", "%s jour", "", "", "" ], "it": [ "%s giorni", "%s giorni", "%s giorno", "", "", "" ], "ja": [ "%s日", "%s日", "", "", "", "" ], "ko": [ "%s 일", "%s 일", "", "", "", "" ], "pl": [ "%s dni", "%s dni", "%s dzień", "", "%s dni", "%s dni" ], "pt": [ "%s dias", "%s dias", "%s dia", "", "", "" ], "pt_BR": [ "%s dias", "%s dias", "%s dia", "", "", "" ], "ru": [ "%s дней", "%s дней", "%s день", "", "%s дня", "%s дней" ], "vi": [ "%s ngày", "%s ngày", "", "", "", "" ], "zh": [ "%s天", "%s天", "", "", "", "" ], "zh_CN": [ "%s天", "%s天", "", "", "", "" ], "zh_HK": [ "%s天", "%s天", "", "", "", "" ], "zh_TW": [ "%s天", "%s天", "", "", "", "" ] } }, { "format": 0, "translations": { "ar": [ "%s يوم" ], "bg": [ "%s дни" ], "cs": [ "%s dní" ], "da": [ "%s dage" ], "zh": [ "%s 天" ], "zh_HK": [ "%s 天" ], "zh_TW": [ "%s 天" ] } }, ... ]