usepolylingo/polylingo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

usepolylingo/polylingo

最新稳定版本:v0.1.0

Composer 安装命令:

composer require usepolylingo/polylingo

包简介

Official PHP SDK for the PolyLingo translation API

README 文档

README

PHP client for the PolyLingo translation API.

Requires PHP 7.4 or newer.

Install

composer require usepolylingo/polylingo

Quick start

<?php

use PolyLingo\PolyLingo;

$client = new PolyLingo([
    'apiKey' => getenv('POLYLINGO_API_KEY'),
    // 'baseURL' => 'https://api.usepolylingo.com/v1',
    // 'timeout' => 120_000,
]);

$r = $client->translate([
    'content' => '# Hello',
    'targets' => ['es', 'fr'],
    'format' => 'markdown',
]);

echo $r['translations']['es'];

API

Method Notes
$client->health() GET /health
$client->languages() GET /languages
$client->translate([...]) POST /translate
$client->batch([...]) POST /translate/batch
$client->usage() GET /usage
$client->jobs->create([...]) POST /jobs (202)
$client->jobs->get($jobId) GET /jobs/:id
$client->jobs->translate([...]) Submit job, poll until done (pollInterval, timeout, onProgress)

Responses are associative arrays matching the JSON API (e.g. translations, usage).

Errors

PolyLingo\Errors\PolyLingoException is the base type (getHttpStatus(), getErrorCode(), getMessage()). Subclasses: AuthException (401), RateLimitException (429, optional getRetryAfter()), JobFailedException (failed or timed-out job, includes getJobId()).

Documentation

PHP SDK on usepolylingo.com

Repository

github.com/UsePolyLingo/polylingo-php

License

MIT

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固