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 4w 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 7% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

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

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[devaslanphp/auto-translate

Auto generate translation JSON files

6627.3k](/packages/devaslanphp-auto-translate)[renatomarinho/laravel-multi-language

Laravel Multi Language

235.1k](/packages/renatomarinho-laravel-multi-language)

PHPackages © 2026

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