empuxa/laravel-translation-manager 问题修复 & 功能扩展

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

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

empuxa/laravel-translation-manager

最新稳定版本:v1.0.6

Composer 安装命令:

composer require empuxa/laravel-translation-manager

包简介

A smart translation manager for Laravel.

README 文档

README

This package will not receive any future updates. Who needs a manual translation manager when AI can do anything? ¯_(ツ)_/¯

Laravel Translation Manager

Latest Version on Packagist Tests Total Downloads

Banner

This package provides a web interface to manage your Laravel application translations. While the concept is heavily inspired by barryvdh/laravel-translation-manager, this package is a complete rewrite with a different approach to provide a better non-developer user experience:

  • there is a non-editable default language, to separate development from translation
  • it can export to sub-folders: for example, you can now have a lang/en/dashboard/charts.php file
  • all translation strings are on one page, that's based on Tailwind CSS
  • it has (some) tests 🫣

However, currently there are also some disadvantages (feel free to contribute!):

  • it does only read and export PHP files, no JSON
  • vendor translations are not supported
  • since all strings are on one page, big projects might have performance issues

Overview

Installation

This package requires Laravel 9.33+. You can install the package via composer:

composer require empuxa/laravel-translation-manager

Afterward, copy the vendor files:

php artisan vendor:publish --provider="Empuxa\TranslationManager\TranslationManagerServiceProvider"

Finally, run the migrations:

php artisan migrate

Don't forget to also update the config file config/translation-manager.php to your needs!

Usage

Local Storage / Single Server Setup

By default, the translation manager is available at /translation-manager. However, you can change the route in the config file. Before you can edit translations, you must also set up the output languages. The default language isn't editable to separate development and translation.

To push the translations into the database, you need to run the following command:

php artisan translation-manager:push-to-db

It's now possible to edit any language string via the web interface and save them to the database. If a language string already exists, it won't be overwritten. You can force that behavior by using the --force flag.

Before you can use the translations in your application, you need to export them to PHP files that will get stored in the lang folder. You can do that by running the following command:

php artisan translation-manager:pull-from-db

Cloud Storage / Multi Server Setup

The best way to use the translation manager in a cloud setup is to run a single server instance, where the translators can edit the translations. However, you might also want to push the translations to other environments. That's where cloud storage comes into play.

By using the translation-manager:push-to-storage command, you can push any lang file to the storage disk defined in the config. With the translation-manager:pull-from-storage command, you can then pull the translations from the storage disk.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

empuxa/laravel-translation-manager 适用场景与选型建议

empuxa/laravel-translation-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.64k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 06 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「i18n」 「translation-manager」 「marcoraddatz」 「empuxa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 empuxa/laravel-translation-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 empuxa/laravel-translation-manager 我们能提供哪些服务?
定制开发 / 二次开发

基于 empuxa/laravel-translation-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-26