ibrhaim13/translate
Composer 安装命令:
composer require ibrhaim13/translate
包简介
laravel static text translate package for laravel 7 up
README 文档
README
ibrhaim13/mdb-translate is laravel translation package using mongodb for static text that is simple,dynamic and enjoyable to use.
Official Documentation
Install (Laravel ^10.0)
Install via composer
composer require ibrhaim13/translate
Publish Package
will publish Package Components translate13 (config file), Migration file, view,
php artisan vendor:publish --force --tag=translate13
Dependents:
you should install laravel on of Starter Kits auth package like auth/ui or laravel-breeze or other cause should this feature for admins. we are also Dependent to laravel view app layout if you want to make your custom view you do not need it at all.
Basic Configure Package
Run migrate
php artisan migrate
add middleware for web middleware group for add local to url path
# app/Http/Kernel.php protected $middlewareGroups = [ 'web' => [ ..., Ibrhaim13\Translate\Http\Middleware\Web\Localization::class, ... ]
will change local of app once change it at url.
add prefix to routes via Route Service Provider of application
# app/Providers/RouteServiceProvider.php # boot function inside route callback funcation add ->prefix(Localization::routePrefix()) Route::middleware('web')->prefix(Localization::routePrefix()) ->group(base_path('routes/web.php'));
Advance Configure Package
you can be custom route ,prefix,add new language and add your middlewares as you like view, and you should add translate page route into your navbar of app, so you can access page you can add new translate group via extend the model and overwrite the group
# app/Models/YourTranslateModelExtendFromPackageModel.php public static array $groups = [ 'str_public', 'str_admin', //here add your new group as you like ];
How you can use
after set up your configuration you can access translate page to add new keys so you can translate it from admin panel
#first segment is a group name #secand segment is translated key __('str_public.key name');
by default there two group name str_public,str_admin,after add the key before open translate admin page you must open the page there have this key so laravel application loaded
to access translate admin panel page
http://yourdomain.com/en/translate
then click on generate button to generate static translate files after edit your translation ##NOTE: YOUR SERVER NEED PERMISSION TO CRAETE TRANSLATIONS FILES
Security Vulnerabilities
e-mail us at i.musabah92@gmail.com
License
ibrhaim13/translate is open-sourced software licensed under the MIT license.
ibrhaim13/translate 适用场景与选型建议
ibrhaim13/translate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「mongodb」 「static」 「laravel」 「translate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ibrhaim13/translate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ibrhaim13/translate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ibrhaim13/translate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates Symfony2 documents, forms and CRUD
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
2lenet/EasyAdminPlusBundle
TwigStan is a static analyzer for Twig templates powered by PHPStan
Analysis module for finding problematical shop data.
A package to allow laravel/passport use with mongodb/laravel-mongodb
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-26