承接 sadegh19b/laravel-persian-lang 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sadegh19b/laravel-persian-lang

最新稳定版本:v2.1.2

Composer 安装命令:

composer require sadegh19b/laravel-persian-lang

包简介

Persian language files for Laravel

README 文档

README

This package provides Persian language files for Laravel.

  • Support Laravel 6 to 12

Installation

Option 1: Via Composer (Recommended)

You can install the package via composer:

composer require sadegh19b/laravel-persian-lang

Option 2: Manual Installation

If you prefer not to use Composer, you can manually copy the language files:

  1. Download or clone this repository
  2. Copy the fa folder from lang/ to your Laravel application's lang/ directory
  3. The language files will be available in your application

Usage

Setting the Language

After installing the package, the Persian language files are automatically available without any additional configuration.

Simply set the locale to fa in your config/app.php file:

'locale' => 'fa',

Or set it dynamically in your code:

app()->setLocale('fa');

That's it! Now you can use Laravel's translation functions normally:

__('validation.required')           // فیلد الزامی است
__('auth.failed')                   // اطلاعات ورود نادرست است
__('passwords.reset')               // رمز عبور بازنشانی شد
trans('pagination.previous')        // قبلی

No need to publish or use any namespace! The package works automatically when your locale is set to fa.

Publishing Language Files (Optional)

If you want to customize the translations, you can optionally publish them:

php artisan vendor:publish --tag=persian-lang

This will copy the language files to lang/fa/ in your application. Your published files will automatically take precedence over the package files.

Validation attributes

If you want to change validation attributes, just copy the validation-attributes.php file to your lang/fa/ directory and don't need to publish other translation files.

Available Language Files

  • auth.php - Authentication related translations
  • passwords.php - Password reset related translations
  • validation.php - Validation related translations
  • validation-attributes.php - Validation attributes related translations (added by me)
  • pagination.php - Pagination related translations

Contributing

Please feel free to submit any issues or pull requests.

License

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

统计信息

  • 总下载量: 569
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固