a21/lexicon-client
Composer 安装命令:
composer require a21/lexicon-client
包简介
Laravel client for Lexicon: pull translation JSON exports from a central Lexicon server.
README 文档
README
Laravel package to connect a client application (Hub, Studio, Gallery…) to a central Lexicon translation server.
Requirements
- PHP 8.1+
- Laravel 10.x
Install (Packagist)
composer require a21/lexicon-client php artisan vendor:publish --tag=lexicon-config php artisan lexicon:init
Configuration
Add to .env (never commit secrets):
LEXICON_API_URL=https://lexicon.a21.com LEXICON_CLIENT_CODE=hub LEXICON_PROJECT_CODE=hub LEXICON_CLIENT_SECRET=lex_sk_live_xxxxxxxx LEXICON_ENVIRONMENT=production
Optional manifest at project root: lexicon.json (no secret in this file).
Commands
| Command | Description |
|---|---|
php artisan lexicon:init |
Create lexicon.json + append .env.example |
php artisan lexicon:status |
Check server connection and project metadata |
php artisan lexicon:export |
Request export bundle from server |
php artisan lexicon:pull |
Export + write JSON files locally |
php artisan lexicon:sync |
Placeholder (source scan coming later) |
Examples:
php artisan lexicon:status php artisan lexicon:pull --all php artisan lexicon:pull --lang=fr --area=catalog --only-approved --dry-run
Server setup
Create an integration client on the Lexicon server (admin API). Copy the secret once, then configure this package.
See the Lexicon server docs: docs/client-package.md, docs/integration-api.md, docs/export-cli.md.
Security
- Keep
LEXICON_CLIENT_SECRETserver-side only (.env). - Never put the secret in
lexicon.jsonor frontend code.
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-26