thinktomorrow / squanto
开发期间及之后用于静态 Laravel 翻译的文本管理器
3.0.3
2024-01-08 10:30 UTC
Requires
- php: >=8.1
- ext-json: *
- illuminate/contracts: ~9.11|~10.0
- illuminate/database: ~9.11|~10.0
- illuminate/support: ~9.11|~10.0
- league/flysystem: ~3.0
- thinktomorrow/dynamic-attributes: ^0.4.2
Requires (Dev)
- mockery/mockery: ^1.5.1
- nunomaduro/larastan: ^2.4
- orchestra/testbench: ^7.5|^8.10
- phpunit/phpunit: ^9.5|^10.3
- spatie/temporary-directory: ^1.1
- dev-master
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.3.x-dev
- 2.1.x-dev
- 2.0.1
- 2.0.0
- 1.0.0.x-dev
- 1.0.0
- 1.0.0-beta
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.3
- 0.2.2
- 0.2.1.2
- 0.2.1.1
- 0.2.1
- 0.2.0
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- dev-ft/3.2
- dev-TempDimsavUpdate
- dev-feature-rename-key
- dev-feature-abstract-views
- dev-notes-for-better-config
This package is auto-updated.
Last update: 2024-09-08 12:11:48 UTC
README
在开发期间及之后管理您的 Laravel 应用程序的静态翻译。Squanto 的名字来源于一位最早的 土著美国翻译员,是一种有见地的数据库中管理翻译的方法。
注意:此包仍在开发中,API 将会发生变化。尽管如此,请尝试使用此包,因为反馈非常受欢迎!
要求
- php >= 7.4.7
- Laravel >= 8.0
安装
通过 Composer
$ composer require thinktomorrow/squanto
设置
此包的服务提供程序将由 Laravel 自动发现。请注意,有两个提供程序:一个是通用包服务提供程序,还有一个是为管理器浏览器 UI 分离的。
运行迁移。这将在您的数据库中添加一个名为 squanto_lines
的表。
$ php artisan migrate
接下来,发布配置文件。
php artisan vendor:publish --tag=squanto-config
在配置中,通过 Squanto 设置您希望维护的不同语言环境。大多数其他配置设置都是合理的默认值,应该可以正常工作。
管理界面
路由
添加以下路由。这些是查看和编辑翻译的路由定义。请确保您添加了必要的认证中间件。
Route::get('translations/{id}/edit', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'edit'])->name('squanto.edit'); Route::put('translations/{id}', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'update'])->name('squanto.update'); Route::get('translations', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'index'])->name('squanto.index');
所见即所得编辑器
需要 'redactor' 编辑器,因此您需要包含 CSS 和 JS 资产。由于您需要许可证,因此未提供这些资产。您可以自由切换编辑器。需要所见即所得的文本区域被分配了 redactor-editor
类。
用法
以下控制台命令可供开发者使用。
# Push all language lines to the database. Existing database values will remain untouched. $ php artisan squanto:push # Remove database lines that are no longer present in the language files. $ php artisan squanto:purge # Check if your database lines are up to date, and if a push or purge command is advised. $ php artisan squanto:check # Rebuild the database cache. $ php artisan squanto:cache
变更日志
有关最近更改的更多信息,请参阅 变更日志。
测试
$ composer test
安全
如果您发现任何与安全相关的问题,请通过电子邮件发送到 dev@thinktomorrow.be,而不是使用问题跟踪器。
致谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件。