承接 atpro/translator 相关项目开发

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

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

atpro/translator

Composer 安装命令:

composer require atpro/translator

包简介

Atpro translator allows you to translate lang files into several languages and thus save time in managing the internationalization of your laravel projects

README 文档

README

Build Status Latest Stable Version License

Introduction

Atpro-translator is a package that allows you to easily manage the internationalization in your applications.

Installation

To get started with Atpro-translator, use Composer to add the package to your project's dependencies:

    composer require atpro/translator

Configuration

After installing the Atpro-translator library, register the \Atpro\Translator\AtproServiceProvider::class in your config/app.php configuration file:

'providers' => [

        \Atpro\Translator\AtproServiceProvider::class,
    ],

Also, register the middleware in web middleware groups by simply adding the middleware class :

AtproTranslateMiddleware::class,

into the $middlewareGroups of your app/Http/Kernel.php file.

And then run :

php artisan vendor:publish

publish AtproServiceProvider.

Usage

To translate your lang files into other languages:

Run the command in terminal

    php artisan atpro:translate 

Example:

  1. php artisan atpro:translate and click enter
  2. --> Your started language ? en
  3. --> Your translated list language seperated with commas (,) example: fr,es ... ? fr,it,es
  4. Click enter and wait for translated files

It will generate translated files in respective folder fr,it,es

OPTIONAL OPTIONS:

Options Description Examples
--e Generate files for all languages without any php artisan atpro:translate --e='user.php,test.php'
--f Generate files for specific path php artisan atpro:translate --f='user.php,test.php'

B. To generate views for translation:

Run the command in terminal

    php artisan atpro:generate-view-translate

Example:

  1. php artisan atpro:generate-view-translate and click enter
  2. --> Yours languages seperated with commas (,) example: fr,es ... ? fr,it,es
  3. Click enter and wait for generate views translate

It will generate a middleware, in controller, a routes file and a component containing the different options according to the chosen languages

You will also have a new component <x-atpro::language> </x-atpro::language>. You can use it in views.

Note: Make sure that the started language folder exists in your language folder and contains files you want to translate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固