PHPackages                             lyxxxh/lartran - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. lyxxxh/lartran

ActiveLibrary[Localization &amp; i18n](/categories/localization)

lyxxxh/lartran
==============

laravel使用 百度翻译和有道翻译

013PHP

Since Jun 12Pushed 7y agoCompare

[ Source](https://github.com/lyxxg/lartran)[ Packagist](https://packagist.org/packages/lyxxxh/lartran)[ RSS](/packages/lyxxxh-lartran/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

### 前言

[](#前言)

```
未开发完成，但能正常使用百度翻译。
有道翻译接口正在开发中

```

### 安装

[](#安装)

```
 composer require lyxxxh/larmodel
 添加服务提供者
 Xxh\LarTran\LarTranProvider::class

 添加门脸
 'LarTran' => Xxh\LarTran\Facades\LarTran::class

 发布配置
 php artisan vendor:publish --provider="Xxh\LarModel\Xxh\LarTran\LarTranProvider"

 默认使用百度翻译
 appid和key 自行替换（默认是用我的）

```

### 使用

[](#使用)

### LarTran::tran(要转换的文字,要转换的语言)

[](#lartrantran要转换的文字要转换的语言)

```
$res = LarTran::tran('世界','en');
echo $res;
//World

$res = LarTran::tran('tel','zh');
echo $res;
//电话

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fbda2846ce7576ecbef245263ab795e62a1ea4a31c6d58bfdea89e20194ec90?d=identicon)[lyxxg](/maintainers/lyxxg)

### Embed Badge

![Health badge](/badges/lyxxxh-lartran/health.svg)

```
[![Health](https://phpackages.com/badges/lyxxxh-lartran/health.svg)](https://phpackages.com/packages/lyxxxh-lartran)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
